java.lang.IllegalStateException: /var/lib/jenkins/jobs/Long Run Job/builds/2 already existed; will not overwrite with Long Run Job #2

Jenkins JIRA | Jeff Miller | 9 months ago
  1. 0

    Steps to Reproduce: 1) Create a Freestyle Job. Add a "sleep 120" command to the job. 2) Execute the Freestyle Job twice. One instance will execute, the other instance will be in the queue. 3) While first instance is executing issue "Reload From Disk Command" either via Browser, CLI, or Manage Jenkins Menu 4) Wait till both instances complete execution. 5) Execute the Freestyle Job once more At this point you will receive a Dead Thread, with the following: java.lang.IllegalStateException: /var/lib/jenkins/jobs/Long Run Job/builds/2 already existed; will not overwrite with Long Run Job #2 at hudson.model.RunMap.put(RunMap.java:188) at jenkins.model.lazy.LazyBuildMixIn.newBuild(LazyBuildMixIn.java:176) at hudson.model.AbstractProject.newBuild(AbstractProject.java:1019) at hudson.model.AbstractProject.createExecutable(AbstractProject.java:1210) at hudson.model.AbstractProject.createExecutable(AbstractProject.java:145) at hudson.model.Executor$1.call(Executor.java:364) at hudson.model.Executor$1.call(Executor.java:346) at hudson.model.Queue._withLock(Queue.java:1405) at hudson.model.Queue.withLock(Queue.java:1270) at hudson.model.Executor.run(Executor.java:346) Three instances of the job have been tried to run. The first instance completed successfully, however the second instance, the one that was pending in the queue during the Reload Configuration From Disk, succeeded, however the nextBuildNumber will not be incremented to 3, but will remain 2. When the third instance the one that fails immediately with the above exception, it is trying to use 2 instead of because the nextBuildNumber says 2 is the correct value. Also if at the time of the "Reload Configuration from Disk" is executed, there are X number of copies of the same job in the Queue, pending execution, all of these will properly execute afterward, however, that job will fail X number times after those have completed.

    Jenkins JIRA | 9 months ago | Jeff Miller
    java.lang.IllegalStateException: /var/lib/jenkins/jobs/Long Run Job/builds/2 already existed; will not overwrite with Long Run Job #2
  2. 0

    Steps to Reproduce: 1) Create a Freestyle Job. Add a "sleep 120" command to the job. 2) Execute the Freestyle Job twice. One instance will execute, the other instance will be in the queue. 3) While first instance is executing issue "Reload From Disk Command" either via Browser, CLI, or Manage Jenkins Menu 4) Wait till both instances complete execution. 5) Execute the Freestyle Job once more At this point you will receive a Dead Thread, with the following: java.lang.IllegalStateException: /var/lib/jenkins/jobs/Long Run Job/builds/2 already existed; will not overwrite with Long Run Job #2 at hudson.model.RunMap.put(RunMap.java:188) at jenkins.model.lazy.LazyBuildMixIn.newBuild(LazyBuildMixIn.java:176) at hudson.model.AbstractProject.newBuild(AbstractProject.java:1019) at hudson.model.AbstractProject.createExecutable(AbstractProject.java:1210) at hudson.model.AbstractProject.createExecutable(AbstractProject.java:145) at hudson.model.Executor$1.call(Executor.java:364) at hudson.model.Executor$1.call(Executor.java:346) at hudson.model.Queue._withLock(Queue.java:1405) at hudson.model.Queue.withLock(Queue.java:1270) at hudson.model.Executor.run(Executor.java:346) Three instances of the job have been tried to run. The first instance completed successfully, however the second instance, the one that was pending in the queue during the Reload Configuration From Disk, succeeded, however the nextBuildNumber will not be incremented to 3, but will remain 2. When the third instance the one that fails immediately with the above exception, it is trying to use 2 instead of because the nextBuildNumber says 2 is the correct value. Also if at the time of the "Reload Configuration from Disk" is executed, there are X number of copies of the same job in the Queue, pending execution, all of these will properly execute afterward, however, that job will fail X number times after those have completed.

    Jenkins JIRA | 9 months ago | Jeff Miller
    java.lang.IllegalStateException: /var/lib/jenkins/jobs/Long Run Job/builds/2 already existed; will not overwrite with Long Run Job #2
  3. 0

    [JIRA] [branch-api-plugin] (JENKINS-32179) Branch indexing always attempts to create a new project for conflicting branch names from multiple sources

    Google Groups | 12 months ago | mjdet...@gmail.com (JIRA)
    java.lang.IllegalStateException: /Users/mjdetullio/jenkins/jobs/freestyle-multi/branches/master/builds/1 already existed; will not overwrite with freestyle-multi/master #1
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Jenkins ver. 1.642 This is occuring on freestyle builds that are triggered by a cron expression and an upstream job (promotions plugin). When those triggers both happen close to each other it seams to "kill" the executor due to the IllegalStateExceptionThese are newer builds (#533, #532) but still its trying to run the [JobName]\builds\405 ,which already exists. Normally, it should trigger #533, #532 newer jobs IDs. We are constantly able to reproduce the issue every time a child job is triggered by the parent job using "Trigger call/builds on another projects" feature. Exception: java.lang.IllegalStateException: C:\Program Files (x86)\Jenkins\jobs\[JobName]\builds\405 already existed; will not overwrite with [JobName] #405 at hudson.model.RunMap.put(RunMap.java:188) at jenkins.model.lazy.LazyBuildMixIn.newBuild(LazyBuildMixIn.java:176) at hudson.model.AbstractProject.newBuild(AbstractProject.java:1019) at hudson.model.AbstractProject.createExecutable(AbstractProject.java:1210) at hudson.model.AbstractProject.createExecutable(AbstractProject.java:145) at hudson.model.Executor$1.call(Executor.java:364) at hudson.model.Executor$1.call(Executor.java:346) at hudson.model.Queue._withLock(Queue.java:1405) at hudson.model.Queue.withLock(Queue.java:1270) at hudson.model.Executor.run(Executor.java:346) Jenkins in 1.607 (2015/03/30) - Has changes which removes race condition rendering the list of executors (issue 27564) might be causing this race condition issue. Similar threads: https://issues.jenkins-ci.org/browse/JENKINS-29268 [Configuration race condition] https://issues.jenkins-ci.org/browse/JENKINS-26582 [also has this issue for ver 1.621] Any idea for resolving this issue, we are constantly getting the executer failures states.

    Jenkins JIRA | 12 months ago | Riddhi Sharma
    java.lang.IllegalStateException: C:\Program Files (x86)\Jenkins\jobs\[JobName]\builds\405 already existed; will not overwrite with [JobName] #405
  6. 0

    [JIRA] [core] (JENKINS-34103) jenkins reindex purges build queue

    Google Groups | 8 months ago | ja...@sandlininc.com (JIRA)
    java.lang.IllegalStateException: /<span class="code-keyword" style="color: #000091">var</span>/lib/jenkins/jobs/xxxxxx/builds/112 already existed; will not overwrite with xxxxxxxxx #112

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      /var/lib/jenkins/jobs/Long Run Job/builds/2 already existed; will not overwrite with Long Run Job #2

      at hudson.model.RunMap.put()
    2. Hudson
      RunMap.put
      1. hudson.model.RunMap.put(RunMap.java:188)
      1 frame
    3. jenkins.model.lazy
      LazyBuildMixIn.newBuild
      1. jenkins.model.lazy.LazyBuildMixIn.newBuild(LazyBuildMixIn.java:176)
      1 frame
    4. Hudson
      Executor.run
      1. hudson.model.AbstractProject.newBuild(AbstractProject.java:1019)
      2. hudson.model.AbstractProject.createExecutable(AbstractProject.java:1210)
      3. hudson.model.AbstractProject.createExecutable(AbstractProject.java:145)
      4. hudson.model.Executor$1.call(Executor.java:364)
      5. hudson.model.Executor$1.call(Executor.java:346)
      6. hudson.model.Queue._withLock(Queue.java:1405)
      7. hudson.model.Queue.withLock(Queue.java:1270)
      8. hudson.model.Executor.run(Executor.java:346)
      8 frames