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

Null pointer exception "h.triggers.SCMTrigger$Runner#runPolling: Failed to record SCM polling..."

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • git-plugin
    • None
    • 4.8.1 released July 25, 2021

      After the 4.8.0 upgrade, any jobs that have "Poll SCM" as the only build trigger are dumping.  Jenkins LTS 2.277.4.  Confirmed this behaviour on 3 different Jenkins servers.  RHEL7.9 is the OS for the servers.

      2021-07-22 09:42:01.162+0000 [id=4766] SEVERE h.triggers.SCMTrigger$Runner#runPolling: Failed to record SCM polling for hudson.matrix.MatrixProject@641cb4d8[job_name]
      java.lang.NullPointerException
      at hudson.plugins.git.util.BuildData.getLastBuild(BuildData.java:168)
      at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:768)
      at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:685)
      at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:401)
      at hudson.scm.SCM.poll(SCM.java:418)
      at org.jenkinsci.plugins.multiplescms.MultiSCM.compareRemoteRevisionWith(MultiSCM.java:114)
      at hudson.scm.SCM.poll(SCM.java:418)
      at hudson.model.AbstractProject._poll(AbstractProject.java:1383)
      at hudson.model.AbstractProject.poll(AbstractProject.java:1289)
      at jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:143)
      at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:606)
      at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:652)
      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:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)

          [JENKINS-66212] Null pointer exception "h.triggers.SCMTrigger$Runner#runPolling: Failed to record SCM polling..."

          Victoria created issue -
          Victoria made changes -
          Description New: After the 4.8.0 upgrade, any jobs that have "Poll SCM" as the only build trigger are dumping. 

          2021-07-22 09:42:01.162+0000 [id=4766] SEVERE h.triggers.SCMTrigger$Runner#runPolling: Failed to record SCM polling for hudson.matrix.MatrixProject@641cb4d8[job_name]
          java.lang.NullPointerException
           at hudson.plugins.git.util.BuildData.getLastBuild(BuildData.java:168)
           at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:768)
           at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:685)
           at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:401)
           at hudson.scm.SCM.poll(SCM.java:418)
           at org.jenkinsci.plugins.multiplescms.MultiSCM.compareRemoteRevisionWith(MultiSCM.java:114)
           at hudson.scm.SCM.poll(SCM.java:418)
           at hudson.model.AbstractProject._poll(AbstractProject.java:1383)
           at hudson.model.AbstractProject.poll(AbstractProject.java:1289)
           at jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:143)
           at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:606)
           at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:652)
           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:1149)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:748)
          Victoria made changes -
          Description Original: After the 4.8.0 upgrade, any jobs that have "Poll SCM" as the only build trigger are dumping. 

          2021-07-22 09:42:01.162+0000 [id=4766] SEVERE h.triggers.SCMTrigger$Runner#runPolling: Failed to record SCM polling for hudson.matrix.MatrixProject@641cb4d8[job_name]
          java.lang.NullPointerException
           at hudson.plugins.git.util.BuildData.getLastBuild(BuildData.java:168)
           at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:768)
           at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:685)
           at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:401)
           at hudson.scm.SCM.poll(SCM.java:418)
           at org.jenkinsci.plugins.multiplescms.MultiSCM.compareRemoteRevisionWith(MultiSCM.java:114)
           at hudson.scm.SCM.poll(SCM.java:418)
           at hudson.model.AbstractProject._poll(AbstractProject.java:1383)
           at hudson.model.AbstractProject.poll(AbstractProject.java:1289)
           at jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:143)
           at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:606)
           at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:652)
           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:1149)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:748)
          New: After the 4.8.0 upgrade, any jobs that have "Poll SCM" as the only build trigger are dumping.  Jenkins LTS 2.277.4.  Confirmed this behaviour on 3 different Jenkins servers.  RHEL7.9 is the OS for the servers.

          2021-07-22 09:42:01.162+0000 [id=4766] SEVERE h.triggers.SCMTrigger$Runner#runPolling: Failed to record SCM polling for hudson.matrix.MatrixProject@641cb4d8[job_name]
           java.lang.NullPointerException
           at hudson.plugins.git.util.BuildData.getLastBuild(BuildData.java:168)
           at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:768)
           at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:685)
           at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:401)
           at hudson.scm.SCM.poll(SCM.java:418)
           at org.jenkinsci.plugins.multiplescms.MultiSCM.compareRemoteRevisionWith(MultiSCM.java:114)
           at hudson.scm.SCM.poll(SCM.java:418)
           at hudson.model.AbstractProject._poll(AbstractProject.java:1383)
           at hudson.model.AbstractProject.poll(AbstractProject.java:1289)
           at jenkins.triggers.SCMTriggerItem$SCMTriggerItems$Bridge.poll(SCMTriggerItem.java:143)
           at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:606)
           at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:652)
           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:1149)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
           at java.lang.Thread.run(Thread.java:748)

          Victoria added a comment - - edited

          In addition to "MatrixProject", this happens for these:

          • Failed to record SCM polling for[job name]
          • Failed to record SCM polling for hudson.model.FreeStyleProject@19843be8[job name]
          • Pipeline jobs

           

          Victoria added a comment - - edited In addition to "MatrixProject", this happens for these: Failed to record SCM polling for [job name] Failed to record SCM polling for hudson.model.FreeStyleProject@19843be8 [job name] Pipeline jobs  

          Victoria added a comment -

          A cat of one of the scm-polling.log files:

          Started on Jul 23, 2021 9:48:00 AM
          Using strategy: Default
          [poll] Last Built Revision: Revision null (refs/remotes/origin/main)
          The recommended git tool is: NONE
          No credentials specified
           > git --version # timeout=10
           > git --version # 'git version 1.8.3.1'
          Setting http proxy: <proxy server redacted>:80
           > git ls-remote -h https://github.com/Project/repo # timeout=10
          Found 3 remote heads on https://github.com/Project/repo
          ERROR: Failed to record SCM polling for hudson.matrix.MatrixProject@1d7042f7[job name]
          java.lang.NullPointerException
          
          

          Victoria added a comment - A cat of one of the scm-polling.log files: Started on Jul 23, 2021 9:48:00 AM Using strategy: Default [poll] Last Built Revision: Revision null (refs/remotes/origin/main) The recommended git tool is: NONE No credentials specified > git --version # timeout=10 > git --version # 'git version 1.8.3.1' Setting http proxy: <proxy server redacted>:80 > git ls-remote -h https: //github.com/Project/repo # timeout=10 Found 3 remote heads on https: //github.com/Project/repo ERROR: Failed to record SCM polling for hudson.matrix.MatrixProject@1d7042f7[job name] java.lang.NullPointerException

          Mark Waite added a comment -

          Thanks for reporting the issue! I'll investigate.

          Mark Waite added a comment - Thanks for reporting the issue! I'll investigate.
          Victoria made changes -
          Summary Original: Upgrade to 4.8.0 creates error "h.triggers.SCMTrigger$Runner#runPolling: Failed to record SCM polling..." New: Upgrade to git-plugin 4.8.0 creates error "h.triggers.SCMTrigger$Runner#runPolling: Failed to record SCM polling..."

          Victoria added a comment -

          markewaite – Thanks, Mark.  Let me know any further information I can provide. I would like to add that if I kick a build off manually, it appears the error gets resolved.  Unfortunately, I don't know enough about the 47 jobs that are showing this error to be able to kick them off as a workaround and I'm loathe to figure out who the job owners are and contact them if I don't have to.

           

           

          Victoria added a comment - markewaite – Thanks, Mark.  Let me know any further information I can provide. I would like to add that if I kick a build off manually, it appears the error gets resolved.  Unfortunately, I don't know enough about the 47 jobs that are showing this error to be able to kick them off as a workaround and I'm loathe to figure out who the job owners are and contact them if I don't have to.    
          Mark Waite made changes -
          Attachment New: git-4.8.1-SNAPSHOT-a707434c.jpi [ 55268 ]

          Mark Waite added a comment - - edited

          I can't duplicate the problem from any of my polling cases. I don't see any changes in that area of code that were different between 4.7.2 and 4.8.0.

          I've uploaded a test build that outputs a message to report which assumption is being violated that is causing the null pointer exception. If you could install git-4.8.1-SNAPSHOT-a707434c.jpi and enable a custom logger from http://your-jenkins/log/) for level FINEST on the class hudson.plugins.git.util.BuildData, then perform a poll that usually reports a null pointer exception. Refresh the log page and it will tell us which item is null that was previously not null.

          That test build will probably also resolve the null pointer exception.

          Mark Waite added a comment - - edited I can't duplicate the problem from any of my polling cases. I don't see any changes in that area of code that were different between 4.7.2 and 4.8.0. I've uploaded a test build that outputs a message to report which assumption is being violated that is causing the null pointer exception. If you could install git-4.8.1-SNAPSHOT-a707434c.jpi and enable a custom logger from http://your-jenkins/log/ ) for level FINEST on the class hudson.plugins.git.util.BuildData, then perform a poll that usually reports a null pointer exception. Refresh the log page and it will tell us which item is null that was previously not null. That test build will probably also resolve the null pointer exception.

            markewaite Mark Waite
            nm_v Victoria
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: