Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-19778

Script task should emit file permission errors to build log

    • Icon: Suggestion Suggestion
    • Resolution: Done
    • 6.5.0
    • Logs
    • None
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      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

            Katherine Yabut made changes -
            Workflow Original: JAC Suggestion Workflow [ 3017983 ] New: JAC Suggestion Workflow 3 [ 3603163 ]
            Status Original: RESOLVED [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing v4 [ 2703061 ] New: JAC Suggestion Workflow [ 3017983 ]
            Owen made changes -
            Symptom Severity Original: Minor [ 14432 ] New: Severity 3 - Minor [ 15832 ]
            Owen made changes -
            Issue Type Original: Improvement [ 4 ] New: Suggestion [ 10000 ]
            Owen made changes -
            Workflow Original: Bamboo Workflow 2016 v1 [ 2646581 ] New: Confluence Workflow - Public Facing v4 [ 2703061 ]
            Alexey Chystoprudov made changes -
            Link New: This issue is duplicated by BAM-17134 [ BAM-17134 ]
            Alexey Chystoprudov made changes -
            Resolution Original: Fixed [ 1 ] New: Done [ 17 ]
            Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
            Alexey Chystoprudov made changes -
            Fix Version/s New: 6.5.0 [ 78390 ]
            Status Original: Open [ 1 ] New: In Progress [ 3 ]
            Alexey Chystoprudov made changes -
            Occurrence Factor New: 10% [ 12830 ]
            Symptom Severity New: Minor [ 14432 ]
            Status Original: Needs Triage [ 10030 ] New: Open [ 1 ]
            Alexey Chystoprudov made changes -
            Assignee New: Alexey Chystoprudov [ achystoprudov ]

              achystoprudov Alexey Chystoprudov
              achystoprudov Alexey Chystoprudov
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: