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

Retry after restart causes IllegalStateException: ID spotbugs is already used by another action: io.jenkins.plugins.analysis.core.model.ResultAction for SpotBugs

XMLWordPrintable

      With a Jenkinsfile using an idiom retrying a node block after a controller or agent failure,
      and the content of the node block including usage of

      recordIssues(tool: spotBugs(), qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]])

      then the build fails after restart with the following stacktrace

      java.lang.IllegalStateException: ID spotbugs is already used by another action: io.jenkins.plugins.analysis.core.model.ResultAction for SpotBugs
      
      	at io.jenkins.plugins.analysis.core.steps.IssuesPublisher.ensureThatIdIsUnique(IssuesPublisher.java:147)
      	at io.jenkins.plugins.analysis.core.steps.IssuesPublisher.attachAction(IssuesPublisher.java:97)
      	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.publishResult(IssuesRecorder.java:879)
      	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:798)
      	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:760)
      	at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:1176)
      	at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:1131)
      

      The proper behaviour should be to overwrite the existing report with a warning.

            Unassigned Unassigned
            vlatombe Vincent Latombe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: