Windows service deploys but cannot be started

Pulling what little hair I have left out on this one. Not very descriptive (to me anyway), so am hoping there are more verbose logs somewhere? Here is what I get from Octopus when trying to deploy and start the service:

[SC] ChangeServiceConfig SUCCESS
Starting the Test.Service service
Start-Service : Service ‘Test Service (Test.Service)’ cannot be started due to the following error:
Cannot start service Test.Service on computer ‘.’.
At C:\Program Files\Octopus Deploy\Tentacle\Scripts\Octopus.Features.WindowsService_BeforePostDeploy.ps1:123 char:2

  • Start-Service $ServiceName
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
    • FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand
      PowerShell script returned a non-zero exit code: 1

Any ideas on how to get to what is really happening so I can fix it? TIA!


Hi Dean,

Thanks for getting in touch, are there any errors in the Windows event viewer? It sounds like Octopus tells the service to start, and then Windows reports that the service couldn’t start - Octopus doesn’t know much more about it, but hopefully the service you are starting logs somewhere.



Are you using a custom Windows account that the service deploys under? I found an issue in the 2.4.1/2 release where my services can’t start because the password isn’t being set any more. The workaround I used was to create a custom variable and have that variable used in the password field of the windows service.


No it’s the Local Service account. Turns out it was a combination of a misconfigured service (via app.config) and also that the service was not logging anything, etc. Once I get some Powershell magic worked out to handle the configuration transforms it should be good to go, thanks both of you for the help!