If file is not executable all user sees is:
Failing task since return code of [/home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAY-ES-JOB1/myScript.sh] was -1 while expected 0
-1 is not the proper return code for permission errors, so user is left clueless.
Inside the task code however:
if (scriptFile.exists()) { // This can happen due to noexec mounted filesystems or the file didn't have perms in the first place if (config.isRunAsExecutable() && !scriptFile.canExecute()) { // *** This should emit to build log! log.warn("Command [" + scriptFile.getAbsolutePath() + "] is not executable, trying to run anyway."); } } else { // *** This should emit to build log too! log.info("File [" + scriptFile.getAbsolutePath() + "] doesn't exist, trying to run [" + config.getScriptFilename() + "] anyway."); //maybe it's on PATH, let's see what happens }
So the system is properly warning about the execution issue, but only in a place system admins will see it. This should be emitted as an error/NOTICE to the build log.
[BAM-19778] Script task should emit file permission errors to build log
Workflow | Original: JAC Suggestion Workflow [ 3017983 ] | New: JAC Suggestion Workflow 3 [ 3603163 ] |
Status | Original: RESOLVED [ 5 ] | New: Closed [ 6 ] |
Workflow | Original: Confluence Workflow - Public Facing v4 [ 2703061 ] | New: JAC Suggestion Workflow [ 3017983 ] |
Symptom Severity | Original: Minor [ 14432 ] | New: Severity 3 - Minor [ 15832 ] |
Issue Type | Original: Improvement [ 4 ] | New: Suggestion [ 10000 ] |
Workflow | Original: Bamboo Workflow 2016 v1 [ 2646581 ] | New: Confluence Workflow - Public Facing v4 [ 2703061 ] |
Resolution | Original: Fixed [ 1 ] | New: Done [ 17 ] |
Status | Original: In Progress [ 3 ] | New: Resolved [ 5 ] |
Fix Version/s | New: 6.5.0 [ 78390 ] | |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Occurrence Factor | New: 10% [ 12830 ] | |
Symptom Severity | New: Minor [ 14432 ] | |
Status | Original: Needs Triage [ 10030 ] | New: Open [ 1 ] |
Assignee | New: Alexey Chystoprudov [ achystoprudov ] |