Why does a windows service, hosting an NserviceBus endpoint in NServiceBus.Host.exe, fail to start when there are NO errors reported for the exe?

StackOverflow https://stackoverflow.com/questions/23408585

Question

To be clear there are no Errors for the hosted service, just a generic Windows service error.

The error message says:

Error 1053: The service did not respond to the start or control request in a timely fashion.

If I run NServiceBus.Host explicitly (where the windows service is installed) I am presented with relevant messages indicating a successful "spinning up" of the end point, and, in fact, I can see subscription message(s) are persisted into a relevant private MSMQ queue and the exe then sits and waits, like a good server should, for something to happen upon it.

If I start the windows service (hosting the endpoint) there are no exceptions or events in the event viewer, or entries in the log file to indicate any errors or give me reason to believe something bad is happening. If I look in the log file and queue I can see subscription messages are indicated as dispatched, in effect, the same behavior as running it standalone, with the only difference being that the service wont start.

EDIT: The windows service is provided by the NServiceBus framework in the form of a generic host, and therefore implementation of the various required windows service methods is not something I have control of, which you would normally have if you were creating the windows service yourself.

Was it helpful?

Solution

The most common reason that I've found for this is down to logging.

The user account running the service must have Performance Monitoring Access.

I add this through Server Manager > Users & Groups > Groups > Performance Log Users > Add.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top