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

NPE when adding/changing a TimerTrigger via groovy

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Minor Minor
    • core
    • None
    • Win7/64 Bit

      I am generating/changing lots of regression test jobs via groovy to
      keep our build machines chewing during the night. Yesterday I had to
      change some parameters in our jobs but the existing cron section
      stayed the same. When diffing the config file it shows my changes, the
      trigger section stayed the same. I did not restart Jenkins yesterday
      evening and found that no job got scheduled during the night.

      This is the error I got:
      Aug 09, 2012 9:00:07 PM hudson.triggers.Trigger checkTriggers
      WARNING: hudson.triggers.TimerTrigger.run() failed for XYZ_Tests
      java.lang.NullPointerException
      at hudson.triggers.TimerTrigger.run(TimerTrigger.java:53)
      at hudson.triggers.Trigger.checkTriggers(Trigger.java:259)
      at hudson.triggers.Trigger$Cron.doRun(Trigger.java:207)
      at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54)
      at java.util.TimerThread.mainLoop(Unknown Source)
      at java.util.TimerThread.run(Unknown Source)

      When I re-edit the file by hand via Web UI and save, it works, but this is not an option for about 150 jobs. Restarting Jenkins after modifying the job via groovy script also helps.

      The generated config file section of the jobs looks:
      <triggers class="vector">
      <hudson.triggers.TimerTrigger>
      <spec>30 20 * * 1-5</spec>
      </hudson.triggers.TimerTrigger>
      </triggers>

            Unassigned Unassigned
            bruce Dirk Kuypers
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: