Open vipul0506 opened 10 months ago
Service Monitor stop and start the W3SVC. (here is the line of code that stop the W3SVC service https://github.com/microsoft/IIS.ServiceMonitor/blob/main/src/ServiceMonitor/Main.cpp#L47)
Also, it has timeout setting defined to start and stop service. Its W3SVC in your case and timeout setting set to 20 sec (hardcoded value). https://github.com/microsoft/IIS.ServiceMonitor/blob/main/src/ServiceMonitor/ServiceMonitor.h#L26-L28
There could be a instance where service mayn't complete stop or start in 20 sec and hence you will get the same error. You could increase timeout setting maxiumum to 30 sec, otherwise it gets timed out at OS level.
If you have very slow system, where service restart may take between 30-40 sec. I would recommend you to increase the OS setting (registry one to increase service start/stop timeout) along with service monitor timeout.
How to increase OS level service timeout?
Note: If the ServicesPipeTimeout entry does not exist, you must create it. To do this, follow these steps:
I'm currently running IIS app inside a windows container. These are the three last lines of my startup script:
Invoke-Expression -Command "net start w3svc"; Invoke-Expression -Command "iisreset"; Invoke-Expression -Command "C:\\ServiceMonitor.exe w3svc"
And here are the log trail from startup script:Attempting stop...
Restart attempt failed.
The system cannot find the file specified. (2147942402, 80070002)
ERROR: Failed to stop or query status of service 'w3svc' error [800705b4]
I've reviewed the log trail for the startup script and It seems to be failed during on
iisreset
not sure if ServiceMonitor is contributing anything here. I can see this error was reported in the past - https://github.com/microsoft/IIS.ServiceMonitor/issues/49Could you please confirm if this error has been fixed in the latest version of IIS.ServiceMonitor or provide guidance on how we can resolve this issue? Thank you for your assistance.