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

URLTrigger plugin update 0.43 disrupts JSON polling

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • urltrigger-plugin
    • None
    • CentOS release 6.9 (Final)
      openjdk version "1.8.0_131"
      Jenkins ver. 2.89.3

      Previous URLtrigger Plugin version installed: v0.41. Several jobs defined using "Poll with a URL" work for months until the URLtrigger v0.43 is applied. Jobs attempt to poll on normal (cron) scedule, but in the URLtrigger log I get error, "[ERROR] - Polling error..." and in the Jenkins server log, I get the following.

      Jun 12, 2018 11:13:00 AM org.jenkinsci.lib.xtrigger.AbstractTrigger reportError
      WARNING: Polling failed
      java.lang.NullPointerException
              at org.jenkinsci.plugins.urltrigger.URLTrigger.checkIfModifiedEntryForHttpOrHttpsURL(URLTrigger.java:262)
              at org.jenkinsci.plugins.urltrigger.URLTrigger.checkIfModifiedEntry(URLTrigger.java:248)
              at org.jenkinsci.plugins.urltrigger.URLTrigger.checkIfModified(URLTrigger.java:225)
              at org.jenkinsci.lib.xtrigger.AbstractTrigger$Runner.run(AbstractTrigger.java:202)
              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:748)

      Polling was defined to examine a JSON file and inspect the JSONpath ".BuildNum". Manually editing the job definition to remove and then identically re-define the URL spec makes the polling work again.

          [JENKINS-51892] URLTrigger plugin update 0.43 disrupts JSON polling

          Dana Goyette added a comment -

          Hmm, looks like it's calling .size() on a null object, when it should be either checking for null or checking the true-ness of the value.

          https://github.com/jenkinsci/urltrigger-plugin/blob/aec43e370550b26636aa9cab0f23a5cbcffdc44f/src/main/java/org/jenkinsci/plugins/urltrigger/URLTrigger.java#L262

          In my case, I'm using the job-dsl plugin, so my workaround was to use the configure block to set 'org.jenkinsci.plugins.urltrigger.URLTrigger' / 'entries' / 'org.jenkinsci.plugins.urltrigger.URLTriggerEntry' / 'requestHeaders' to be empty (instead of missing).

          Dana Goyette added a comment - Hmm, looks like it's calling .size() on a null object, when it should be either checking for null or checking the true-ness of the value. https://github.com/jenkinsci/urltrigger-plugin/blob/aec43e370550b26636aa9cab0f23a5cbcffdc44f/src/main/java/org/jenkinsci/plugins/urltrigger/URLTrigger.java#L262 In my case, I'm using the job-dsl plugin, so my workaround was to use the configure block to set 'org.jenkinsci.plugins.urltrigger.URLTrigger' / 'entries' / 'org.jenkinsci.plugins.urltrigger.URLTriggerEntry' / 'requestHeaders' to be empty (instead of missing).

          Tony Noble added a comment -

          Okay, this would appear to be due to the code not taking account of existing configuration that won't have entries for the request headers (and so won't be setting them).  The fix is fairly straightforward, will aim to get 0.44 out shortly.

          Tony Noble added a comment - Okay, this would appear to be due to the code not taking account of existing configuration that won't have entries for the request headers (and so won't be setting them).  The fix is fairly straightforward, will aim to get 0.44 out shortly.

          Ben Copeland added a comment -

          I am hitting this bug too. Do you have an ETA for 0.44?

          Ben Copeland added a comment - I am hitting this bug too. Do you have an ETA for 0.44?

          Tony Noble added a comment -

          0.44 now released, includes this (and related) fixes.  Closing this issue as fixed.

          Tony Noble added a comment - 0.44 now released, includes this (and related) fixes.  Closing this issue as fixed.

          Tony Noble added a comment -

          Fixed in release 0.44

          Tony Noble added a comment - Fixed in release 0.44

            stealthdj Tony Noble
            codex24 Kevin Calman
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: