-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Ubuntu 16.04.3 LTS
Jenkins 2.89.4
PostBuildScript plugin 2.5.0
config.xml testScript.sh
Each time my build runs, PostBuildScript is saying there is an error (project names redacted):
[PostBuildScript] - Executing post build scripts. [PostBuildScript] - Executing the script /var/lib/jenkins/workspace/<project>/<module>/mvp-contexts/updateVms.sh with parameters [/var/lib/jenkins/workspace/<project>]. [MCP] $ /bin/bash /tmp/jenkins4164249000057985231.sh /var/lib/jenkins/workspace/<project> [PostBuildScript] - [ERROR] Problem occurred: Error while executing script Build step 'Execute Scripts' changed build result to FAILURE Build step 'Execute Scripts' marked build as failure
But if I SSH into the Jenkins machine and su to the Jenkins user, I can copy that command from the [MCP] line and run it just fine.
I've tried it with just a hello world echo statement in the script with the same result.
The parameter is workspace project location so the script can reference workspace files.
EDIT
I think I've figured it out. If there is a space after the shebang (#!) in the script, it fails in the plugin, but running the command from the log output works. I've attached my config.xml and testScript.sh for reproducing the bug.
Thanks for submitting this issue! I must reproduce the problem in order to fix it. Could you please provide the script and the job configuration (config.xml)?