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

Monitoring URL for JSON content change not working - "The size between old results and new results has to be the same"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • urltrigger-plugin
    • OS: openSUSE 12.2 (x86_64)

      1. Configure URL for monitoring similar to the following: http://som.where.com/xx/xxxxx/?param1=val1&param2=val2&param3=val3&_param4=-val4&_param5=1&_format=json
      2. Configured to inspect URL content
      3. Configured JSON path as follows: $['_list'][0]['id']
      4. Observing the URLTrigger Log

      Actual behavior:
      ====
      Inspecting the content
      [ERROR] - Polling error...
      [ERROR] - Error message: The size between old results and new results has to be the same.
      ====

      Expected behavior:
      something similar to:
      ====
      Inspecting the content
      Capturing URL context. Waiting next schedule to check a change.

      Polling complete. Took 0.73 sec.
      No changes.
      ====

      Analysis performed:
      Searched for the error text in sources, identified the following block in the following file (isTriggeringBuildForContent method) as a possible source: "src\main\java\org\jenkinsci\plugins\urltrigger\content\JSONContentType.java":
      ====
      if (results.size() != newResults.size())

      { throw new XTriggerException( "The size between old results and new results has to be the same."); }

      ====

      Further code review indicated the issue might be due to the initialization of "results" member, so changed to:
      ====
      private transient Map<String, Object> results = null;
      ====

      rebuilt and verified with the above change - the issue no longer manifesting itself.

            gbois Gregory Boissinot
            sgerenski Stoimen Gerenski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: