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

NPE when parsing scm git revision date on PR branches

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      2.2.15

      Description

      After upgrading Jenkins and all plugins I ran into an error when scanning my multibranch pipeline. The PR was found, but its job failed with

      Branch indexing
      java.lang.NullPointerException
      	at com.fasterxml.jackson.databind.util.ISO8601Utils.parseInt(ISO8601Utils.java:329)
      	at com.fasterxml.jackson.databind.util.ISO8601Utils.parse(ISO8601Utils.java:161)
      	at com.fasterxml.jackson.databind.util.ISO8601DateFormat.parse(ISO8601DateFormat.java:52)
      	at com.cloudbees.jenkins.plugins.bitbucket.BitbucketGitSCMRevision.<init>(BitbucketGitSCMRevision.java:60)
      	at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:843)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:583)
      	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:95)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:303)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE
      

      https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/cloudbees-bitbucket-branch-source-2.2.14/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java#L843

      https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/cloudbees-bitbucket-branch-source-2.2.14/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketGitSCMRevision.java#L60

      https://github.com/FasterXML/jackson-databind/blob/2.7/src/main/java/com/fasterxml/jackson/databind/util/ISO8601DateFormat.java#L52

      https://github.com/FasterXML/jackson-databind/blob/2.7/src/main/java/com/fasterxml/jackson/databind/util/ISO8601Utils.java#L161

      https://github.com/FasterXML/jackson-databind/blob/2.7/src/main/java/com/fasterxml/jackson/databind/util/ISO8601Utils.java#L329

       

      Seems like the problem is with `targetRevision`, its `getDate()` returns null from here:

      https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/cloudbees-bitbucket-branch-source-2.2.14/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java#L1643

      I don't think I can trace the error any further myself. My target branch definitely has a head commit with a date.

        Attachments

          Issue Links

            Activity

            Hide
            nfalco Nikolas Falco added a comment -

            Waiting Joseph Petersen PR approval for merge.

            Show
            nfalco Nikolas Falco added a comment - Waiting Joseph Petersen PR approval for merge.
            Hide
            casz Joseph Petersen added a comment -

            Released as 2.2.15

            Show
            casz Joseph Petersen added a comment - Released as 2.2.15
            Hide
            jeubank Josiah Eubank added a comment -
            Show
            jeubank Josiah Eubank added a comment - Not yet listed on update site:  http://updates.jenkins-ci.org/current/update-center.json
            Hide
            casz Joseph Petersen added a comment -

            Create a ticket for Jenkins infra, it is uploaded to artifactory as posted on GitHub 

            Show
            casz Joseph Petersen added a comment - Create a ticket for Jenkins infra, it is uploaded to artifactory as posted on GitHub 
            Hide
            casz Joseph Petersen added a comment -

            Seems to have resolved itself: INFRA-1868

            Show
            casz Joseph Petersen added a comment - Seems to have resolved itself: INFRA-1868

              People

              • Assignee:
                nfalco Nikolas Falco
                Reporter:
                onodera Alexey Marin
              • Votes:
                9 Vote for this issue
                Watchers:
                20 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: