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

            No work has yet been logged on this issue.

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

                Created:
                Updated:
                Resolved: