Powershell script to stop NSSM service responds as pending status and causes deployment failure

Hi,

I am using Octopus deploy to deploy a python service. We have used NSSM to create a windows service for the python process. Before deployment we require to stop the service.
I have added “Run a script” to stop the windows service. On some environments it works fine, in others the script returns a Pending Status due (in the background that service stops fine) This causes Octopus deploy to mark that step as failed and it fails the entire deployment even though its actually success. Is there a way to mark the step and entire process as a success instead of failure?

Regards,
Pari

Hi Pari,

Thanks for getting in touch!

When running a script step the success or failure is based on the exit code of the script being run.
It sounds like you may need to amend your script so that it performs a direct check of the service status after attempting to stop it and perhaps loop this for a few retries until you receive the desired stopped state.

Regards,
Paul

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.