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

Build Publisher cannot load remote instance information at startup

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • build-publisher-plugin
    • None
    • Jenkins 1.429 (and several previous), build-publisher 1.11-SNAPSHOT (current master)

      The current build-publisher throws an error when trying to re-load its configuration during Jenkins start up:

      WARNING: Failed to load /home/hudson/master/hudson.plugins.build_publisher.BuildPublisher.xml
      hudson.util.IOException2: Unable to read /home/hudson/master/hudson.plugins.build_publisher.BuildPublisher.xml
              at hudson.XmlFile.unmarshal(XmlFile.java:160)
              at hudson.model.Descriptor.load(Descriptor.java:753)
              at hudson.plugins.build_publisher.BuildPublisher$BuildPublisherDescriptor.<init>(BuildPublisher.java:118)
              at hudson.plugins.build_publisher.BuildPublisher.<clinit>(BuildPublisher.java:108)
              at sun.misc.Unsafe.ensureClassInitialized(Native Method)
              at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
              at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:140)
              at java.lang.reflect.Field.acquireFieldAccessor(Field.java:936)
              at java.lang.reflect.Field.getFieldAccessor(Field.java:917)
              at java.lang.reflect.Field.get(Field.java:376)
              at net.java.sezpoz.IndexItem.instance(IndexItem.java:185)
              at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:180)
              at hudson.ExtensionFinder._find(ExtensionFinder.java:94)
              at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:281)
              at hudson.ExtensionList.load(ExtensionList.java:258)
              at hudson.ExtensionList.ensureLoaded(ExtensionList.java:229)
              at hudson.ExtensionList.iterator(ExtensionList.java:136)
              at jenkins.model.Jenkins.getDescriptorByType(Jenkins.java:1083)
              at hudson.plugins.copyartifact.BuildSelectorParameter.initAliases(BuildSelectorParameter.java:100)
              at hudson.plugins.copyartifact.CopyArtifactPlugin.postInitialize(CopyArtifactPlugin.java:35)
              at hudson.PluginManager$2$1$2.run(PluginManager.java:301)
              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$5.runTask(Jenkins.java:796)
              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.runWorker(ThreadPoolExecutor.java:1110)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
              at java.lang.Thread.run(Thread.java:636)
      Caused by: com.thoughtworks.xstream.converters.ConversionException: Could not call hudson.plugins.build_publisher.HudsonInstance.readResolve() : null : Could not call hudson.plugins.build_publisher.HudsonInstance.readResolve() : null
      ---- Debugging information ----
      message             : Could not call hudson.plugins.build_publisher.HudsonInstance.readResolve() : null
      cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
      cause-message       : Could not call hudson.plugins.build_publisher.HudsonInstance.readResolve() : null
      class               : hudson.plugins.build_publisher.BuildPublisher$BuildPublisherDescriptor
      required-type       : hudson.plugins.build_publisher.HudsonInstance
      path                : /hudson.plugins.build_publisher.BuildPublisher$BuildPublisherDescriptor/publicInstances/hudson.plugins.build_publisher.HudsonInstance
      line number         : 9
      -------------------------------
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
              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 com.thoughtworks.xstream.converters.collections.ArrayConverter.unmarshal(ArrayConverter.java:55)
              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 hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:290)
              at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:233)
              at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:180)
              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:89)
              at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:912)
              at hudson.XmlFile.unmarshal(XmlFile.java:156)
              ... 28 more
      Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Could not call hudson.plugins.build_publisher.HudsonInstance.readResolve() : null
              at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadResolve(SerializationMethodInvoker.java:50)
              at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:181)
              at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
              ... 50 more
      Caused by: java.lang.NullPointerException
              at hudson.plugins.build_publisher.HudsonInstance.readResolve(HudsonInstance.java:121)
              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:616)
              at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callReadResolve(SerializationMethodInvoker.java:46)
              ... 52 more
      

      The net effect is that the Build Publisher silently "forgets" the remote site configuration every time Jenkins is restarted. This only appears to affect instances that have a remote Jenkins installation configured.

          [JENKINS-11003] Build Publisher cannot load remote instance information at startup

          chris yate added a comment -

          I have this problem too. Exactly the same error messages.

          chris yate added a comment - I have this problem too. Exactly the same error messages.

          chris yate added a comment -

          I've tracked the problem down slightly, to the HudsonInstance.java code:

          // XStream init
          private Object readResolve() {
          initVariables();

          /*** Commenting out the next few lines allows the xml config to load ***/
          // let's wait until Hudson's initialized
          Hudson.getInstance().getJobListeners().add(new ItemListener() {
          @Override
          public void onLoaded()

          { restoreQueue(); initPublisherThread(); }

          });
          /***/

          return this;
          }

          chris yate added a comment - I've tracked the problem down slightly, to the HudsonInstance.java code: // XStream init private Object readResolve() { initVariables(); /*** Commenting out the next few lines allows the xml config to load ***/ // let's wait until Hudson's initialized Hudson.getInstance().getJobListeners().add(new ItemListener() { @Override public void onLoaded() { restoreQueue(); initPublisherThread(); } }); /***/ return this; }

          Code changed in jenkins
          User: Vojtech Juranek
          Path:
          src/main/java/hudson/plugins/build_publisher/HudsonInstance.java
          http://jenkins-ci.org/commit/build-publisher-plugin/659c736c3e88e24d81381dfde2dfd0c04bbe6c74
          Log:
          JENKINS-11003 Fixed NPE

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vojtech Juranek Path: src/main/java/hudson/plugins/build_publisher/HudsonInstance.java http://jenkins-ci.org/commit/build-publisher-plugin/659c736c3e88e24d81381dfde2dfd0c04bbe6c74 Log: JENKINS-11003 Fixed NPE

          dogfood added a comment -

          Integrated in plugins_build-publisher #26
          JENKINS-11003 Fixed NPE

          Vojtech Juranek :
          Files :

          • src/main/java/hudson/plugins/build_publisher/HudsonInstance.java

          dogfood added a comment - Integrated in plugins_build-publisher #26 JENKINS-11003 Fixed NPE Vojtech Juranek : Files : src/main/java/hudson/plugins/build_publisher/HudsonInstance.java

          vjuranek added a comment -

          Should be fixed in 1.11

          vjuranek added a comment - Should be fixed in 1.11

            vjuranek vjuranek
            jsiirola jsiirola
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: