java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • When using the git inverse branch choosing strategy (to exclude named branches) and polling a git repo, I see the following NullPointerException in the Git Polling Log: {noformat} Mar 04, 2014 3:24:29 PM hudson.triggers.SCMTrigger$Runner runPolling SEVERE: Failed to record SCM polling for hudson.model.FreeStyleProject@4c06e5bd[job-name] java.lang.NullPointerException at hudson.plugins.git.util.InverseBuildChooser.getCandidateRevisions(InverseBuildChooser.java:45) at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:536) at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:455) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1605) at hudson.model.AbstractProject._poll(AbstractProject.java:1575) at hudson.model.AbstractProject.poll(AbstractProject.java:1493) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:462) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:491) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) {noformat} The project config is attached to this ticket: !config.xml! I believe the cause is git plugin [revision 4fc7f44|https://github.com/jenkinsci/git-plugin/commit/4fc7f4447c990082e8322c42ebafd1f33a2e60aa]. This NPE occurs in version 2.0.3 of the plugin but does _not_ in version 2.0.1. (I have not tested 2.0.2, but I suspect it behaves the same as 2.0.3.) A possible workaround is to enable the "Force polling with workspace" option (see [JENKINS-21264|https://issues.jenkins-ci.org/browse/JENKINS-21264]), but I have not confirmed if this works. Proposed fix in [GitHub pull request #208|https://github.com/jenkinsci/git-plugin/pull/208].
    via by Sam Umbach,
  • When using the git inverse branch choosing strategy (to exclude named branches) and polling a git repo, I see the following NullPointerException in the Git Polling Log: {noformat} Mar 04, 2014 3:24:29 PM hudson.triggers.SCMTrigger$Runner runPolling SEVERE: Failed to record SCM polling for hudson.model.FreeStyleProject@4c06e5bd[job-name] java.lang.NullPointerException at hudson.plugins.git.util.InverseBuildChooser.getCandidateRevisions(InverseBuildChooser.java:45) at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:536) at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:455) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1605) at hudson.model.AbstractProject._poll(AbstractProject.java:1575) at hudson.model.AbstractProject.poll(AbstractProject.java:1493) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:462) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:491) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) {noformat} The project config is attached to this ticket: !config.xml! I believe the cause is git plugin [revision 4fc7f44|https://github.com/jenkinsci/git-plugin/commit/4fc7f4447c990082e8322c42ebafd1f33a2e60aa]. This NPE occurs in version 2.0.3 of the plugin but does _not_ in version 2.0.1. (I have not tested 2.0.2, but I suspect it behaves the same as 2.0.3.) A possible workaround is to enable the "Force polling with workspace" option (see [JENKINS-21264|https://issues.jenkins-ci.org/browse/JENKINS-21264]), but I have not confirmed if this works. Proposed fix in [GitHub pull request #208|https://github.com/jenkinsci/git-plugin/pull/208].
    via by Sam Umbach,
  • If you enable remote polling in the Git Plugin, the project will never poll successfully, and stops other projects polling as well. In GitSCM, requiresWorkspaceForPolling() returns false if remotePoll is enabled. https://github.com/jenkinsci/git-plugin/blob/git-1.1.12/src/main/java/hudson/plugins/git/GitSCM.java#L582 This mean that in the jenkins-core AbstractProject (at least on the LTS branch), a null value is passed in for the workspace parameter to SCM.poll() https://github.com/jenkinsci/jenkins/blob/jenkins-1.409.1/core/src/main/java/hudson/model/AbstractProject.java#L1305 This ends up in 'compareRemoteRevisionWith' back in GitSCM. At line 651, the call to 'workingDirectory(workspace)' returns null - because null was passed in as a param from AbstractProject. This means that at line 657, the call to !!workingDirectory.exists() results in a null pointer. Suggested fix: remove the remotePoll, or make it require a workspace to do the polling. Stacktrace: Sep 2, 2011 2:41:50 PM hudson.triggers.SCMTrigger$Runner runPolling SEVERE: Failed to record SCM polling java.lang.NullPointerException at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:657) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:354) at hudson.scm.SCM.poll(SCM.java:371) at hudson.model.AbstractProject.poll(AbstractProject.java:1305) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:420) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:449) at hudson.triggers.SCMTrigger.run(SCMTrigger.java:103) at hudson.triggers.SCMTrigger.run(SCMTrigger.java:83) at hudson.triggers.Trigger$1.run(Trigger.java:229) at hudson.DependencyRunner.run(DependencyRunner.java:73) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
    via by robertdw,
  • A stack trace was reported to /var/log/jenkins/jenkins.log that shows a null pointer exception in pollnig from either the git plugin or the git client plugin. {noformat} Apr 10, 2016 4:27:00 AM hudson.triggers.SCMTrigger$Runner runPolling SEVERE: Failed to record SCM polling for hudson.matrix.MatrixProject@4616ca95[JENKINS-22119-bitbucket-credentialed-clone-fails] java.lang.NullPointerException at hudson.plugins.git.util.GitUtils.getPollEnvironment(GitUtils.java:220) at hudson.plugins.git.util.GitUtils.getPollEnvironment(GitUtils.java:194) at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:684) at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:571) at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381) at hudson.scm.SCM.poll(SCM.java:398) at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1475) at hudson.model.AbstractProject._poll(AbstractProject.java:1445) at hudson.model.AbstractProject.poll(AbstractProject.java:1356) at jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:119) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:526) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:555) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} The conditions under which the null pointer exception occur are not yet clear to me. The job definition which caused that NPE has not changed in a month or more, yet this null pointer exception only appeared once and only very recently.
    via by Mark Waite,
  • If you enable remote polling in the Git Plugin, the project will never poll successfully, and stops other projects polling as well. In GitSCM, requiresWorkspaceForPolling() returns false if remotePoll is enabled. https://github.com/jenkinsci/git-plugin/blob/git-1.1.12/src/main/java/hudson/plugins/git/GitSCM.java#L582 This mean that in the jenkins-core AbstractProject (at least on the LTS branch), a null value is passed in for the workspace parameter to SCM.poll() https://github.com/jenkinsci/jenkins/blob/jenkins-1.409.1/core/src/main/java/hudson/model/AbstractProject.java#L1305 This ends up in 'compareRemoteRevisionWith' back in GitSCM. At line 651, the call to 'workingDirectory(workspace)' returns null - because null was passed in as a param from AbstractProject. This means that at line 657, the call to !!workingDirectory.exists() results in a null pointer. Suggested fix: remove the remotePoll, or make it require a workspace to do the polling. Stacktrace: Sep 2, 2011 2:41:50 PM hudson.triggers.SCMTrigger$Runner runPolling SEVERE: Failed to record SCM polling java.lang.NullPointerException at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:657) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:354) at hudson.scm.SCM.poll(SCM.java:371) at hudson.model.AbstractProject.poll(AbstractProject.java:1305) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:420) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:449) at hudson.triggers.SCMTrigger.run(SCMTrigger.java:103) at hudson.triggers.SCMTrigger.run(SCMTrigger.java:83) at hudson.triggers.Trigger$1.run(Trigger.java:229) at hudson.DependencyRunner.run(DependencyRunner.java:73) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
    via by robertdw,
  • A stack trace was reported to /var/log/jenkins/jenkins.log that shows a null pointer exception in pollnig from either the git plugin or the git client plugin. {noformat} Apr 10, 2016 4:27:00 AM hudson.triggers.SCMTrigger$Runner runPolling SEVERE: Failed to record SCM polling for hudson.matrix.MatrixProject@4616ca95[JENKINS-22119-bitbucket-credentialed-clone-fails] java.lang.NullPointerException at hudson.plugins.git.util.GitUtils.getPollEnvironment(GitUtils.java:220) at hudson.plugins.git.util.GitUtils.getPollEnvironment(GitUtils.java:194) at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:684) at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:571) at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381) at hudson.scm.SCM.poll(SCM.java:398) at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1475) at hudson.model.AbstractProject._poll(AbstractProject.java:1445) at hudson.model.AbstractProject.poll(AbstractProject.java:1356) at jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:119) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:526) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:555) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {noformat} The conditions under which the null pointer exception occur are not yet clear to me. The job definition which caused that NPE has not changed in a month or more, yet this null pointer exception only appeared once and only very recently.
    via by Mark Waite,
    • java.lang.NullPointerException at hudson.plugins.git.util.InverseBuildChooser.getCandidateRevisions(InverseBuildChooser.java:45) at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:536) at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:455) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject.pollWithWorkspace(AbstractProject.java:1605) at hudson.model.AbstractProject._poll(AbstractProject.java:1575) at hudson.model.AbstractProject.poll(AbstractProject.java:1493) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:462) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:491) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)
    No Bugmate found.