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

Invalid JSON is produced during remote api operations when a changeSet contains duplicate keys.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • Jenkins Version 1.458 on Linux (centos). Also appears in 1.457

      Use this URL as a working example: http://ci.jenkins-ci.org/view/Jenkins%20core/job/jenkins_main_trunk/1637/api/json

      When looking at a specific build for a given job, the JSON produced for the Remote API functionality is invalid when the changeSet is not null. Using the example above, the JSON returned from this api call results in the changeSet object containing two author and msg objects. These duplicate keys are causing errors with external parsers that are downloading data using the api.

      Steps to reproduce:
      1.) Using the URL above, attempt to validate the JSON using JSLint (www.jslint.com)
      2.) You will receive a duplicate 'author' and 'msg' error.
      3.) Using a build that does not have a changeSet does not contain the duplicates and therefore produces valid JSON.

      https://builds.apache.org/job/ActiveMQ/918/api/json can also be used (Jenkins 1.457) to verify. A duplicate changeSet/items/msg will be found.

      Expected result:
      1.) Data should validate properly (and therefore parse.)

          [JENKINS-13336] Invalid JSON is produced during remote api operations when a changeSet contains duplicate keys.

          Jason Howk created issue -

          We have the same problem with api/xml using a URL like http://jenkins:9090/job/MyJob/2/api/xml?depth=0&xpath=//changeSet/item&wrapper=root
          This problem occurs first in Jenkins 1.457, version 1.456 is ok.

          Hans-Juergen Hafner added a comment - We have the same problem with api/xml using a URL like http://jenkins:9090/job/MyJob/2/api/xml?depth=0&xpath=//changeSet/item&wrapper=root This problem occurs first in Jenkins 1.457 , version 1.456 is ok.
          Jason Howk made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jason Howk made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]

          Jason Howk added a comment - - edited

          This looks like it was fixed in f65c3484. I don't see duplicates anymore on 1.467.

          Jason Howk added a comment - - edited This looks like it was fixed in f65c3484. I don't see duplicates anymore on 1.467.

          Gerald Bortis added a comment -

          We're running into the same issue with a duplicate 'msg' in the JSON API response. Confirmed the problem exists in versions 1.466.1, 1.467, and 1.475. The oldest version that doesn't have the problem that we can confirm is 1.456.

          Gerald Bortis added a comment - We're running into the same issue with a duplicate 'msg' in the JSON API response. Confirmed the problem exists in versions 1.466.1, 1.467, and 1.475. The oldest version that doesn't have the problem that we can confirm is 1.456.

          Jesse Glick added a comment -

          Confirmed regression due to f65c348; GitChangeSet marks these @Exported but now so does the superclass, and Stapler apparently does not notice the @Override.

          Jesse Glick added a comment - Confirmed regression due to f65c348 ; GitChangeSet marks these @Exported but now so does the superclass, and Stapler apparently does not notice the @Override .

          Jesse Glick added a comment -

          8e73cda in Stapler should fix the problem; need a new release to be published and incorporated in Jenkins.

          Jesse Glick added a comment - 8e73cda in Stapler should fix the problem; need a new release to be published and incorporated in Jenkins.
          Jesse Glick made changes -
          Assignee New: Kohsuke Kawaguchi [ kohsuke ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

            kohsuke Kohsuke Kawaguchi
            flyingfish Jason Howk
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: