java.lang.NullPointerException

Jenkins JIRA | robertdw | 5 years ago
  1. 0

    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)

    Jenkins JIRA | 5 years ago | robertdw
    java.lang.NullPointerException
  2. 0

    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)

    Jenkins JIRA | 5 years ago | robertdw
    java.lang.NullPointerException
  3. 0

    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].

    Jenkins JIRA | 3 years ago | Sam Umbach
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    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.

    Jenkins JIRA | 8 months ago | Mark Waite
    java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at hudson.plugins.git.GitSCM.compareRemoteRevisionWith()
    2. Hudson GIT plugin
      GitSCM.compareRemoteRevisionWith
      1. hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:657)
      1 frame
    3. Hudson
      DependencyRunner.run
      1. hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:354)
      2. hudson.scm.SCM.poll(SCM.java:371)
      3. hudson.model.AbstractProject.poll(AbstractProject.java:1305)
      4. hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:420)
      5. hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:449)
      6. hudson.triggers.SCMTrigger.run(SCMTrigger.java:103)
      7. hudson.triggers.SCMTrigger.run(SCMTrigger.java:83)
      8. hudson.triggers.Trigger$1.run(Trigger.java:229)
      9. hudson.DependencyRunner.run(DependencyRunner.java:73)
      9 frames
    4. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      2. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      3. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      5. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      6. java.lang.Thread.run(Thread.java:662)
      6 frames