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

          Kevin Calman created issue -
          Kevin Calman made changes -
          Description Original: 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 RULtrigger 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)}}

           

          Manually editing the job definition to remove and then identically re-define the URL spec makes the polling work again.
          New: 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 RULtrigger 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.
          Kevin Calman made changes -
          Description Original: 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 RULtrigger 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.
          New: 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 RULtrigger 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.
          shan shan made changes -
          Assignee Original: Gregory Boissinot [ gbois ] New: shan shan [ shanexpert28 ]
          shan shan made changes -
          Assignee Original: shan shan [ shanexpert28 ] New: balu kun [ balu11437 ]
          Oleg Nenashev made changes -
          Assignee Original: balu kun [ balu11437 ] New: Gregory Boissinot [ gbois ]
          Kevin Calman made changes -
          Description Original: 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 RULtrigger 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.
          New: 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.

          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 made changes -
          Assignee Original: Gregory Boissinot [ gbois ] New: Tony Noble [ stealthdj ]

          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.

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

              Created:
              Updated:
              Resolved: