Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rabbitmq-service.bat install fail but return error code 0 as if it succeeded #1052

Closed
pascaltozzi opened this issue Dec 6, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@pascaltozzi
Copy link

pascaltozzi commented Dec 6, 2016

There multiple way to replicate the issue this one is simpler:

  1. Download ProcessExplorer from Microsoft
  2. Open ProcessExplorer
  3. Delete the RabbitMQ service (it won't be deleted, it will be marked for deletion)
  4. Install RabbitMQ service (It will fail)

Here is result from step 4:

rabbitmq_server-3.6.4\sbin>rabbitmq-service.bat install

C:\Program Files\erl8.1\erts-8.1\bin\erlsrv: Unable to register RabbitMQ service with service manager.
Error: The specified service has been marked for deletion.
C:\Program Files\erl8.1\erts-8.1\bin\erlsrv: No service with the name RabbitMQ exists.

rabbitmq_server-3.6.4\sbin>echo Exit Code is %errorlevel%
Exit Code is 0

RabbitMQ service installer returned that there no error, when in reality there was one.

https://github.com/rabbitmq/rabbitmq-server/blob/master/scripts/rabbitmq-service.bat

@michaelklishin
Copy link
Member

Thanks for providing the steps to reproduce. We will triage it.

@kjnilsson
Copy link
Contributor

I wasn't able to reproduce it exactly as described above however it is clear that the install batch file does not check the ERRORLEVEL of the last erlsrv command and instaed just skip to the :END label that exits with a '0'. I will add a check and we can do some more testing. @michaelklishin should I submit against stable?

@kjnilsson
Copy link
Contributor

When testing I also noted a scenario we won't be able to handle which is this. Here erlsrv does not return a non-zero exit code as this error isn't considered severe enough.

@michaelklishin
Copy link
Member

@kjnilsson I think so, unless you see how this can be harmful. If there is an error we should fail early, I think :)

@michaelklishin
Copy link
Member

@pascaltozzi a fix (#1053) will be in 3.6.7. Thank you for the detailed report that made it much easier to reproduce!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants