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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins Version 1.458 on Linux (centos). Also appears in 1.457
    • Similar Issues:

      Description

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

        Attachments

          Issue Links

            Activity

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

            Show
            hjhafner 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.
            Hide
            flyingfish Jason Howk added a comment - - edited

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

            Show
            flyingfish Jason Howk added a comment - - edited This looks like it was fixed in f65c3484. I don't see duplicates anymore on 1.467.
            Hide
            geraldb 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.

            Show
            geraldb 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.
            Hide
            jglick 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.

            Show
            jglick 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 .
            Hide
            jglick Jesse Glick added a comment -

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

            Show
            jglick Jesse Glick added a comment - 8e73cda in Stapler should fix the problem; need a new release to be published and incorporated in Jenkins.
            Hide
            dogfood 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
            Show
            dogfood 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
            Hide
            scm_issue_link 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.

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: