1

I have a server application running on an Azure hosted virtual machine. This application consists of four windows services.

Every night I shutdown (deprovision) the virtual machine.

When I restart the machine, one of the four services fails to start. It's usually the same one.

If I then restart the machine, all four services start. If I stop the machine (leaving it provisioned) and then start it again, all four services start. It's only when the machine launches from the deprovisioned start the service fails to start.

I look in the event logs, and I see the following error:

A timeout was reached (30000 milliseconds) while waiting for the service to connect

I have tried configuring the Recovery options of the service so that it would Restart the Service after failing, with Enable actions for stops with errors: ticked. This has no effect.

My service code is a .NET application. I implemented logging, and made it log to a file as soon as it starts up. When it fails to start, no log entries are written. It's as if the application completely fails to load.

Is there a recommended way to approach this problem? (ie to diagnose the root cause, and to stop it happening).

1 Answer 1

3

Set the service's startup type as "Automatic (Delayed start)". Since the service runs .Net, and doesn't log anything within the 30 seconds timeout clearly indicates that the .Net assemblies didn't load in time (Cold start). Unfortunately, you have no control on this so your best bet is to delay its startup. Always worked for me!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.