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

Multi-Branch Pipeline tool installs fails frequently on branches

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • core
    • None
    • Jenkins 2.332.1
      Oracle Linux 7.9
      Lots of plugins installed, almost all are the most recent versions available

      I have a multi-branch pipeline job that seems to work fine on the main branch.  On other branches/PRs, I am seeing very frequent failures (> 90%) that appear to be related to Jenkins tool installations.

      In my Jenkinsfile, I have the following:

      tools {
          maven 'maven-3.8.4'
          jdk 'OpenJDK 15.0.2'
      }

      Both of these are set up to automatically download and install in the Jenkins Global Tool configuration.

      In builds that are working, Blue Ocean shows what I would expect (a single installation of each), see attached.  In builds that are failing, Blue Ocean shows that Jenkins is trying to install the tools twice, with the second OpenJDK installation always failing at the same point, see attached.  Note that both the successful and failing builds were done on the same branch with zero changes to the code or Jenkins configuration between the runs.

      At this point, I have no idea what could be causing this behavior so I am forced to assume that this is a Jenkins bug.

       

        1. Failing.png
          Failing.png
          161 kB
        2. Manual.log
          18 kB
        3. Triggered.log
          15 kB
        4. Working.png
          Working.png
          128 kB

          [JENKINS-68106] Multi-Branch Pipeline tool installs fails frequently on branches

          Mark Waite added a comment -

          You'll need to provide the console logs from the builds. Blue ocean has been known to make mistakes in its interpretation of the console logs.

          Mark Waite added a comment - You'll need to provide the console logs from the builds. Blue ocean has been known to make mistakes in its interpretation of the console logs.

          I think I tracked down the problem.  My Jenkinsfile has a dozen or so parameters–all with default values.  Whenever the build is triggered (e.g., by branch indexing, by a new branch/PR being created), the parameters seem to not make it into the environment.  If I trigger the build manually, the parameters are being added to the environment as expected.

          One missing parameter was causing a groovy function I wrote to trigger the NullPointerException.  I rearranged my script to run an sh step (env|sort) prior to the groovy script being executed and sure enough, none of the parameters are in the environment when the build is failing.  I have fixed my Groovy script to handle this and abort the pipeline but I need to determine why the parameters are not being added to the environment with their default values...  

          Robert Patrick added a comment - I think I tracked down the problem.  My Jenkinsfile has a dozen or so parameters–all with default values.  Whenever the build is triggered (e.g., by branch indexing, by a new branch/PR being created), the parameters seem to not make it into the environment.  If I trigger the build manually, the parameters are being added to the environment as expected. One missing parameter was causing a groovy function I wrote to trigger the NullPointerException.  I rearranged my script to run an sh step (env|sort) prior to the groovy script being executed and sure enough, none of the parameters are in the environment when the build is failing.  I have fixed my Groovy script to handle this and abort the pipeline but I need to determine why the parameters are not being added to the environment with their default values...  

          Robert Patrick added a comment - - edited

          My new Jenkinsfile can be found at [Jenkinsfile|https://github.com/oracle/weblogic-kubernetes-operator/blob/40f6226e4b3944e694cecacdc015de33593a650d/Jenkinsfile.]  The Triggered build of the PR with this updated Jenkinsfile is attached as Triggered.log.  The Build log for the job I started manually is attached as Manual.log.  Notice that KIND_VERSION and KUBE_VERSION (or any of the other parameters) are not in the environment output of the Triggered build but are in the Manual build...

          Am I being stupid here or should this be working? 

          Robert Patrick added a comment - - edited My new Jenkinsfile can be found at [Jenkinsfile| https://github.com/oracle/weblogic-kubernetes-operator/blob/40f6226e4b3944e694cecacdc015de33593a650d/Jenkinsfile .]  The Triggered build of the PR with this updated Jenkinsfile is attached as Triggered.log.  The Build log for the job I started manually is attached as Manual.log.  Notice that KIND_VERSION and KUBE_VERSION (or any of the other parameters) are not in the environment output of the Triggered build but are in the Manual build... Am I being stupid here or should this be working? 

          It seems that I am running into https://issues.jenkins.io/browse/JENKINS-41929 issue.

          Robert Patrick added a comment - It seems that I am running into https://issues.jenkins.io/browse/JENKINS-41929  issue.

            Unassigned Unassigned
            rhpatrick Robert Patrick
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: