No cvs polling seems to be working:

      Started on 20-Jun-2012 14:22:10
      ERROR: Failed to record SCM polling for hudson.model.FreeStyleProject@75222b8e[]
      java.lang.NullPointerException
      at jenkins.model.Jenkins.getInstance(Jenkins.java:694)
      at hudson.model.Run.getCharacteristicEnvVars(Run.java:1947)
      at hudson.model.Run.getEnvironment(Run.java:1906)
      at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:843)
      at hudson.scm.CVSSCM.compareRemoteRevisionWith(CVSSCM.java:284)
      at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
      at hudson.scm.SCM.poll(SCM.java:373)
      at hudson.model.AbstractProject.poll(AbstractProject.java:1370)
      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(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-14163] CVS Polling Log error

          Which version of the CVS plugin and Jenkins are you using? This looks like Jenkins can't find it's own instance which wouldn't make sense so I'll need to try and replicate your setup.

          Michael Clarke added a comment - Which version of the CVS plugin and Jenkins are you using? This looks like Jenkins can't find it's own instance which wouldn't make sense so I'll need to try and replicate your setup.

          Thanks Michael

          I have a further update. Have fixed this issue now - not sure which of a number of methods did it! - but am experiencing huge delays when SCM polling, specifically with the rlog command. When run from bash this takes <5 minutes. Using the in-built polling it takes on average > 2 hours.

          Jenkins version 1.472
          CVS plugin version 2.4

          Educated guess is that this is something to do with the java netbeans cvs plugin - running from bash I am using standard cvs commands. Is there some way to find out what could be causing these delays?

          Oliver Whiteman added a comment - Thanks Michael I have a further update. Have fixed this issue now - not sure which of a number of methods did it! - but am experiencing huge delays when SCM polling, specifically with the rlog command. When run from bash this takes <5 minutes. Using the in-built polling it takes on average > 2 hours. Jenkins version 1.472 CVS plugin version 2.4 Educated guess is that this is something to do with the java netbeans cvs plugin - running from bash I am using standard cvs commands. Is there some way to find out what could be causing these delays?

          Oliver - it's more likely the delay is caused by the way we parse the rlog output than the time it takes to run it (the CVS Server compiles the rlog output and all the client does is read the network socket to retrieve the output - there's not any real way a client can slow down this process). The parsing of the output is an area that was written fairly quickly for an old project I had and should really be tidied up. Kohsuke has commented on this in JENKINS-13814 and is something I plan on resolving in the next couple of weeks since it seems to be causing the largest number of problems just now.

          Michael Clarke added a comment - Oliver - it's more likely the delay is caused by the way we parse the rlog output than the time it takes to run it (the CVS Server compiles the rlog output and all the client does is read the network socket to retrieve the output - there's not any real way a client can slow down this process). The parsing of the output is an area that was written fairly quickly for an old project I had and should really be tidied up. Kohsuke has commented on this in JENKINS-13814 and is something I plan on resolving in the next couple of weeks since it seems to be causing the largest number of problems just now.

          Thanks for the update Michael. Hopefully the changes will resolve our issues.

          Oliver Whiteman added a comment - Thanks for the update Michael. Hopefully the changes will resolve our issues.

          Oliver Whiteman added a comment - - edited

          This is where the threads are stuck:

          SCM polling for hudson.model.FreeStyleProject@38ddab20[Mods]

          "SCM polling for hudson.model.FreeStyleProject@38ddab20[Mods]" Id=83 Group=main RUNNABLE
          at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3366)
          at java.util.regex.Pattern$Curly.match(Pattern.java:3737)
          at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
          at java.util.regex.Pattern$Curly.match1(Pattern.java:3797)
          at java.util.regex.Pattern$Curly.match(Pattern.java:3746)
          at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
          at java.util.regex.Pattern$Curly.match0(Pattern.java:3782)
          at java.util.regex.Pattern$Curly.match(Pattern.java:3744)
          at java.util.regex.Pattern$Start.match(Pattern.java:3055)
          at java.util.regex.Matcher.search(Matcher.java:1105)
          at java.util.regex.Matcher.find(Matcher.java:535)
          at hudson.scm.CvsChangeLogHelper.mapCvsLog(CvsChangeLogHelper.java:169)
          at hudson.scm.CVSSCM.calculateRepositoryState(CVSSCM.java:465)
          at hudson.scm.CVSSCM.compareRemoteRevisionWith(CVSSCM.java:320)
          at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
          at hudson.scm.SCM.poll(SCM.java:373)
          at hudson.model.AbstractProject.poll(AbstractProject.java:1377)
          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(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)

          Number of locked synchronizers = 1

          • java.util.concurrent.locks.ReentrantLock$NonfairSync@16cb436a

          SCM polling for hudson.model.FreeStyleProject@409a6317[Mods]

          "SCM polling for hudson.model.FreeStyleProject@409a6317[Mods]" Id=82 Group=main RUNNABLE
          at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
          at java.util.regex.Pattern$Curly.match1(Pattern.java:3803)
          at java.util.regex.Pattern$Curly.match(Pattern.java:3746)
          at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
          at java.util.regex.Pattern$Curly.match0(Pattern.java:3782)
          at java.util.regex.Pattern$Curly.match(Pattern.java:3744)
          at java.util.regex.Pattern$Start.match(Pattern.java:3055)
          at java.util.regex.Matcher.search(Matcher.java:1105)
          at java.util.regex.Matcher.find(Matcher.java:535)
          at hudson.scm.CvsChangeLogHelper.mapCvsLog(CvsChangeLogHelper.java:169)
          at hudson.scm.CVSSCM.calculateRepositoryState(CVSSCM.java:465)
          at hudson.scm.CVSSCM.compareRemoteRevisionWith(CVSSCM.java:320)
          at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
          at hudson.scm.SCM.poll(SCM.java:373)
          at hudson.model.AbstractProject.poll(AbstractProject.java:1377)
          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(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)

          Number of locked synchronizers = 1

          • java.util.concurrent.locks.ReentrantLock$NonfairSync@7ab6efd6

          Running for 14 hours now!

          Oliver Whiteman added a comment - - edited This is where the threads are stuck: SCM polling for hudson.model.FreeStyleProject@38ddab20 [Mods] "SCM polling for hudson.model.FreeStyleProject@38ddab20 [Mods] " Id=83 Group=main RUNNABLE at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3366) at java.util.regex.Pattern$Curly.match(Pattern.java:3737) at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227) at java.util.regex.Pattern$Curly.match1(Pattern.java:3797) at java.util.regex.Pattern$Curly.match(Pattern.java:3746) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168) at java.util.regex.Pattern$Curly.match0(Pattern.java:3782) at java.util.regex.Pattern$Curly.match(Pattern.java:3744) at java.util.regex.Pattern$Start.match(Pattern.java:3055) at java.util.regex.Matcher.search(Matcher.java:1105) at java.util.regex.Matcher.find(Matcher.java:535) at hudson.scm.CvsChangeLogHelper.mapCvsLog(CvsChangeLogHelper.java:169) at hudson.scm.CVSSCM.calculateRepositoryState(CVSSCM.java:465) at hudson.scm.CVSSCM.compareRemoteRevisionWith(CVSSCM.java:320) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject.poll(AbstractProject.java:1377) 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(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) Number of locked synchronizers = 1 java.util.concurrent.locks.ReentrantLock$NonfairSync@16cb436a SCM polling for hudson.model.FreeStyleProject@409a6317 [Mods] "SCM polling for hudson.model.FreeStyleProject@409a6317 [Mods] " Id=82 Group=main RUNNABLE at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345) at java.util.regex.Pattern$Curly.match1(Pattern.java:3803) at java.util.regex.Pattern$Curly.match(Pattern.java:3746) at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168) at java.util.regex.Pattern$Curly.match0(Pattern.java:3782) at java.util.regex.Pattern$Curly.match(Pattern.java:3744) at java.util.regex.Pattern$Start.match(Pattern.java:3055) at java.util.regex.Matcher.search(Matcher.java:1105) at java.util.regex.Matcher.find(Matcher.java:535) at hudson.scm.CvsChangeLogHelper.mapCvsLog(CvsChangeLogHelper.java:169) at hudson.scm.CVSSCM.calculateRepositoryState(CVSSCM.java:465) at hudson.scm.CVSSCM.compareRemoteRevisionWith(CVSSCM.java:320) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject.poll(AbstractProject.java:1377) 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(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) Number of locked synchronizers = 1 java.util.concurrent.locks.ReentrantLock$NonfairSync@7ab6efd6 Running for 14 hours now!

          Is there any update on this please

          Thanks

          Oliver Whiteman added a comment - Is there any update on this please Thanks

          Kohsuke made a change which is included in the current release which may fix the parsing of the changelog, although I'm looking to change the whole way the changelog is parsed in the current iteration which will fix your issue. I'm not going to be able to start work on this for a couple of weeks, but will link changes back to this defect so they are visible.

          Michael Clarke added a comment - Kohsuke made a change which is included in the current release which may fix the parsing of the changelog, although I'm looking to change the whole way the changelog is parsed in the current iteration which will fix your issue. I'm not going to be able to start work on this for a couple of weeks, but will link changes back to this defect so they are visible.

          Shane Turner added a comment -

          I'm having the same problem, I believe.

          I'm currently running Jenkins 1.478, with the 2.5 CVS plugin.

          22-Aug-2012 1:53:03 PM hudson.triggers.SCMTrigger$Runner runPolling
          SEVERE: Failed to record SCM polling for hudson.model.FreeStyleProject@3436fffc[ProjectNAME]
          java.lang.NullPointerException
          at hudson.scm.CVSSCM.compareRemoteRevisionWith(CVSSCM.java:324)
          at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
          at hudson.scm.SCM.poll(SCM.java:373)
          at hudson.model.AbstractProject._poll(AbstractProject.java:1415)
          at hudson.model.AbstractProject.poll(AbstractProject.java:1335)
          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(Executors.java:471)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
          at java.lang.Thread.run(Thread.java:636)

          Shane Turner added a comment - I'm having the same problem, I believe. I'm currently running Jenkins 1.478, with the 2.5 CVS plugin. 22-Aug-2012 1:53:03 PM hudson.triggers.SCMTrigger$Runner runPolling SEVERE: Failed to record SCM polling for hudson.model.FreeStyleProject@3436fffc [ProjectNAME] java.lang.NullPointerException at hudson.scm.CVSSCM.compareRemoteRevisionWith(CVSSCM.java:324) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject._poll(AbstractProject.java:1415) at hudson.model.AbstractProject.poll(AbstractProject.java:1335) 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(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636)

          Shane - I believe you're actually encountering a different issue, but need you to confirm something: does the current job have any successfully completed (non cancelled) jobs?

          Michael Clarke added a comment - Shane - I believe you're actually encountering a different issue, but need you to confirm something: does the current job have any successfully completed (non cancelled) jobs?

          Shane Turner added a comment -

          I don't believe that any of the jobs had been cancelled. I just stumbled across JENKINS-14711 and tried the workaround for changing the date separator in the changeDate field to use '-' instead of '/'. That made the changelogs visible.

          Shane Turner added a comment - I don't believe that any of the jobs had been cancelled. I just stumbled across JENKINS-14711 and tried the workaround for changing the date separator in the changeDate field to use '-' instead of '/'. That made the changelogs visible.

          Code changed in jenkins
          User: mc1arke
          Path:
          src/main/java/hudson/scm/AbstractCvs.java
          src/main/java/hudson/scm/CVSChangeLogSet.java
          src/main/java/hudson/scm/CvsLog.java
          src/test/java/hudson/scm/CvsChangeLogHelperTest.java
          http://jenkins-ci.org/commit/cvs-plugin/da501e9c5984e7e8b48bbf28cb22a36888e45dcc
          Log:
          Changing from regexp to keyword/token based parsing of CVS rlog output
          [FIXED JENKINS-14163] Prevent hanging of polling whilst parsing rlog contents
          [FIXED JENKINS-14293] Handle files with additional parameters in rlog output

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mc1arke Path: src/main/java/hudson/scm/AbstractCvs.java src/main/java/hudson/scm/CVSChangeLogSet.java src/main/java/hudson/scm/CvsLog.java src/test/java/hudson/scm/CvsChangeLogHelperTest.java http://jenkins-ci.org/commit/cvs-plugin/da501e9c5984e7e8b48bbf28cb22a36888e45dcc Log: Changing from regexp to keyword/token based parsing of CVS rlog output [FIXED JENKINS-14163] Prevent hanging of polling whilst parsing rlog contents [FIXED JENKINS-14293] Handle files with additional parameters in rlog output

          Fred G added a comment -

          Hi Michael,
          Unfortunately I still get this error with Jenkins v1.492 and CVS Plugin v2.8:

          ERROR: Failed to record SCM polling for hudson.model.FreeStyleProject@162a5f3[<project name>]
          java.lang.NullPointerException
          	at hudson.scm.AbstractCvs.compareRemoteRevisionWith(AbstractCvs.java:451)
          	at hudson.scm.CVSSCM.compareRemoteRevisionWith(CVSSCM.java:193)
          	at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
          	at hudson.scm.SCM.poll(SCM.java:373)
          	at hudson.model.AbstractProject._poll(AbstractProject.java:1483)
          	at hudson.model.AbstractProject.poll(AbstractProject.java:1403)
          	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)
          

          Let me know if/how I can provide more info.

          Fred G added a comment - Hi Michael, Unfortunately I still get this error with Jenkins v1.492 and CVS Plugin v2.8: ERROR: Failed to record SCM polling for hudson.model.FreeStyleProject@162a5f3[<project name>] java.lang.NullPointerException at hudson.scm.AbstractCvs.compareRemoteRevisionWith(AbstractCvs.java:451) at hudson.scm.CVSSCM.compareRemoteRevisionWith(CVSSCM.java:193) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject._poll(AbstractProject.java:1483) at hudson.model.AbstractProject.poll(AbstractProject.java:1403) 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) Let me know if/how I can provide more info.

          Fred,

          I suspect you have an invalid exclude pattern configure for one of your repositories. The NPE is thrown because we're failing to try and compile a pattern and are then trying to log the error using the listener for a launcher, despite not being passed a launcher by Jenkins (a side affect of not using a workspace for polling). I'll fix the NPE by changing the exception block to use the provided listener, rather than try and use a launcher's listener. I can then give you a snapshot if you want to try and track down the underlying exception that we're currently failing to log?

          Thanks,
          Michael

          Michael Clarke added a comment - Fred, I suspect you have an invalid exclude pattern configure for one of your repositories. The NPE is thrown because we're failing to try and compile a pattern and are then trying to log the error using the listener for a launcher, despite not being passed a launcher by Jenkins (a side affect of not using a workspace for polling). I'll fix the NPE by changing the exception block to use the provided listener, rather than try and use a launcher's listener. I can then give you a snapshot if you want to try and track down the underlying exception that we're currently failing to log? Thanks, Michael

          Fred G added a comment -

          Hi Michael,
          There was indeed a problem with the exclude pattern.
          Let me know when the snapshot is ready, then I can test it.

          Regards,
          Fred

          Fred G added a comment - Hi Michael, There was indeed a problem with the exclude pattern. Let me know when the snapshot is ready, then I can test it. Regards, Fred

          Code changed in jenkins
          User: Michael Clarke
          Path:
          src/main/java/hudson/scm/AbstractCvs.java
          http://jenkins-ci.org/commit/cvs-plugin/ee3cc0aaf9611694c75ce7d2356cb84e4767b0e7
          Log:
          [FIXED JENKINS-14163] Fix NPE on failure compiling exclude pattern

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Clarke Path: src/main/java/hudson/scm/AbstractCvs.java http://jenkins-ci.org/commit/cvs-plugin/ee3cc0aaf9611694c75ce7d2356cb84e4767b0e7 Log: [FIXED JENKINS-14163] Fix NPE on failure compiling exclude pattern

            mc1arke Michael Clarke
            oliverwhiteman Oliver Whiteman
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: