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.

          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 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.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1908
          [FIXED JENKINS-13336] (Revision bd751ff878e50bcc17d6ce5971377f00d11496fa)

          Result = SUCCESS
          kohsuke : bd751ff878e50bcc17d6ce5971377f00d11496fa
          Files :

          • core/pom.xml
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #1908 [FIXED JENKINS-13336] (Revision bd751ff878e50bcc17d6ce5971377f00d11496fa) Result = SUCCESS kohsuke : bd751ff878e50bcc17d6ce5971377f00d11496fa Files : core/pom.xml changelog.html

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/bd751ff878e50bcc17d6ce5971377f00d11496fa
          Log:
          [FIXED JENKINS-13336]

          Integrated a fix Jesse made in stapler.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/pom.xml http://jenkins-ci.org/commit/jenkins/bd751ff878e50bcc17d6ce5971377f00d11496fa Log: [FIXED JENKINS-13336] Integrated a fix Jesse made in stapler.

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

              Created:
              Updated:
              Resolved: