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

NPE in TimerTrigger after enabling a job previously in disabled state

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      1.621 Linux
    • Similar Issues:

      Description

      I'm seeing the following exception in my jenkins log:

      WARNING: hudson.triggers.TimerTrigger.run() failed for hudson.model.FreeStyleProject@3bb09a54[Test]
      java.lang.NullPointerException
              at hudson.triggers.TimerTrigger.run(TimerTrigger.java:55)
              at hudson.triggers.Trigger.checkTriggers(Trigger.java:283)
              at hudson.triggers.Trigger$Cron.doRun(Trigger.java:217)
              at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
              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)

      I have been able to reproduce this by creating a new job in the disabled state. Waiting for a normal execution period to pass, then re-enabling the job. Each time the trigger fails until I re-save the project, then appears to trigger properly.

      My project config is the following:

      <?xml version='1.0' encoding='UTF-8'?>
      <project>
        <actions/>
        <description></description>
        <logRotator class="hudson.tasks.LogRotator">
          <daysToKeep>14</daysToKeep>
          <numToKeep>-1</numToKeep>
          <artifactDaysToKeep>-1</artifactDaysToKeep>
          <artifactNumToKeep>-1</artifactNumToKeep>
        </logRotator>
        <keepDependencies>false</keepDependencies>
        <properties/>
        <scm class="hudson.scm.NullSCM"/>
        <canRoam>true</canRoam>
        <disabled>false</disabled>
        <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
        <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
        <triggers>
          <hudson.triggers.TimerTrigger>
            <spec>*/1 * * * 0-6
      </spec>
          </hudson.triggers.TimerTrigger>
        </triggers>
        <concurrentBuild>false</concurrentBuild>
        <builders>
          <hudson.tasks.Shell>
            <command>echo &quot;hello&quot;</command>
          </hudson.tasks.Shell>
        </builders>
        <publishers>
          <hudson.tasks.Mailer plugin="mailer@1.11">
            <recipients>test@nospam.com</recipients>
            <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
            <sendToIndividuals>false</sendToIndividuals>
          </hudson.tasks.Mailer>
        </publishers>
        <buildWrappers/>
      </project>
      

        Attachments

          Issue Links

            Activity

            c_brown Clint Brown created issue -
            c_brown Clint Brown made changes -
            Field Original Value New Value
            Description I'm seeing the following exception in my jenkins log:

            {code:java}
            WARNING: hudson.triggers.TimerTrigger.run() failed for hudson.model.FreeStyleProject@3bb09a54[Test]
            java.lang.NullPointerException
                    at hudson.triggers.TimerTrigger.run(TimerTrigger.java:55)
                    at hudson.triggers.Trigger.checkTriggers(Trigger.java:283)
                    at hudson.triggers.Trigger$Cron.doRun(Trigger.java:217)
                    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
                    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){code}

            I have been able to reproduce this by creating a new job in the disabled state. Waiting for a normal execution period to pass, then re-enabling the job. Each time trigger fails until I re-save the project, then appears to trigger properly.
            I'm seeing the following exception in my jenkins log:

            {code:java}
            WARNING: hudson.triggers.TimerTrigger.run() failed for hudson.model.FreeStyleProject@3bb09a54[Test]
            java.lang.NullPointerException
                    at hudson.triggers.TimerTrigger.run(TimerTrigger.java:55)
                    at hudson.triggers.Trigger.checkTriggers(Trigger.java:283)
                    at hudson.triggers.Trigger$Cron.doRun(Trigger.java:217)
                    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
                    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){code}

            I have been able to reproduce this by creating a new job in the disabled state. Waiting for a normal execution period to pass, then re-enabling the job. Each time the trigger fails until I re-save the project, then appears to trigger properly.
            c_brown Clint Brown made changes -
            Description I'm seeing the following exception in my jenkins log:

            {code:java}
            WARNING: hudson.triggers.TimerTrigger.run() failed for hudson.model.FreeStyleProject@3bb09a54[Test]
            java.lang.NullPointerException
                    at hudson.triggers.TimerTrigger.run(TimerTrigger.java:55)
                    at hudson.triggers.Trigger.checkTriggers(Trigger.java:283)
                    at hudson.triggers.Trigger$Cron.doRun(Trigger.java:217)
                    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
                    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){code}

            I have been able to reproduce this by creating a new job in the disabled state. Waiting for a normal execution period to pass, then re-enabling the job. Each time the trigger fails until I re-save the project, then appears to trigger properly.
            I'm seeing the following exception in my jenkins log:

            {code:java}
            WARNING: hudson.triggers.TimerTrigger.run() failed for hudson.model.FreeStyleProject@3bb09a54[Test]
            java.lang.NullPointerException
                    at hudson.triggers.TimerTrigger.run(TimerTrigger.java:55)
                    at hudson.triggers.Trigger.checkTriggers(Trigger.java:283)
                    at hudson.triggers.Trigger$Cron.doRun(Trigger.java:217)
                    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
                    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){code}

            I have been able to reproduce this by creating a new job in the disabled state. Waiting for a normal execution period to pass, then re-enabling the job. Each time the trigger fails until I re-save the project, then appears to trigger properly.

            My project config is the following:

            {code:java}

            {code}
            c_brown Clint Brown made changes -
            Description I'm seeing the following exception in my jenkins log:

            {code:java}
            WARNING: hudson.triggers.TimerTrigger.run() failed for hudson.model.FreeStyleProject@3bb09a54[Test]
            java.lang.NullPointerException
                    at hudson.triggers.TimerTrigger.run(TimerTrigger.java:55)
                    at hudson.triggers.Trigger.checkTriggers(Trigger.java:283)
                    at hudson.triggers.Trigger$Cron.doRun(Trigger.java:217)
                    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
                    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){code}

            I have been able to reproduce this by creating a new job in the disabled state. Waiting for a normal execution period to pass, then re-enabling the job. Each time the trigger fails until I re-save the project, then appears to trigger properly.

            My project config is the following:

            {code:java}

            {code}
            I'm seeing the following exception in my jenkins log:

            {code:java}
            WARNING: hudson.triggers.TimerTrigger.run() failed for hudson.model.FreeStyleProject@3bb09a54[Test]
            java.lang.NullPointerException
                    at hudson.triggers.TimerTrigger.run(TimerTrigger.java:55)
                    at hudson.triggers.Trigger.checkTriggers(Trigger.java:283)
                    at hudson.triggers.Trigger$Cron.doRun(Trigger.java:217)
                    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
                    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){code}

            I have been able to reproduce this by creating a new job in the disabled state. Waiting for a normal execution period to pass, then re-enabling the job. Each time the trigger fails until I re-save the project, then appears to trigger properly.

            My project config is the following:


            {noformat}
            <?xml version='1.0' encoding='UTF-8'?>
            <project>
              <actions/>
              <description></description>
              <logRotator class="hudson.tasks.LogRotator">
                <daysToKeep>14</daysToKeep>
                <numToKeep>-1</numToKeep>
                <artifactDaysToKeep>-1</artifactDaysToKeep>
                <artifactNumToKeep>-1</artifactNumToKeep>
              </logRotator>
              <keepDependencies>false</keepDependencies>
              <properties/>
              <scm class="hudson.scm.NullSCM"/>
              <canRoam>true</canRoam>
              <disabled>false</disabled>
              <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
              <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
              <triggers>
                <hudson.triggers.TimerTrigger>
                  <spec>*/1 * * * 0-6
            </spec>
                </hudson.triggers.TimerTrigger>
              </triggers>
              <concurrentBuild>false</concurrentBuild>
              <builders>
                <hudson.tasks.Shell>
                  <command>echo &quot;hello&quot;</command>
                </hudson.tasks.Shell>
              </builders>
              <publishers>
                <hudson.tasks.Mailer plugin="mailer@1.11">
                  <recipients>test@nospam.com</recipients>
                  <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
                  <sendToIndividuals>false</sendToIndividuals>
                </hudson.tasks.Mailer>
              </publishers>
              <buildWrappers/>
            </project>
            {noformat}

            Hide
            integer Kanstantsin Shautsou added a comment -

            Possibly relates to JENKINS-29792

            Show
            integer Kanstantsin Shautsou added a comment - Possibly relates to JENKINS-29792
            integer Kanstantsin Shautsou made changes -
            Link This issue is related to JENKINS-29792 [ JENKINS-29792 ]
            integer Kanstantsin Shautsou made changes -
            Link This issue is related to JENKINS-29792 [ JENKINS-29792 ]
            Hide
            integer Kanstantsin Shautsou added a comment -

            Opened generic JENKINS-29794, i think it will be related

            Show
            integer Kanstantsin Shautsou added a comment - Opened generic JENKINS-29794 , i think it will be related
            integer Kanstantsin Shautsou made changes -
            Link This issue is related to JENKINS-29794 [ JENKINS-29794 ]
            Show
            integer Kanstantsin Shautsou added a comment - Proposed PR https://github.com/jenkinsci/jenkins/pull/1783
            integer Kanstantsin Shautsou made changes -
            Summary NPE in TimeTrigger after enabling a job previously in disabled state NPE in TimerTrigger after enabling a job previously in disabled state
            integer Kanstantsin Shautsou made changes -
            Remote Link This issue links to "jenkins/pull/1783 (Web Link)" [ 13106 ]
            integer Kanstantsin Shautsou made changes -
            Assignee Kanstantsin Shautsou [ integer ]
            integer Kanstantsin Shautsou made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-29945 [ JENKINS-29945 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kanstantsin Shautsou
            Path:
            core/src/main/java/hudson/triggers/SCMTrigger.java
            core/src/main/java/hudson/triggers/TimerTrigger.java
            core/src/main/java/hudson/triggers/Trigger.java
            core/src/test/java/hudson/triggers/SCMTriggerTest.java
            core/src/test/java/hudson/triggers/TimerTriggerTest.java
            http://jenkins-ci.org/commit/jenkins/79c0bbf76680c8491e601be76d062299b7170971
            Log:
            Protect from race condition in Triggers

            [FIXED JENKINS-29790] [FIXED JENKINS-29945]

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kanstantsin Shautsou Path: core/src/main/java/hudson/triggers/SCMTrigger.java core/src/main/java/hudson/triggers/TimerTrigger.java core/src/main/java/hudson/triggers/Trigger.java core/src/test/java/hudson/triggers/SCMTriggerTest.java core/src/test/java/hudson/triggers/TimerTriggerTest.java http://jenkins-ci.org/commit/jenkins/79c0bbf76680c8491e601be76d062299b7170971 Log: Protect from race condition in Triggers [FIXED JENKINS-29790] [FIXED JENKINS-29945]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            core/src/main/java/hudson/scheduler/CronTabList.java
            core/src/main/java/hudson/triggers/SCMTrigger.java
            core/src/main/java/hudson/triggers/TimerTrigger.java
            core/src/main/java/hudson/triggers/Trigger.java
            core/src/main/java/hudson/util/SequentialExecutionQueue.java
            core/src/main/java/jenkins/triggers/ReverseBuildTrigger.java
            core/src/test/java/hudson/triggers/SCMTriggerTest.java
            core/src/test/java/hudson/triggers/TimerTriggerTest.java
            pom.xml
            test/pom.xml
            test/src/test/java/hudson/PluginTest.java
            http://jenkins-ci.org/commit/jenkins/434608ba38438b7acde2417c1d6ae047773db560
            Log:
            JENKINS-29790 Noting merge of #1783.

            Compare: https://github.com/jenkinsci/jenkins/compare/5e9492d12299...434608ba3843

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/scheduler/CronTabList.java core/src/main/java/hudson/triggers/SCMTrigger.java core/src/main/java/hudson/triggers/TimerTrigger.java core/src/main/java/hudson/triggers/Trigger.java core/src/main/java/hudson/util/SequentialExecutionQueue.java core/src/main/java/jenkins/triggers/ReverseBuildTrigger.java core/src/test/java/hudson/triggers/SCMTriggerTest.java core/src/test/java/hudson/triggers/TimerTriggerTest.java pom.xml test/pom.xml test/src/test/java/hudson/PluginTest.java http://jenkins-ci.org/commit/jenkins/434608ba38438b7acde2417c1d6ae047773db560 Log: JENKINS-29790 Noting merge of #1783. Compare: https://github.com/jenkinsci/jenkins/compare/5e9492d12299...434608ba3843
            integer Kanstantsin Shautsou made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 164866 ] JNJira + In-Review [ 197565 ]

              People

              Assignee:
              integer Kanstantsin Shautsou
              Reporter:
              c_brown Clint Brown
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: