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

Signature in hudson.tasks.Maven.MavenInstaller.json causes NullPointerException

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • None
    • Jenkins 1.423 and 1.414
      Ubuntu 64bit
      JDK 1.6.0_16

    Description

      We have three Jenkins instances. Two are on 1.423 and one is on 1.414. Starting sometime on September 8th 2012, our builds on Jenkins all started to fail with the following error:

      FATAL: Error while setting property=signature type class java.lang.Object
      net.sf.json.JSONException: Error while setting property=signature type class java.lang.Object
      	at net.sf.json.JSONObject.toBean(JSONObject.java:577)
      	at net.sf.json.JSONObject.toBean(JSONObject.java:383)
      	at net.sf.json.JSONObject.toBean(JSONObject.java:250)
      	at hudson.tools.DownloadFromUrlInstaller$DescriptorImpl.getInstallables(DownloadFromUrlInstaller.java:151)
      	at hudson.tools.DownloadFromUrlInstaller.getInstallable(DownloadFromUrlInstaller.java:54)
      	at hudson.tools.DownloadFromUrlInstaller.performInstallation(DownloadFromUrlInstaller.java:63)
      	at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:61)
      	at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:107)
      	at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:150)
      	at hudson.tasks.Maven$MavenInstallation.forNode(Maven.java:510)
      	at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:174)
      	at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:582)
      	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:448)
      	at hudson.model.Run.run(Run.java:1376)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:478)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:175)
      Caused by: java.lang.NullPointerException
      	at net.sf.json.JSONObject$MethodProperty.isWritable(JSONObject.java:311)
      	at net.sf.json.JSONObject.toBean(JSONObject.java:429)
      	... 16 more
      

      We were able to narrow it down to hudson.tasks.Maven.MavenInstaller.json that caused the problem by deleting that file from our server and kicking off a job run. The first run without the JSON file will run fine, but subsequent runs fails because the file gets redownloaded from http://updates.jenkins-ci.org/updates/hudson.tasks.Maven.MavenInstaller.json.

      Our current workaround for the problem is that we created an empty (valid) hudson.tasks.Maven.MavenInstaller.json file and turned off the write permission on that file so it won't get updated by Jenkins. We're not sure if there will be any problems if Jenkins tries to update that file again though.

      After doing some research, we believe the following commit caused Jenkins to start breaking:
      https://github.com/jenkinsci/jenkins/commit/62f66f899c95ccdfdc7a5d3346240988b42a9aad

      Looks like the change causes the MavenInstaller JSON file to add a new "signature" block, which our Jenkins version cannot handle.

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            core/src/test/java/jenkins/ResilientJsonObjectTest.java
            http://jenkins-ci.org/commit/jenkins/1b3eb0b9e7a3ee35d6c40d5e4460f4bb1f17e0e9
            Log:
            added a test to check for regressions in JENKINS-15105.

            Compare: https://github.com/jenkinsci/jenkins/compare/24556ac8523b...1b3eb0b9e7a3

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/test/java/jenkins/ResilientJsonObjectTest.java http://jenkins-ci.org/commit/jenkins/1b3eb0b9e7a3ee35d6c40d5e4460f4bb1f17e0e9 Log: added a test to check for regressions in JENKINS-15105 . Compare: https://github.com/jenkinsci/jenkins/compare/24556ac8523b...1b3eb0b9e7a3

            The metadata has been updated not to include the signature in the JSON files.

            (The signature was moved to the .json.html files)

            kohsuke Kohsuke Kawaguchi added a comment - The metadata has been updated not to include the signature in the JSON files. (The signature was moved to the .json.html files)

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            core/src/main/java/hudson/model/DownloadService.java
            war/src/main/webapp/scripts/hudson-behavior.js
            http://jenkins-ci.org/commit/jenkins/f3701da9e215abeaadef39c1f47021cb6e4d479b
            Log:
            JENKINS-15105

            Prefer the postMessage version to retrieve the metadata so that we can leave the existing JSON format as-is for backward compatibility with pre-1.424 Jenkins.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/hudson/model/DownloadService.java war/src/main/webapp/scripts/hudson-behavior.js http://jenkins-ci.org/commit/jenkins/f3701da9e215abeaadef39c1f47021cb6e4d479b Log: JENKINS-15105 Prefer the postMessage version to retrieve the metadata so that we can leave the existing JSON format as-is for backward compatibility with pre-1.424 Jenkins.

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            core/src/main/java/hudson/model/DownloadService.java
            war/src/main/webapp/scripts/hudson-behavior.js
            http://jenkins-ci.org/commit/jenkins/ad61369d7b4c774db4fe3606cc71dfad797bf49f
            Log:
            JENKINS-15105

            Prefer the postMessage version to retrieve the metadata so that we can leave the existing JSON format as-is for backward compatibility with pre-1.424 Jenkins.
            (cherry picked from commit f3701da9e215abeaadef39c1f47021cb6e4d479b)

            Conflicts:

            war/src/main/webapp/scripts/hudson-behavior.js

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/hudson/model/DownloadService.java war/src/main/webapp/scripts/hudson-behavior.js http://jenkins-ci.org/commit/jenkins/ad61369d7b4c774db4fe3606cc71dfad797bf49f Log: JENKINS-15105 Prefer the postMessage version to retrieve the metadata so that we can leave the existing JSON format as-is for backward compatibility with pre-1.424 Jenkins. (cherry picked from commit f3701da9e215abeaadef39c1f47021cb6e4d479b) Conflicts: war/src/main/webapp/scripts/hudson-behavior.js
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #1927
            JENKINS-15105 (Revision f3701da9e215abeaadef39c1f47021cb6e4d479b)

            Result = SUCCESS
            kohsuke : f3701da9e215abeaadef39c1f47021cb6e4d479b
            Files :

            • war/src/main/webapp/scripts/hudson-behavior.js
            • core/src/main/java/hudson/model/DownloadService.java
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #1927 JENKINS-15105 (Revision f3701da9e215abeaadef39c1f47021cb6e4d479b) Result = SUCCESS kohsuke : f3701da9e215abeaadef39c1f47021cb6e4d479b Files : war/src/main/webapp/scripts/hudson-behavior.js core/src/main/java/hudson/model/DownloadService.java

            People

              kohsuke Kohsuke Kawaguchi
              jlin jlin
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: