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

MultiJob has a forbidden nested reference to a model object

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • multijob-plugin
    • None
    • multijob:1.28
      core:2.89.3

      When running a simple, the Jenkins logs show the following WARNINGS:

      Feb 02, 2018 9:47:26 AM hudson.XmlFile replaceIfNotAtTopLevel
      WARNING: JENKINS-45892: reference to job1 #2 being saved from unexpected /tmp/Jenkins/jobs/testSimpleMutliJob/builds/2/build.xml
      java.lang.IllegalStateException
      	at hudson.XmlFile.replaceIfNotAtTopLevel(XmlFile.java:210)
      	at hudson.model.Run.writeReplace(Run.java:1929)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callWriteReplace(SerializationMethodInvoker.java:89)
      	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:141)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
      	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
      	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
      	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
      	at com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
      	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
      	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      	at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
      	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
      	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
      	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
      	at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
      	at hudson.XmlFile.write(XmlFile.java:181)
      	at hudson.model.Run.save(Run.java:1920)
      	at hudson.model.Run.execute(Run.java:1781)
      	at com.tikal.jenkins.plugins.multijob.MultiJobBuild.run(MultiJobBuild.java:73)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:421)
      

      How to Reproduce

      • Create a simple job that does nothing
      • Create a simple MultiJob project with one phase, which contains the reference to the job, see multijob-config.png
      • Build the MultiJob

      You will see the stacktrace appearing several times (3 times), see logs-after-build.log

      Impact

      This is critical as when many jobs run at the same time, it is polluting at such extent that it slow down the Jenkins server and make it unresponsive.

          [JENKINS-49328] MultiJob has a forbidden nested reference to a model object

          Allan BURDAJEWICZ created issue -
          Allan BURDAJEWICZ made changes -
          Assignee New: Allan BURDAJEWICZ [ allan_burdajewicz ]
          Allan BURDAJEWICZ made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Allan BURDAJEWICZ made changes -
          Remote Link New: This issue links to "PR#128 (Web Link)" [ 20005 ]
          Allan BURDAJEWICZ made changes -
          Summary Original: MultiJob has a forbidden nest reference reference to a model object New: MultiJob has a forbidden nested reference reference to a model object
          Allan BURDAJEWICZ made changes -
          Summary Original: MultiJob has a forbidden nested reference reference to a model object New: MultiJob has a forbidden nested reference to a model object
          Allan BURDAJEWICZ made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Allan BURDAJEWICZ made changes -
          Link New: This issue relates to JENKINS-48685 [ JENKINS-48685 ]
          Allan BURDAJEWICZ made changes -
          Link New: This issue relates to JENKINS-45892 [ JENKINS-45892 ]
          Jesse Glick made changes -
          Link New: This issue blocks JENKINS-30906 [ JENKINS-30906 ]
          Jesse Glick made changes -
          Assignee Original: Allan BURDAJEWICZ [ allan_burdajewicz ] New: Jesse Glick [ jglick ]

            jglick Jesse Glick
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: