java.lang.NullPointerException

Jenkins JIRA | Dan C | 2 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Job is configured to use Git with Gerrit Trigger choosing strategy. Remote name is gerrit, refspec is: {{+refs/heads/*:refs/remotes/gerrit/* $GERRIT_REFSPEC}}. Configured to merge with {{$GERRIT_BRANCH}} and calculate changelog against {{$GERRIT_BRANCH}}. When using the Gerrit Trigger choosing strategy, "branches to build" is meaningless, so I left it at the default "**". However that causes the following NPE. Changing the "branches to build" to a valid branch name like "master" fixes the problem. {code} Retriggered by user dcallagh for Gerrit: http://gerrit.beaker-project.org/4092 in silent mode. [EnvInject] - Loading node environment variables. Building in workspace /var/lib/jenkins/jobs/restraint-review-checks/workspace selected Git installation does not exists. Using Default > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.gerrit.url ssh://jenkins@gerrit.beaker-project.org:29418/restraint # timeout=10 Fetching upstream changes from ssh://jenkins@gerrit.beaker-project.org:29418/restraint > git --version # timeout=10 using GIT_SSH to set credentials > git -c core.askpass=true fetch --tags --progress ssh://jenkins@gerrit.beaker-project.org:29418/restraint +refs/heads/*:refs/remotes/gerrit/* refs/changes/92/4092/1 > git rev-parse 918d97ecf9cf9fac9ff26a15531e975bde64f4ed^{commit} # timeout=10 FATAL: null java.lang.NullPointerException at hudson.plugins.git.Revision.containsBranchName(Revision.java:104) at hudson.plugins.git.extensions.impl.PreBuildMerge.decorateRevisionToBuild(PreBuildMerge.java:57) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:925) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1017) at hudson.scm.SCM.checkout(SCM.java:484) at hudson.model.AbstractProject.checkout(AbstractProject.java:1270) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531) at hudson.model.Run.execute(Run.java:1751) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Finished: FAILURE {code}

    Jenkins JIRA | 2 years ago | Dan C
    java.lang.NullPointerException
  2. 0

    Job is configured to use Git with Gerrit Trigger choosing strategy. Remote name is gerrit, refspec is: {{+refs/heads/*:refs/remotes/gerrit/* $GERRIT_REFSPEC}}. Configured to merge with {{$GERRIT_BRANCH}} and calculate changelog against {{$GERRIT_BRANCH}}. When using the Gerrit Trigger choosing strategy, "branches to build" is meaningless, so I left it at the default "**". However that causes the following NPE. Changing the "branches to build" to a valid branch name like "master" fixes the problem. {code} Retriggered by user dcallagh for Gerrit: http://gerrit.beaker-project.org/4092 in silent mode. [EnvInject] - Loading node environment variables. Building in workspace /var/lib/jenkins/jobs/restraint-review-checks/workspace selected Git installation does not exists. Using Default > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.gerrit.url ssh://jenkins@gerrit.beaker-project.org:29418/restraint # timeout=10 Fetching upstream changes from ssh://jenkins@gerrit.beaker-project.org:29418/restraint > git --version # timeout=10 using GIT_SSH to set credentials > git -c core.askpass=true fetch --tags --progress ssh://jenkins@gerrit.beaker-project.org:29418/restraint +refs/heads/*:refs/remotes/gerrit/* refs/changes/92/4092/1 > git rev-parse 918d97ecf9cf9fac9ff26a15531e975bde64f4ed^{commit} # timeout=10 FATAL: null java.lang.NullPointerException at hudson.plugins.git.Revision.containsBranchName(Revision.java:104) at hudson.plugins.git.extensions.impl.PreBuildMerge.decorateRevisionToBuild(PreBuildMerge.java:57) at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:925) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1017) at hudson.scm.SCM.checkout(SCM.java:484) at hudson.model.AbstractProject.checkout(AbstractProject.java:1270) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531) at hudson.model.Run.execute(Run.java:1751) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Finished: FAILURE {code}

    Jenkins JIRA | 2 years ago | Dan C
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at hudson.plugins.git.Revision.containsBranchName()
    2. Hudson GIT plugin
      Revision.containsBranchName
      1. hudson.plugins.git.Revision.containsBranchName(Revision.java:104)
      1 frame
    3. hudson.plugins.git
      PreBuildMerge.decorateRevisionToBuild
      1. hudson.plugins.git.extensions.impl.PreBuildMerge.decorateRevisionToBuild(PreBuildMerge.java:57)
      1 frame
    4. Hudson GIT plugin
      GitSCM.checkout
      1. hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:925)
      2. hudson.plugins.git.GitSCM.checkout(GitSCM.java:1017)
      2 frames
    5. Hudson
      AbstractBuild$AbstractBuildExecution.defaultCheckout
      1. hudson.scm.SCM.checkout(SCM.java:484)
      2. hudson.model.AbstractProject.checkout(AbstractProject.java:1270)
      3. hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
      3 frames
    6. jenkins.scm
      SCMCheckoutStrategy.checkout
      1. jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      1 frame
    7. Hudson
      Executor.run
      1. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531)
      2. hudson.model.Run.execute(Run.java:1751)
      3. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      4. hudson.model.ResourceController.execute(ResourceController.java:89)
      5. hudson.model.Executor.run(Executor.java:240)
      5 frames