certify icon indicating copy to clipboard operation
certify copied to clipboard

[v5] Deployment Tasks: Start a Service incorrectly attempts Stop instead

Open JLJTGR opened this issue 6 years ago • 2 comments

Version: 5.0.6.0

Stop and restart seem to work; start throws an exception:

2020-05-14 16:47:31.179 -04:00 [INF] ---- Performing Task [On-Demand or Manual Execution] :: Start hMailServer ----
2020-05-14 16:47:31.179 -04:00 [INF] Task [Start hMailServer] :: Task is enabled and primary request was successful.
2020-05-14 16:47:31.181 -04:00 [INF] Starting service [hMailServer] 
2020-05-14 16:47:31.183 -04:00 [ERR] Start hMailServer (Stop, Start or Restart a Service) :: Task Failed with Exception :: System.InvalidOperationException: Cannot stop hMailServer service on computer '.'. ---> System.ComponentModel.Win32Exception: The service has not been started
   --- End of inner exception stack trace ---
   at System.ServiceProcess.ServiceController.Stop()
   at Certify.Providers.DeploymentTasks.Core.ServiceManager.<Execute>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Certify.Providers.DeploymentTasks.DeploymentTask.<Execute>d__10.MoveNext()

As a side request, is it possible for "restart" to start a service if it is currently stopped, instead of throwing an error that it cannot stop a stopped service?

JLJTGR avatar May 14 '20 20:05 JLJTGR

Will get that fixed and will also skip Stop if service state is already stopped. Thanks for testing!

webprofusion-chrisc avatar May 15 '20 03:05 webprofusion-chrisc

Updated beta release is out now.

webprofusion-chrisc avatar May 15 '20 09:05 webprofusion-chrisc