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

NPE in hudson.plugins.mercurial.MercurialSCM.compareRemoteRevisionWith

    XMLWordPrintable

Details

    Description

      When polling I get this error in the log. It repeats for a couple of days now. I don't which of my projects gives this, but it polls every half an hour and gives this NPE.

      May 1, 2012 4:00:46 PM hudson.triggers.SCMTrigger$Runner runPolling
      SEVERE: Failed to record SCM polling
      java.lang.NullPointerException
      at hudson.plugins.mercurial.MercurialSCM.compareRemoteRevisionWith(MercurialSCM.java:241)
      at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
      at hudson.scm.SCM.poll(SCM.java:373)
      at hudson.model.AbstractProject.poll(AbstractProject.java:1323)
      at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:420)
      at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:449)
      at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

      Attachments

        Activity

          marc_swingler Marc Swingler added a comment - - edited

          I'm at version 1.44 of the plugin and I'm getting the same error in my Mercurial Polling logs:

          NPE
          Started on Mar 6, 2013 10:55:30 AM
          Acquired master cache lock.
          [...] $ "D:\Program Files\Mercurial\hg.exe" pull
          warning: ... certificate with fingerprint ... not verified (check hostfingerprints or web.cacerts config setting)
          pulling from ...
          searching for changes
          no changes found
          ERROR: Failed to update D:\.jenkins\hgcache\...
          Master cache lock released.
          ERROR: Failed to use repository cache for ...
          ERROR: Failed to record SCM polling for hudson.maven.MavenModuleSet@...[...]
          java.lang.NullPointerException
          	at hudson.plugins.mercurial.MercurialSCM.compareRemoteRevisionWith(MercurialSCM.java:242)
          	at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
          	at hudson.scm.SCM.poll(SCM.java:373)
          	at hudson.model.AbstractProject._poll(AbstractProject.java:1493)
          	at hudson.model.AbstractProject.poll(AbstractProject.java:1410)
          	at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:439)
          	at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:468)
          	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
          	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
          	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
          	at java.util.concurrent.FutureTask.run(Unknown Source)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          	at java.lang.Thread.run(Unknown Source)
          
          marc_swingler Marc Swingler added a comment - - edited I'm at version 1.44 of the plugin and I'm getting the same error in my Mercurial Polling logs: NPE Started on Mar 6, 2013 10:55:30 AM Acquired master cache lock. [...] $ "D:\Program Files\Mercurial\hg.exe" pull warning: ... certificate with fingerprint ... not verified (check hostfingerprints or web.cacerts config setting) pulling from ... searching for changes no changes found ERROR: Failed to update D:\.jenkins\hgcache\... Master cache lock released. ERROR: Failed to use repository cache for ... ERROR: Failed to record SCM polling for hudson.maven.MavenModuleSet@...[...] java.lang.NullPointerException at hudson.plugins.mercurial.MercurialSCM.compareRemoteRevisionWith(MercurialSCM.java:242) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject._poll(AbstractProject.java:1493) at hudson.model.AbstractProject.poll(AbstractProject.java:1410) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:439) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:468) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang. Thread .run(Unknown Source)
          jglick Jesse Glick added a comment -

          Code in question introduced in:

          commit bd53013835c998e2b9bc81d8de8bd7581f7d0e8a
          Author: Willem Verstraeten <willem.verstraeten@gmail.com>
          Date:   Thu Jan 5 18:49:27 2012 +0100
          
              Implement requiresWorkspaceForPolling
              
              When using caching, all poll operations can be performed on the central cache, so no workspace is necessary
          

          Indeed it is legitimate for possiblyCachedRepo to be null sometimes.

          My first inclination would be to then skip the next two lines and continue with workspace-based polling:

          if (possiblyCachedRepo != null) {
              FilePath repositoryCache = new FilePath(new File(possiblyCachedRepo.getRepoLocation()));
              return compare(launcher, listener, baseline, output, Hudson.getInstance(), repositoryCache);
          }
          

          I am not sure however what Jenkins will do if you first claimed you supported workspaceless polling but then when asked to poll in fact demand a workspace! The Javadoc for SCM is unclear on this point. Worth trying I guess.

          jglick Jesse Glick added a comment - Code in question introduced in: commit bd53013835c998e2b9bc81d8de8bd7581f7d0e8a Author: Willem Verstraeten <willem.verstraeten@gmail.com> Date: Thu Jan 5 18:49:27 2012 +0100 Implement requiresWorkspaceForPolling When using caching, all poll operations can be performed on the central cache, so no workspace is necessary Indeed it is legitimate for possiblyCachedRepo to be null sometimes. My first inclination would be to then skip the next two lines and continue with workspace-based polling: if (possiblyCachedRepo != null ) { FilePath repositoryCache = new FilePath( new File(possiblyCachedRepo.getRepoLocation())); return compare(launcher, listener, baseline, output, Hudson.getInstance(), repositoryCache); } I am not sure however what Jenkins will do if you first claimed you supported workspaceless polling but then when asked to poll in fact demand a workspace ! The Javadoc for SCM is unclear on this point. Worth trying I guess.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          http://jenkins-ci.org/commit/mercurial-plugin/8f3d32c85266e5bb34fc4337fb7299e59738061a
          Log:
          [FIXED JENKINS-13669] NPE when possiblyCachedRepo == null.


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/mercurial/MercurialSCM.java http://jenkins-ci.org/commit/mercurial-plugin/8f3d32c85266e5bb34fc4337fb7299e59738061a Log: [FIXED JENKINS-13669] NPE when possiblyCachedRepo == null. – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          If the possiblyCachedRepo is null, it means there was an earler error updating or cloning the cache. The polling shouldn't try to continue in that case, but throw an exception.

          For instance:

          if (!requiresWorkspaceForPolling()) {
              launcher = Hudson.getInstance().createLauncher(listener);
              PossiblyCachedRepo possiblyCachedRepo = cachedSource(Hudson.getInstance(), launcher, listener, true);
              if (possiblyCachedRepo == null) {
                  throw new IOException("Could not use cache to poll for changes. See error messages above for more details");
              }
              FilePath repositoryCache = new FilePath(new File(possiblyCachedRepo.getRepoLocation()));
              return compare(launcher, listener, baseline, output, Hudson.getInstance(), repositoryCache);
          }
          
          willemv Willem Verstraeten added a comment - If the possiblyCachedRepo is null, it means there was an earler error updating or cloning the cache. The polling shouldn't try to continue in that case, but throw an exception. For instance: if (!requiresWorkspaceForPolling()) { launcher = Hudson.getInstance().createLauncher(listener); PossiblyCachedRepo possiblyCachedRepo = cachedSource(Hudson.getInstance(), launcher, listener, true ); if (possiblyCachedRepo == null ) { throw new IOException( "Could not use cache to poll for changes. See error messages above for more details" ); } FilePath repositoryCache = new FilePath( new File(possiblyCachedRepo.getRepoLocation())); return compare(launcher, listener, baseline, output, Hudson.getInstance(), repositoryCache); }

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          http://jenkins-ci.org/commit/mercurial-plugin/1576c70a2c753480857391757b8c059b39fda880
          Log:
          JENKINS-13669 willemv advocates simply failing the polling operation if possiblyCachedRepo is null.


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/hudson/plugins/mercurial/MercurialSCM.java http://jenkins-ci.org/commit/mercurial-plugin/1576c70a2c753480857391757b8c059b39fda880 Log: JENKINS-13669 willemv advocates simply failing the polling operation if possiblyCachedRepo is null. – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          People

            willemv Willem Verstraeten
            javakoe Ronald Klop
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: