Can't start windows service using a custom account

Hi, we are trying to deploy a windows service using a custom account with no luck - the process fails when the service tries to get started. The problem seems to be the password not being captured, even hardcoding the password in the template configuration (to rule out binding problems with parameters) gets us the same error. The service is deployed properly because we were able to start it manually by changing the account password in the service settings. The deployment error we are getting is :

Cannot start service X on computer ‘.’.

We’re running v3.2.11.

Hi Javier,

Thanks for getting in touch! The only time we have reports of custom accounts not working, is when the password contains special characters. We have fixed many of these recently, but you are on a very recent version. Are you able to let me know if there are any non alpha-numeric characters in your password and what they are specifically.

If this is not the case, could you please provide a full deployment log, and a screenshot of your settings in the deployment process.


Hi Vanessa, thanks for getting back to us. The password only has alphanumeric symbols. I’m attaching the error log, as for the windows service template settings, there’s nothing special about it, you should be able to reproduce the error if you use a custom account to start your service that has “Log on as a service” privileges (Local Security Policy -> Security Settings -> Local Policies -> User Rights Assignment -> Log on as a service).
As a temporary solution, we ended up setting the Service account as “Local System” and the Start mode as “Manual” (to prevent the service from being auto started), then in the Post-deployment stage we run :

sc.exe config #{Octopus.Project.Name} start= “auto” obj= ($OctopusParameters[‘env:USERDOMAIN’].Trim() + “$ProcessOwner”) password= “$ProcessOwnerPassword”
Start-Service -Name #{Octopus.Project.Name}

This modifies the service account to what we want and starts the service.

Let us know what you think,

ServerTasks-3384.log.txt (12 KB)