• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • core
    • None

      I just upgraded from Jenkins 1.502 to 1.503. "Discard old builds" has been broken.

      When I go to the "Manage Jenkins" page, I see "You have data stored in an older format and/or unreadable data.", and clicking on "Manage" shows "InstantiationError: jenkins.model.BuildDiscarder" for most of my jobs. All my jobs that previously had "discard old builds" specified don’t have it ticked any more.

      I presume this is related to this changelog entry: "Discard old build records" behavior is now pluggable, allowing plugins to define custom logic.

      If I edit a job and tick "Discard Old Builds", previous values are not there, and there's some spurious text on the page "//x", presumably something that was intended to be removed when this was released.

          [JENKINS-16979] "Discard old builds" broken in 1.503

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2321
          [FIXED JENKINS-16979] (Revision a33e147a0d8b48d9da17d8dee6a9debbceab8323)

          Result = UNSTABLE
          kohsuke : a33e147a0d8b48d9da17d8dee6a9debbceab8323
          Files :

          • core/src/main/java/jenkins/model/BuildDiscarder.java
          • changelog.html
          • test/src/test/resources/jenkins/model/BuildDiscarderTest/testCompatibility/jobs/foo/config.xml
          • test/src/test/groovy/jenkins/model/BuildDiscarderTest.groovy
          • test/src/test/resources/jenkins/model/BuildDiscarderTest/testCompatibility/config.xml

          dogfood added a comment - Integrated in jenkins_main_trunk #2321 [FIXED JENKINS-16979] (Revision a33e147a0d8b48d9da17d8dee6a9debbceab8323) Result = UNSTABLE kohsuke : a33e147a0d8b48d9da17d8dee6a9debbceab8323 Files : core/src/main/java/jenkins/model/BuildDiscarder.java changelog.html test/src/test/resources/jenkins/model/BuildDiscarderTest/testCompatibility/jobs/foo/config.xml test/src/test/groovy/jenkins/model/BuildDiscarderTest.groovy test/src/test/resources/jenkins/model/BuildDiscarderTest/testCompatibility/config.xml

          msolnit added a comment -

          If I re-apply the settings in build 1.503, will they work correctly?

          msolnit added a comment - If I re-apply the settings in build 1.503, will they work correctly?

          Linards L added a comment -

          As long as there are no unit-test or test-case, I would say NO. Do not count on that... note that only after creating test for Build queue and the issue of missing build jesse G. found some interesting bugs ... I wonder why this is not tested too ...

          Linards L added a comment - As long as there are no unit-test or test-case, I would say NO. Do not count on that... note that only after creating test for Build queue and the issue of missing build jesse G. found some interesting bugs ... I wonder why this is not tested too ...

          Bruce Edge added a comment -

          Looks like it's broken again in 1.506

          Discard old builds...
          ERROR: Publisher org.jenkinsci.plugins.discardbuild.DiscardBuildPublisher aborted due to exception
          java.lang.UnsupportedOperationException
          at java.util.AbstractList.add(AbstractList.java:148)
          at java.util.AbstractList.add(AbstractList.java:108)
          at org.jenkinsci.plugins.discardbuild.DiscardBuildPublisher.perform(DiscardBuildPublisher.java:148)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:820)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:792)
          at hudson.model.Build$BuildExecution.post2(Build.java:183)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:739)
          at hudson.model.Run.execute(Run.java:1592)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:237)

          Bruce Edge added a comment - Looks like it's broken again in 1.506 Discard old builds... ERROR: Publisher org.jenkinsci.plugins.discardbuild.DiscardBuildPublisher aborted due to exception java.lang.UnsupportedOperationException at java.util.AbstractList.add(AbstractList.java:148) at java.util.AbstractList.add(AbstractList.java:108) at org.jenkinsci.plugins.discardbuild.DiscardBuildPublisher.perform(DiscardBuildPublisher.java:148) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:820) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:792) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:739) at hudson.model.Run.execute(Run.java:1592) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237)

          Bruce Edge added a comment -

          Bruce Edge added a comment - Happens in 1.506 as well. Also reported by http://stackoverflow.com/questions/15268736/error-publisher-org-jenkinsci-plugins-discardbuild-discardbuildpublisher-aborte

          Matthew Webber added a comment - - edited

          It's not broken in 1.506 for me.

          Note that the basic capability to discard old builds is part of Jenkins core, and that was broken in 1.503 and fixed in 1.504. This Jira ticket is about that.

          In addition to the core functionality, there is a "Discard Old Build" plugin. DO you have that installed? Is that where the problem is? If so, you need to open a new ticket.

          Matthew Webber added a comment - - edited It's not broken in 1.506 for me. Note that the basic capability to discard old builds is part of Jenkins core, and that was broken in 1.503 and fixed in 1.504. This Jira ticket is about that. In addition to the core functionality, there is a "Discard Old Build" plugin. DO you have that installed? Is that where the problem is? If so, you need to open a new ticket.

          Jesse Glick added a comment -

          @bedge: right, file a ticket for that plugin if you need to.

          Jesse Glick added a comment - @bedge: right, file a ticket for that plugin if you need to.

          Bruce Edge added a comment -

          Bruce Edge added a comment - Done, thanks. https://issues.jenkins-ci.org/browse/JENKINS-17528

          Code changed in jenkins
          User: Jesse Glick
          Path:
          test/src/test/groovy/jenkins/model/BuildDiscarderTest.groovy
          test/src/test/java/jenkins/model/BuildDiscarderPropertyTest.java
          test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/config.xml
          test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/jobs/foo/config.xml
          test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/config.xml
          test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/jobs/foo/config.xml
          http://jenkins-ci.org/commit/jenkins/2200711bf3dcd96263b3a88001a49f5b7241c264
          Log:
          JENKINS-16979 Migrated test from Groovy to Java for ease of maintenance.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: test/src/test/groovy/jenkins/model/BuildDiscarderTest.groovy test/src/test/java/jenkins/model/BuildDiscarderPropertyTest.java test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/config.xml test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/jobs/foo/config.xml test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/config.xml test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/jobs/foo/config.xml http://jenkins-ci.org/commit/jenkins/2200711bf3dcd96263b3a88001a49f5b7241c264 Log: JENKINS-16979 Migrated test from Groovy to Java for ease of maintenance.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #4367
          JENKINS-16979 Migrated test from Groovy to Java for ease of maintenance. (Revision 2200711bf3dcd96263b3a88001a49f5b7241c264)

          Result = UNSTABLE
          jesse glick : 2200711bf3dcd96263b3a88001a49f5b7241c264
          Files :

          • test/src/test/java/jenkins/model/BuildDiscarderPropertyTest.java
          • test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/jobs/foo/config.xml
          • test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/config.xml
          • test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/config.xml
          • test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/jobs/foo/config.xml
          • test/src/test/groovy/jenkins/model/BuildDiscarderTest.groovy

          dogfood added a comment - Integrated in jenkins_main_trunk #4367 JENKINS-16979 Migrated test from Groovy to Java for ease of maintenance. (Revision 2200711bf3dcd96263b3a88001a49f5b7241c264) Result = UNSTABLE jesse glick : 2200711bf3dcd96263b3a88001a49f5b7241c264 Files : test/src/test/java/jenkins/model/BuildDiscarderPropertyTest.java test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/jobs/foo/config.xml test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/config.xml test/src/test/resources/jenkins/model/BuildDiscarderPropertyTest/logRotatorField/config.xml test/src/test/resources/jenkins/model/BuildDiscarderTest/compatibility/jobs/foo/config.xml test/src/test/groovy/jenkins/model/BuildDiscarderTest.groovy

            kohsuke Kohsuke Kawaguchi
            mwebber Matthew Webber
            Votes:
            12 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: