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

Canceling a parent multi-configuration build produce a build.xml that can't be deserialized

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • matrix-project-plugin
    • None
    • Jenkins 1.428

      Here is the traceback when I restart Jenkins:

      hudson.util.IOException2: Unable to read /Users/olivier/.jenkins/jobs/multi/builds/2011-09-06_09-57-54/build.xml
      [...]
      Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot deserialize object with new readObject()/writeObject() methods
      ---- Debugging information ----
      class               : hudson.matrix.MatrixBuild
      required-type       : com.google.common.collect.SingletonImmutableList
      path                : /matrix-build/actions/jenkins.model.InterruptedBuildAction/causes
      line number         : 12
      -------------------------------
      

      And here the section in the XML that seems to be problematic:

      <matrix-build>
        <actions>
          [...]
          <jenkins.model.InterruptedBuildAction>
            <causes class="com.google.common.collect.SingletonImmutableList" resolves-to="com.google.common.collect.ImmutableList$SerializedForm">
              <elements>
                <jenkins.model.CauseOfInterruption_-UserInterruption>
                  <user>admin</user>
                </jenkins.model.CauseOfInterruption_-UserInterruption>
              </elements>
            </causes>
          </jenkins.model.InterruptedBuildAction>
        </actions>
        [...]
      </matrix-build>
      

          [JENKINS-10903] Canceling a parent multi-configuration build produce a build.xml that can't be deserialized

          I am seeing exactly the same problem with the latest git build. Head is commit 15b2a8b6b901734769a28ade1d777cf95c45b1e2

          But I see it going back in my logs as far as 19/August at which time I think I was running 1.426.

          Richard Mortimer added a comment - I am seeing exactly the same problem with the latest git build. Head is commit 15b2a8b6b901734769a28ade1d777cf95c45b1e2 But I see it going back in my logs as far as 19/August at which time I think I was running 1.426.

          I implemented a testcase for this issue to help someone who is able to fix the problem. See
          https://github.com/jenkinsci/jenkins/pull/234

          Richard Mortimer added a comment - I implemented a testcase for this issue to help someone who is able to fix the problem. See https://github.com/jenkinsci/jenkins/pull/234

          I have a fix that I have tested locally. I need to cleanup the code and will issue a full github pull request later today.

          Richard Mortimer added a comment - I have a fix that I have tested locally. I need to cleanup the code and will issue a full github pull request later today.

          Fred G added a comment -

          I have the same problem with Jenkins 1.428 and aborted Freestyle Jobs (Class: hudson.model.FreeStyleBuild).

          Fred G added a comment - I have the same problem with Jenkins 1.428 and aborted Freestyle Jobs (Class: hudson.model.FreeStyleBuild).

          Eyal Edri added a comment -

          i have the same stack trace when using 1.430

          Eyal Edri added a comment - i have the same stack trace when using 1.430

          Code changed in jenkins
          User: Richard Mortimer
          Path:
          core/src/main/java/hudson/util/XStream2.java
          core/src/main/java/hudson/util/xstream/ImmutableListConverter.java
          core/src/test/java/hudson/util/XStream2Test.java
          http://jenkins-ci.org/commit/jenkins/ebee47bb75d2043988b901f552563b1ca2b9d751
          Log:
          JENKINS-10903 Serialize ImmutableList in the same manner as ImmutableMap.
          This is a partial fix for JENKINS-10903. Any new builds will
          be serialized correctly.

          Based on ImmutableMapConverter.java

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: core/src/main/java/hudson/util/XStream2.java core/src/main/java/hudson/util/xstream/ImmutableListConverter.java core/src/test/java/hudson/util/XStream2Test.java http://jenkins-ci.org/commit/jenkins/ebee47bb75d2043988b901f552563b1ca2b9d751 Log: JENKINS-10903 Serialize ImmutableList in the same manner as ImmutableMap. This is a partial fix for JENKINS-10903 . Any new builds will be serialized correctly. Based on ImmutableMapConverter.java

          Code changed in jenkins
          User: Richard Mortimer
          Path:
          changelog.html
          core/src/main/java/hudson/util/xstream/ImmutableListConverter.java
          core/src/test/java/hudson/util/XStream2Test.java
          core/src/test/resources/hudson/util/runMatrix.xml
          http://jenkins-ci.org/commit/jenkins/f356b78ea03309517b112bb46442287f81a4531d
          Log:
          [FIXED JENKINS-10903] Canceling a parent multi-configuration build produce a
          build.xml that can't be deserialized

          Handle resolves-to="com.google.common.collect.ImmutableList$SerializedForm"
          manually and construct a suitable list. Any subsequent serialization of the
          class will use the direct form of serialization.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Richard Mortimer Path: changelog.html core/src/main/java/hudson/util/xstream/ImmutableListConverter.java core/src/test/java/hudson/util/XStream2Test.java core/src/test/resources/hudson/util/runMatrix.xml http://jenkins-ci.org/commit/jenkins/f356b78ea03309517b112bb46442287f81a4531d Log: [FIXED JENKINS-10903] Canceling a parent multi-configuration build produce a build.xml that can't be deserialized Handle resolves-to="com.google.common.collect.ImmutableList$SerializedForm" manually and construct a suitable list. Any subsequent serialization of the class will use the direct form of serialization.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1159
          JENKINS-10903 Serialize ImmutableList in the same manner as ImmutableMap.
          [FIXED JENKINS-10903] Canceling a parent multi-configuration build produce a

          Kohsuke Kawaguchi : ebee47bb75d2043988b901f552563b1ca2b9d751
          Files :

          • core/src/main/java/hudson/util/xstream/ImmutableListConverter.java
          • core/src/test/java/hudson/util/XStream2Test.java
          • core/src/main/java/hudson/util/XStream2.java

          Kohsuke Kawaguchi : f356b78ea03309517b112bb46442287f81a4531d
          Files :

          • changelog.html
          • core/src/test/resources/hudson/util/runMatrix.xml
          • core/src/test/java/hudson/util/XStream2Test.java
          • core/src/main/java/hudson/util/xstream/ImmutableListConverter.java

          dogfood added a comment - Integrated in jenkins_main_trunk #1159 JENKINS-10903 Serialize ImmutableList in the same manner as ImmutableMap. [FIXED JENKINS-10903] Canceling a parent multi-configuration build produce a Kohsuke Kawaguchi : ebee47bb75d2043988b901f552563b1ca2b9d751 Files : core/src/main/java/hudson/util/xstream/ImmutableListConverter.java core/src/test/java/hudson/util/XStream2Test.java core/src/main/java/hudson/util/XStream2.java Kohsuke Kawaguchi : f356b78ea03309517b112bb46442287f81a4531d Files : changelog.html core/src/test/resources/hudson/util/runMatrix.xml core/src/test/java/hudson/util/XStream2Test.java core/src/main/java/hudson/util/xstream/ImmutableListConverter.java

            oldelvet Richard Mortimer
            mansion Olivier Mansion
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: