Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36265

parallel jobs don't show error traceback for some failures

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None

      Hi there,
      We're using the Pipeline system extensively to build Python projects in our firm.
      Whilst it is mostly amazing, one of the most screen-chuckingly frustrating things about it is when parallel jobs fail with no output other than 'error', eg:

      [Pipeline] [Unit-ts2-el7-0] echo
      10:38:15 [Unit-ts2-el7-0] xx2
      [Pipeline] [Unit-ts2-el7-0] fileExists
      [Pipeline] [Unit-ts2-el7-0] readFile
      [Pipeline] }
      [Pipeline] // dir
      [Pipeline] fileExists
      [Pipeline] fileExists
      [Pipeline] error
      

      No traceback, nothing in the server logs. No way to debug this other than commenting out bits of code, putting in print statements all over the place - not ideal!

      It seems to happen the most when code in the shared workflowLibs has problems. For example - this code here:

      def work() {
          node {
              sh "echo foo > foo.txt; echo bar >> foo.txt; echo baz >> foo.txt"
              return readFile('foo.txt').trim().split('\n').join(',')
          }
      }
      def jobs = [1: { echo work() },
                  2: { echo work() }
                  ]
      parallel jobs
      

      .. will cause a script approval failure on staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods join java.lang.Object[] java.lang.String.

      When the code is executed in a normal workflowScript, you get a nice traceback showing you the problem. If however the code is in the call() block of global variable file , it will just silently fail with 'error'.

          [JENKINS-36265] parallel jobs don't show error traceback for some failures

          Edward Easton added a comment -

          As an addendum - I think it's also related to the script that silently fails being in a multibranch pipeline script.
          What's also scary is that the script not only silently fails, it does not add a script approval request to the in-process script approvals.
          I had to create this little script above in a non-multibranch pipeline script, trigger the approval failure via that then approve it in the approvals page.

          Edward Easton added a comment - As an addendum - I think it's also related to the script that silently fails being in a multibranch pipeline script. What's also scary is that the script not only silently fails, it does not add a script approval request to the in-process script approvals. I had to create this little script above in a non-multibranch pipeline script, trigger the approval failure via that then approve it in the approvals page.

          Sorry, I changed this ticket by mistake

          Lionel Cabasson added a comment - Sorry, I changed this ticket by mistake

          Jesse Glick added a comment -

          Need to check if there is something reproducible from scratch here.

          Jesse Glick added a comment - Need to check if there is something reproducible from scratch here.

            Unassigned Unassigned
            eeaston Edward Easton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: