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

NPE when parsing scm git revision date on PR branches

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • Jenkins ver. 2.138.2
      Bitbucket branch source 2.2.14
      Atlassian Bitbucket v5.6.2
    • 2.2.15

      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.

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

              Created:
              Updated:
              Resolved: