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

Maven builds fail with "IllegalStateException: cannot change build result while in COMPLETED"

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Component/s: violations-plugin
    • Labels:
      None
    • Environment:
      OS: Windows
    • Similar Issues:

      Description

      Problem here with Jenkins 1.609.1 mit Maven builds and violations are checked (and the violation limits are exceeded).
      Maven integration plugin 2.10
      Violation plugin 0.7.11

      ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com
      java.lang.IllegalStateException: cannot change build result while in COMPLETED
      at hudson.model.Run.setResult(Run.java:462)
      at hudson.plugins.violations.ViolationsReport.setBuildResult(ViolationsReport.java:542)
      at hudson.plugins.violations.hudson.maven.ViolationsMavenReporter.end(ViolationsMavenReporter.java:100)
      at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:104)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:865)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
      at hudson.model.Run.execute(Run.java:1741)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:537)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:374)
      

        Attachments

          Issue Links

            Activity

            Hide
            tomasbjerre Tomas Bjerre added a comment -

            We can easily make the consequence less severe, by catching the IllegalStateException and just log it. Then the violation reports will still be populated. But still, the build result wont be UNSTABLE, but instead SUCCESSFUL.

            https://github.com/jenkinsci/violations-plugin/pull/68

            Show
            tomasbjerre Tomas Bjerre added a comment - We can easily make the consequence less severe, by catching the IllegalStateException and just log it. Then the violation reports will still be populated. But still, the build result wont be UNSTABLE, but instead SUCCESSFUL. https://github.com/jenkinsci/violations-plugin/pull/68
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Tomas Bjerre
            Path:
            .travis.yml
            build.sh
            plugin-test/pom.xml
            plugin-test/src/test/java/hudson/plugins/violations/ConfigurationWebTest.java
            pom.xml
            reset.sh
            src/main/java/hudson/plugins/violations/ViolationsCollector.java
            src/main/java/hudson/plugins/violations/ViolationsReport.java
            src/main/java/hudson/plugins/violations/graph/SeverityTypeDataSet.java
            src/main/java/hudson/plugins/violations/hudson/AbstractViolationsBuildAction.java
            src/main/java/hudson/plugins/violations/hudson/maven/ViolationsMavenReporter.java
            work/jobs/m2-freestyle-build/config.xml
            work/jobs/m2-freestyle-site/config.xml
            work/jobs/m2-freestyle-site/workspace/ear/pom.xml
            work/jobs/m2-freestyle-site/workspace/ejbs/pom.xml
            work/jobs/m2-freestyle-site/workspace/pom.xml
            work/jobs/m2-freestyle-site/workspace/primary-source/pom.xml
            work/jobs/m2-freestyle-site/workspace/projects/logging/.gitignore
            work/jobs/m2-freestyle-site/workspace/servlets/servlet/pom.xml
            work/jobs/m2-freestyle-site/workspace/servlets/servlet/src/main/java/root/project/FooBar.java
            work/jobs/m2-m2-build/config.xml
            work/jobs/m2-m2-build/workspace/servlets/servlet/src/main/java/root/project/FooBar.java
            work/jobs/m2-m2-site/config.xml
            work/jobs/m2-m2-site/workspace/ear/pom.xml
            work/jobs/m2-m2-site/workspace/ejbs/pom.xml
            work/jobs/m2-m2-site/workspace/pom.xml
            work/jobs/m2-m2-site/workspace/primary-source/pom.xml
            work/jobs/m2-m2-site/workspace/servlets/servlet/pom.xml
            http://jenkins-ci.org/commit/violations-plugin/1c991520930ff4edcc83af1260de13d0ae001d74
            Log:
            Avoiding crash when setting Maven2 jobs to unstable in 1.609 #61 JENKINS-28880

            • Avoiding crash when setting Maven2 build to UNSTABLE. By simply catching the IllegalStateException. This is not the final solution. The build will still not be marked as unstable, instead of crashing (FAIL) it will succeed (SUCCESS). Instead of showing no violation results, it will show them.
            • Making the example projects compile
            • Testing example projects in web tests
            • Stepping up Jenkins version to 1.580.3
            • Adding Java 8 to Travis config
            • Using Firefox and Xvfb in Travis CI, HTMLUnit is a bit unpredictable
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tomas Bjerre Path: .travis.yml build.sh plugin-test/pom.xml plugin-test/src/test/java/hudson/plugins/violations/ConfigurationWebTest.java pom.xml reset.sh src/main/java/hudson/plugins/violations/ViolationsCollector.java src/main/java/hudson/plugins/violations/ViolationsReport.java src/main/java/hudson/plugins/violations/graph/SeverityTypeDataSet.java src/main/java/hudson/plugins/violations/hudson/AbstractViolationsBuildAction.java src/main/java/hudson/plugins/violations/hudson/maven/ViolationsMavenReporter.java work/jobs/m2-freestyle-build/config.xml work/jobs/m2-freestyle-site/config.xml work/jobs/m2-freestyle-site/workspace/ear/pom.xml work/jobs/m2-freestyle-site/workspace/ejbs/pom.xml work/jobs/m2-freestyle-site/workspace/pom.xml work/jobs/m2-freestyle-site/workspace/primary-source/pom.xml work/jobs/m2-freestyle-site/workspace/projects/logging/.gitignore work/jobs/m2-freestyle-site/workspace/servlets/servlet/pom.xml work/jobs/m2-freestyle-site/workspace/servlets/servlet/src/main/java/root/project/FooBar.java work/jobs/m2-m2-build/config.xml work/jobs/m2-m2-build/workspace/servlets/servlet/src/main/java/root/project/FooBar.java work/jobs/m2-m2-site/config.xml work/jobs/m2-m2-site/workspace/ear/pom.xml work/jobs/m2-m2-site/workspace/ejbs/pom.xml work/jobs/m2-m2-site/workspace/pom.xml work/jobs/m2-m2-site/workspace/primary-source/pom.xml work/jobs/m2-m2-site/workspace/servlets/servlet/pom.xml http://jenkins-ci.org/commit/violations-plugin/1c991520930ff4edcc83af1260de13d0ae001d74 Log: Avoiding crash when setting Maven2 jobs to unstable in 1.609 #61 JENKINS-28880 Avoiding crash when setting Maven2 build to UNSTABLE. By simply catching the IllegalStateException. This is not the final solution. The build will still not be marked as unstable, instead of crashing (FAIL) it will succeed (SUCCESS). Instead of showing no violation results, it will show them. Making the example projects compile Testing example projects in web tests Stepping up Jenkins version to 1.580.3 Adding Java 8 to Travis config Using Firefox and Xvfb in Travis CI, HTMLUnit is a bit unpredictable
            Hide
            martinro martinro added a comment -

            Updated my installation to Jenkins v2.7.1,
            Maven Integration plugin v2.13,
            Violation plugin v0.7.11

            Jenkins seems still to crash. Build ist marked als FAILED.
            Violations checks not usable.

            ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com
            java.lang.IllegalStateException: cannot change build result while in COMPLETED
            	at hudson.model.Run.setResult(Run.java:459)
            	at hudson.plugins.violations.ViolationsReport.setBuildResult(ViolationsReport.java:542)
            	at hudson.plugins.violations.hudson.maven.ViolationsMavenReporter.end(ViolationsMavenReporter.java:100)
            	at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:104)
            	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:859)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
            	at hudson.model.Run.execute(Run.java:1741)
            	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
            	at hudson.model.ResourceController.execute(ResourceController.java:98)
            	at hudson.model.Executor.run(Executor.java:410)
            project=hudson.maven.MavenModuleSet@23a0e0ff[0000-010 Java DE_Startcenter]
            project.getModules()=[hudson.maven.MavenModule@2ac26c0f[0000-010 Java DE_Startcenter/0000-010:DE_Startcenter][0000-010 Java DE_Startcenter/0000-010:DE_Startcenter][relativePath:]]
            project.getRootModule()=hudson.maven.MavenModule@2ac26c0f[0000-010 Java DE_Startcenter/0000-010:DE_Startcenter][0000-010 Java DE_Startcenter/0000-010:DE_Startcenter][relativePath:]
            FATAL: cannot change build result while in COMPLETED
            java.lang.IllegalStateException: cannot change build result while in COMPLETED
            	at hudson.model.Run.setResult(Run.java:459)
            	at hudson.plugins.violations.ViolationsReport.setBuildResult(ViolationsReport.java:542)
            	at hudson.plugins.violations.hudson.maven.ViolationsMavenReporter.end(ViolationsMavenReporter.java:100)
            	at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:104)
            	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:859)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
            	at hudson.model.Run.execute(Run.java:1741)
            	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
            	at hudson.model.ResourceController.execute(ResourceController.java:98)
            	at hudson.model.Executor.run(Executor.java:410)
            
            Show
            martinro martinro added a comment - Updated my installation to Jenkins v2.7.1, Maven Integration plugin v2.13, Violation plugin v0.7.11 Jenkins seems still to crash. Build ist marked als FAILED. Violations checks not usable. ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com java.lang.IllegalStateException: cannot change build result while in COMPLETED at hudson.model.Run.setResult(Run.java:459) at hudson.plugins.violations.ViolationsReport.setBuildResult(ViolationsReport.java:542) at hudson.plugins.violations.hudson.maven.ViolationsMavenReporter.end(ViolationsMavenReporter.java:100) at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:104) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:859) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1741) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) project=hudson.maven.MavenModuleSet@23a0e0ff[0000-010 Java DE_Startcenter] project.getModules()=[hudson.maven.MavenModule@2ac26c0f[0000-010 Java DE_Startcenter/0000-010:DE_Startcenter][0000-010 Java DE_Startcenter/0000-010:DE_Startcenter][relativePath:]] project.getRootModule()=hudson.maven.MavenModule@2ac26c0f[0000-010 Java DE_Startcenter/0000-010:DE_Startcenter][0000-010 Java DE_Startcenter/0000-010:DE_Startcenter][relativePath:] FATAL: cannot change build result while in COMPLETED java.lang.IllegalStateException: cannot change build result while in COMPLETED at hudson.model.Run.setResult(Run.java:459) at hudson.plugins.violations.ViolationsReport.setBuildResult(ViolationsReport.java:542) at hudson.plugins.violations.hudson.maven.ViolationsMavenReporter.end(ViolationsMavenReporter.java:100) at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:104) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:859) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1741) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410)
            Hide
            tomasbjerre Tomas Bjerre added a comment -

            My opinion is that this plugin should be rewritten. Its just a waste of time to try to fix all the bugs.

            https://github.com/jenkinsci/violations-plugin/issues/88

            Show
            tomasbjerre Tomas Bjerre added a comment - My opinion is that this plugin should be rewritten. Its just a waste of time to try to fix all the bugs. https://github.com/jenkinsci/violations-plugin/issues/88

              People

              • Assignee:
                peterkittreilly peterkittreilly
                Reporter:
                martinro martinro
              • Votes:
                4 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated: