Octopus.Action.FailScriptOnErrorOutput and exit code -1


We have some custom deploy scripts that only write to stderr and does not return an error code when something goes wrong. We found the flag Octopus.Action.FailScriptOnErrorOutput and activated this. But this seem to cause successfully completed scripts start exiting with error code -1. Are you familiar with this issue?

We are running server version 3.16.7.

Something that might help you reproduce: One of the scripts that successfully run, but exit with error code -1 is the Slack Notification template - https://library.octopusdeploy.com/step-template/actiontemplate-slack-notify-deployment . The notification is posted to slack, but still exit with error code -1.

The output:

Executing script on '<machine>'					Info		September 5th 2017 10:39:12
ok											Info		September 5th 2017 10:39:15
The remote script failed with exit code -1			Fatal	September 5th 2017 10:39:15
Slack - Notify Deployment to #deploy on <machine>	Fatal	September 5th 2017 10:39:15

Best regards,

Hi Eirik,

Thanks for getting in touch! I’ve performed some local testing and have been able to confirm that using Octopus.Action.FailScriptOnErrorOutput does indeed present an error as you have described.

I have escalated this within my team to determine if this is expected behaviour or a fault, we will get back to you as soon as possible with an answer.



Hi Eirik,

I have raised an issue for this, you can track it at https://github.com/OctopusDeploy/Issues/issues/3773.
As a workaround for now, I suggest modifying the custom script to also return a non 0 result.



Will track the issue and hoping for a quick fix :slight_smile: