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

Envinject plugin incompatibility with Jenkins 1.485

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • core

      When we upgraded our Jenkins to 1.485, some of our jobs did not show up on start-up even though their configuration files were still present. When we rolled Jenkins back to 1.484, the jobs reappeared.

      This problem continued with 1.486

      One common theme between the jobs that didn't show up is they use the parameterized-trigger plugin, which we are using 2.14. We have not upgraded this plugin because it removes the ability to specify triggering with multiple properties files

      In the Jenkins error logs, I see this NPE:

      Oct 15, 2012 3:34:56 PM jenkins.InitReactorRunner$1 onAttained
      INFO: Augmented all extensions
      java.lang.NullPointerException
      	at hudson.model.Run.getRootDir(Run.java:900)
      	at org.jenkinsci.lib.envinject.EnvInjectAction.readResolve(EnvInjectAction.java:86)
      	at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.lang.reflect.Method.invoke(Unknown Source)
      	at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadResolve(SerializationMethodInvoker.java:46)
      	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:222)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
      	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
      	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
      	at hudson.util.RobustCollectionConverter.populateCollection(RobustCollectionConverter.java:85)
      	at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:61)
      	at hudson.util.RobustCollectionConverter.unmarshal(RobustCollectionConverter.java:76)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
      	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
      	at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:332)
      	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:274)
      	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:221)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
      	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
      	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
      	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
      	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:926)
      	at hudson.util.XStream2.unmarshal(XStream2.java:103)
      	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:912)
      	at hudson.XmlFile.unmarshal(XmlFile.java:160)
      	at hudson.model.Run.reload(Run.java:291)
      	at hudson.model.Run.<init>(Run.java:280)
      	at hudson.model.AbstractBuild.<init>(AbstractBuild.java:182)
      	at hudson.model.Build.<init>(Build.java:103)
      	at hudson.model.FreeStyleBuild.<init>(FreeStyleBuild.java:41)
      	at sun.reflect.GeneratedConstructorAccessor49.newInstance(Unknown Source)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      	at java.lang.reflect.Constructor.newInstance(Unknown Source)
      	at hudson.model.AbstractProject.loadBuild(AbstractProject.java:1061)
      	at hudson.model.AbstractProject$1.create(AbstractProject.java:275)
      	at hudson.model.AbstractProject$1.create(AbstractProject.java:273)
      	at hudson.model.RunMap.retrieve(RunMap.java:220)
      	at hudson.model.RunMap.retrieve(RunMap.java:59)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:613)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:596)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.all(AbstractLazyLoadRunMap.java:549)
      	at jenkins.model.lazy.AbstractLazyLoadRunMap.entrySet(AbstractLazyLoadRunMap.java:234)
      	at java.util.AbstractMap$2$1.<init>(Unknown Source)
      	at java.util.AbstractMap$2.iterator(Unknown Source)
      	at hudson.util.RunList.iterator(RunList.java:103)
      	at org.jvnet.hudson.plugins.DownStreamProjectActionFactory.createFor(DownStreamProjectActionFactory.java:59)
      	at hudson.model.AbstractProject.createTransientActions(AbstractProject.java:675)
      	at hudson.model.Project.createTransientActions(Project.java:208)
      	at hudson.model.AbstractProject.updateTransientActions(AbstractProject.java:665)
      	at hudson.model.AbstractProject.onLoad(AbstractProject.java:299)
      	at hudson.model.Project.onLoad(Project.java:88)
      	at hudson.model.Items.load(Items.java:221)
      	at jenkins.model.Jenkins$17.run(Jenkins.java:2507)
      	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:146)
      	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
      	at jenkins.model.Jenkins$7.runTask(Jenkins.java:883)
      	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
      	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.lang.Thread.run(Unknown Source)
      

          [JENKINS-15533] Envinject plugin incompatibility with Jenkins 1.485

          Sam Reghenzi added a comment -

          Same problem on both winxp and centos 6.3 jenkins version 1.5.0

          GRAVE: Failed Loading job SOR-EAG
          java.lang.ArrayIndexOutOfBoundsException: Assertion error: failing to load #6 DE
          SC: lo=3,hi=0,size=5,size2=5
          at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunM
          ap.java:421)
          at hudson.model.AbstractBuild.getPreviousBuild(AbstractBuild.java:213)
          at hudson.tasks.Fingerprinter$FingerprintAction.onLoad(Fingerprinter.jav
          a:349)
          at hudson.model.Run.onLoad(Run.java:318)
          at hudson.model.RunMap.retrieve(RunMap.java:226)
          at hudson.model.RunMap.retrieve(RunMap.java:59)
          at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap
          .java:645)
          at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap
          .java:628)
          at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunM
          ap.java:435)
          at jenkins.model.lazy.AbstractLazyLoadRunMap.newestBuild(AbstractLazyLoa
          dRunMap.java:300)
          at hudson.model.AbstractProject.getLastBuild(AbstractProject.java:1021)
          at hudson.maven.AbstractMavenProject.createTransientActions(AbstractMave
          nProject.java:184)
          at hudson.model.AbstractProject.updateTransientActions(AbstractProject.j
          ava:688)
          at hudson.maven.MavenModule.updateTransientActions(MavenModule.java:411)

          at hudson.model.AbstractProject.onLoad(AbstractProject.java:300)
          at hudson.maven.MavenModule.onLoad(MavenModule.java:236)
          at hudson.model.Items.load(Items.java:221)
          at hudson.model.ItemGroupMixIn.loadChildren(ItemGroupMixIn.java:99)
          at hudson.maven.MavenModuleSet.onLoad(MavenModuleSet.java:748)
          at hudson.model.Items.load(Items.java:221)
          at jenkins.model.Jenkins$17.run(Jenkins.java:2539)
          at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuild
          er.java:146)
          at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
          at jenkins.model.Jenkins$7.runTask(Jenkins.java:889)
          at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
          at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
          utor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
          .java:908)

          Sam Reghenzi added a comment - Same problem on both winxp and centos 6.3 jenkins version 1.5.0 GRAVE: Failed Loading job SOR-EAG java.lang.ArrayIndexOutOfBoundsException: Assertion error: failing to load #6 DE SC: lo=3,hi=0,size=5,size2=5 at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunM ap.java:421) at hudson.model.AbstractBuild.getPreviousBuild(AbstractBuild.java:213) at hudson.tasks.Fingerprinter$FingerprintAction.onLoad(Fingerprinter.jav a:349) at hudson.model.Run.onLoad(Run.java:318) at hudson.model.RunMap.retrieve(RunMap.java:226) at hudson.model.RunMap.retrieve(RunMap.java:59) at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap .java:645) at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap .java:628) at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunM ap.java:435) at jenkins.model.lazy.AbstractLazyLoadRunMap.newestBuild(AbstractLazyLoa dRunMap.java:300) at hudson.model.AbstractProject.getLastBuild(AbstractProject.java:1021) at hudson.maven.AbstractMavenProject.createTransientActions(AbstractMave nProject.java:184) at hudson.model.AbstractProject.updateTransientActions(AbstractProject.j ava:688) at hudson.maven.MavenModule.updateTransientActions(MavenModule.java:411) at hudson.model.AbstractProject.onLoad(AbstractProject.java:300) at hudson.maven.MavenModule.onLoad(MavenModule.java:236) at hudson.model.Items.load(Items.java:221) at hudson.model.ItemGroupMixIn.loadChildren(ItemGroupMixIn.java:99) at hudson.maven.MavenModuleSet.onLoad(MavenModuleSet.java:748) at hudson.model.Items.load(Items.java:221) at jenkins.model.Jenkins$17.run(Jenkins.java:2539) at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuild er.java:146) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259) at jenkins.model.Jenkins$7.runTask(Jenkins.java:889) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec utor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:908)

          Jesse Glick added a comment -

          Probably several unrelated bugs here.

          Jesse Glick added a comment - Probably several unrelated bugs here.

          Jesse Glick added a comment -

          Originally reported exception is a duplicate of JENKINS-16239.

          Jesse Glick added a comment - Originally reported exception is a duplicate of JENKINS-16239 .

          Jose Sa added a comment - - edited

          I managed to perform the upgrade to 1.501 without failing to load jobs by disabling the Downstream buildview plugin.

          Maybe this info will help others with similar situation.

          Jose Sa added a comment - - edited I managed to perform the upgrade to 1.501 without failing to load jobs by disabling the Downstream buildview plugin . Maybe this info will help others with similar situation.

          The generic ticket title attracts other uses from reporting unrelated issues into this ticket. Therefore, I'm updating the ticket title to be more specific to the issue in the original report.

          None of the other comments discuss the same issue, so for the sake of this ticket, they need to be ignored — if they are still an issue, please file separate tickets for them.

          Kohsuke Kawaguchi added a comment - The generic ticket title attracts other uses from reporting unrelated issues into this ticket. Therefore, I'm updating the ticket title to be more specific to the issue in the original report. None of the other comments discuss the same issue, so for the sake of this ticket, they need to be ignored — if they are still an issue, please file separate tickets for them.

          Kohsuke Kawaguchi added a comment - - edited

          According to the stack trace, what seems to be happening is that the EnvInjectAction.build field is referring to another build object (IOW, not the one that the action is associated with.) In such case, a part of the referenced AbstractBuild object gets sucked into the serialized build.xml, but it's missing some critical transient fields (such as Run.project), and that causes this NPE. That's the root cause.

          What made the difference between 1.485 and 1.486 is probably that 1.485 recovered gracefully from this failure by letting the job load OK (even though some build records failed to load), and 1.486 didn't do that.

          Writing a test to verify this.

          Kohsuke Kawaguchi added a comment - - edited According to the stack trace, what seems to be happening is that the EnvInjectAction.build field is referring to another build object (IOW, not the one that the action is associated with.) In such case, a part of the referenced AbstractBuild object gets sucked into the serialized build.xml, but it's missing some critical transient fields (such as Run.project ), and that causes this NPE. That's the root cause. What made the difference between 1.485 and 1.486 is probably that 1.485 recovered gracefully from this failure by letting the job load OK (even though some build records failed to load), and 1.486 didn't do that. Writing a test to verify this.

          With a bit of experiment, I found that SerializationMethodInvoker catches this exception and turns it into ObjectAccessException, so such a NPE gets handled gracefully.

          The stack trace from the current version of Jenkins is as follows. The stack trace is likely bit different for 1.486, but the basic flow of the event will be the same. RunMap.retrieve catches IOException:

          Mar 13, 2013 10:40:58 AM hudson.model.RunMap retrieve
          WARNING: could not load /tmp/hudson2161128827066568119test/jobs/test0/builds/1
          hudson.util.IOException2: Unable to read /tmp/hudson2161128827066568119test/jobs/test0/builds/2013-03-13_10-40-57/build.xml
          	at hudson.XmlFile.unmarshal(XmlFile.java:170)
          	at hudson.model.Run.reload(Run.java:307)
          	at hudson.model.Run.<init>(Run.java:296)
          	at hudson.model.AbstractBuild.<init>(AbstractBuild.java:182)
          	at hudson.model.Build.<init>(Build.java:103)
          	at hudson.model.FreeStyleBuild.<init>(FreeStyleBuild.java:41)
          	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
          	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
          	at hudson.model.AbstractProject.loadBuild(AbstractProject.java:1106)
          	at hudson.model.AbstractProject$1.create(AbstractProject.java:306)
          	at hudson.model.AbstractProject$1.create(AbstractProject.java:304)
          	at hudson.model.RunMap.retrieve(RunMap.java:225)
          	at hudson.model.RunMap.retrieve(RunMap.java:59)
          	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:667)
          	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:629)
          	at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:368)
          	at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:526)
          	at hudson.model.AbstractProject.getBuildByNumber(AbstractProject.java:1028)
          	at hudson.model.AbstractProject$getBuildByNumber.call(Unknown Source)
          	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
          	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
          	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          	at hudson.model.RunMapTest.testRuntimeExceptionInUnmarshalling(RunMapTest.groovy:53)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.lang.reflect.Method.invoke(Method.java:601)
          	at junit.framework.TestCase.runTest(TestCase.java:176)
          	at org.jvnet.hudson.test.HudsonTestCase.runTest(HudsonTestCase.java:440)
          	at junit.framework.TestCase.runBare(TestCase.java:141)
          	at org.jvnet.hudson.test.HudsonTestCase.runBare(HudsonTestCase.java:296)
          	at junit.framework.TestResult$1.protect(TestResult.java:122)
          	at junit.framework.TestResult.runProtected(TestResult.java:142)
          	at junit.framework.TestResult.run(TestResult.java:125)
          	at junit.framework.TestCase.run(TestCase.java:129)
          	at junit.framework.TestSuite.runTest(TestSuite.java:255)
          	at junit.framework.TestSuite.run(TestSuite.java:250)
          	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
          	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
          	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
          	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
          	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.lang.reflect.Method.invoke(Method.java:601)
          	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
          Caused by: com.thoughtworks.xstream.converters.ConversionException: Could not call hudson.model.RunMapTest$BombAction.readResolve() : null : Could not call hudson.model.RunMapTest$BombAction.readResolve() : null
          ---- Debugging information ----
          message             : Could not call hudson.model.RunMapTest$BombAction.readResolve() : null
          cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
          cause-message       : Could not call hudson.model.RunMapTest$BombAction.readResolve() : null
          class               : hudson.model.RunMapTest$BombAction
          required-type       : hudson.model.RunMapTest$BombAction
          converter-type      : hudson.util.RobustReflectionConverter
          path                : /build/actions/hudson.model.RunMapTest$BombAction
          line number         : 43
          class[1]            : java.util.concurrent.CopyOnWriteArrayList
          converter-type[1]   : hudson.util.RobustCollectionConverter
          class[2]            : hudson.model.FreeStyleBuild
          version             : null
          -------------------------------
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
          	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
          	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
          	at hudson.util.RobustCollectionConverter.populateCollection(RobustCollectionConverter.java:85)
          	at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:61)
          	at hudson.util.RobustCollectionConverter.unmarshal(RobustCollectionConverter.java:76)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
          	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
          	at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:333)
          	at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:275)
          	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:222)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
          	at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
          	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
          	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1061)
          	at hudson.util.XStream2.unmarshal(XStream2.java:109)
          	at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1045)
          	at hudson.XmlFile.unmarshal(XmlFile.java:166)
          	... 48 more
          Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Could not call hudson.model.RunMapTest$BombAction.readResolve() : null
          	at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadResolve(SerializationMethodInvoker.java:72)
          	at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:223)
          	at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
          	... 71 more
          Caused by: java.lang.NullPointerException
          	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
          	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
          	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
          	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
          	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
          	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
          	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:186)
          	at hudson.model.RunMapTest$BombAction.readResolve(RunMapTest.groovy:60)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.lang.reflect.Method.invoke(Method.java:601)
          	at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadResolve(SerializationMethodInvoker.java:66)
          	... 73 more
          

          So I'm failing to see how this failure to load one record caused the entire job to fail to load. In fact I don't see who printed that exception — anyone catching this exception from RunMap or its caller would see all sorts of chained exceptions like the one I'm providing here, and you wouldn't see the stack trace in a nice single lineage. The only place this could have been done is from inside the envinject plugin itself.

          If that's the case, there must have been other additional stack traces and error messages that followed, and we need that to be able to get to the bottom of the issue.

          Kohsuke Kawaguchi added a comment - With a bit of experiment, I found that SerializationMethodInvoker catches this exception and turns it into ObjectAccessException , so such a NPE gets handled gracefully. The stack trace from the current version of Jenkins is as follows. The stack trace is likely bit different for 1.486, but the basic flow of the event will be the same. RunMap.retrieve catches IOException : Mar 13, 2013 10:40:58 AM hudson.model.RunMap retrieve WARNING: could not load /tmp/hudson2161128827066568119test/jobs/test0/builds/1 hudson.util.IOException2: Unable to read /tmp/hudson2161128827066568119test/jobs/test0/builds/2013-03-13_10-40-57/build.xml at hudson.XmlFile.unmarshal(XmlFile.java:170) at hudson.model.Run.reload(Run.java:307) at hudson.model.Run.<init>(Run.java:296) at hudson.model.AbstractBuild.<init>(AbstractBuild.java:182) at hudson.model.Build.<init>(Build.java:103) at hudson.model.FreeStyleBuild.<init>(FreeStyleBuild.java:41) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at hudson.model.AbstractProject.loadBuild(AbstractProject.java:1106) at hudson.model.AbstractProject$1.create(AbstractProject.java:306) at hudson.model.AbstractProject$1.create(AbstractProject.java:304) at hudson.model.RunMap.retrieve(RunMap.java:225) at hudson.model.RunMap.retrieve(RunMap.java:59) at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:667) at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:629) at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:368) at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:526) at hudson.model.AbstractProject.getBuildByNumber(AbstractProject.java:1028) at hudson.model.AbstractProject$getBuildByNumber.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at hudson.model.RunMapTest.testRuntimeExceptionInUnmarshalling(RunMapTest.groovy:53) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at junit.framework.TestCase.runTest(TestCase.java:176) at org.jvnet.hudson.test.HudsonTestCase.runTest(HudsonTestCase.java:440) at junit.framework.TestCase.runBare(TestCase.java:141) at org.jvnet.hudson.test.HudsonTestCase.runBare(HudsonTestCase.java:296) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:129) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: com.thoughtworks.xstream.converters.ConversionException: Could not call hudson.model.RunMapTest$BombAction.readResolve() : null : Could not call hudson.model.RunMapTest$BombAction.readResolve() : null ---- Debugging information ---- message : Could not call hudson.model.RunMapTest$BombAction.readResolve() : null cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException cause-message : Could not call hudson.model.RunMapTest$BombAction.readResolve() : null class : hudson.model.RunMapTest$BombAction required-type : hudson.model.RunMapTest$BombAction converter-type : hudson.util.RobustReflectionConverter path : /build/actions/hudson.model.RunMapTest$BombAction line number : 43 class[1] : java.util.concurrent.CopyOnWriteArrayList converter-type[1] : hudson.util.RobustCollectionConverter class[2] : hudson.model.FreeStyleBuild version : null ------------------------------- at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71) at hudson.util.RobustCollectionConverter.populateCollection(RobustCollectionConverter.java:85) at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:61) at hudson.util.RobustCollectionConverter.unmarshal(RobustCollectionConverter.java:76) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:333) at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:275) at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:222) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1061) at hudson.util.XStream2.unmarshal(XStream2.java:109) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1045) at hudson.XmlFile.unmarshal(XmlFile.java:166) ... 48 more Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Could not call hudson.model.RunMapTest$BombAction.readResolve() : null at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadResolve(SerializationMethodInvoker.java:72) at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:223) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) ... 71 more Caused by: java.lang.NullPointerException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:186) at hudson.model.RunMapTest$BombAction.readResolve(RunMapTest.groovy:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadResolve(SerializationMethodInvoker.java:66) ... 73 more So I'm failing to see how this failure to load one record caused the entire job to fail to load. In fact I don't see who printed that exception — anyone catching this exception from RunMap or its caller would see all sorts of chained exceptions like the one I'm providing here, and you wouldn't see the stack trace in a nice single lineage. The only place this could have been done is from inside the envinject plugin itself. If that's the case, there must have been other additional stack traces and error messages that followed, and we need that to be able to get to the bottom of the issue.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java
          test/src/test/groovy/hudson/model/RunMapTest.groovy
          http://jenkins-ci.org/commit/jenkins/c7ad5e97060d71e82073c1ccbf824a21e8998746
          Log:
          JENKINS-15533 testing if the lazy loading can gracefully tolerate a RuntimeException during unmarshalling.

          At least in the current version this working as expected


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java test/src/test/groovy/hudson/model/RunMapTest.groovy http://jenkins-ci.org/commit/jenkins/c7ad5e97060d71e82073c1ccbf824a21e8998746 Log: JENKINS-15533 testing if the lazy loading can gracefully tolerate a RuntimeException during unmarshalling. At least in the current version this working as expected – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          I'm tentatively closing this as INCOMPLETE until additional stack traces and error messages are provided.

          To the extent that's tested on my system, this is a relatively isolated incident with core and envinject.

          Kohsuke Kawaguchi added a comment - I'm tentatively closing this as INCOMPLETE until additional stack traces and error messages are provided. To the extent that's tested on my system, this is a relatively isolated incident with core and envinject.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2367
          JENKINS-15533 testing if the lazy loading can gracefully tolerate a RuntimeException during unmarshalling. (Revision c7ad5e97060d71e82073c1ccbf824a21e8998746)

          Result = UNSTABLE
          kohsuke : c7ad5e97060d71e82073c1ccbf824a21e8998746
          Files :

          • test/src/test/groovy/hudson/model/RunMapTest.groovy
          • core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2367 JENKINS-15533 testing if the lazy loading can gracefully tolerate a RuntimeException during unmarshalling. (Revision c7ad5e97060d71e82073c1ccbf824a21e8998746) Result = UNSTABLE kohsuke : c7ad5e97060d71e82073c1ccbf824a21e8998746 Files : test/src/test/groovy/hudson/model/RunMapTest.groovy core/src/main/java/jenkins/model/lazy/AbstractLazyLoadRunMap.java

            kohsuke Kohsuke Kawaguchi
            brianfreedatwork Brian Freed
            Votes:
            9 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved: