java.lang.IllegalStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • cc [~jglick] If you have multiple {{SCMSource}} s on a multibranch project, for example two Git repos that both have a "master" branch (or any branch name for that matter), and one source does not exclude the conflict, then the {{MultiBranchProject}} attempts to create the branch again for each source. Because the project for that branch already exists and has built, you end up with a bunch of dead executors because builds for these new projects get triggered. {noformat} Started Setting origin to /foo/bar/project1.git Fetching origin... Pruning stale remotes... Getting remote branches... Checking branch stable Checking branch feat/tracking-data Checking branch master Scheduling build for branch: master Checking branch development Scheduling build for branch: development Checking branch feat/test Done. Setting origin to /foo/bar/project2.git Fetching origin... Pruning stale remotes... Getting remote branches... Checking branch master Scheduling build for branch: master Checking branch development Scheduling build for branch: development Done. Finished: SUCCESS {noformat} {noformat} Thread has died java.lang.IllegalStateException: /Users/mjdetullio/jenkins/jobs/freestyle-multi/branches/master/builds/1 already existed; will not overwrite with freestyle-multi/master #1 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) {noformat} The obvious solution is to make sure your includes/excludes are properly defined. However, if users do not have a clearly defined naming convention and wish to pull from multiple {{SCMSource}} s, then there is nothing to prevent them from entering an erroneous state where multiple projects for a branch exist in memory trying to share the same config location on the filesystem. This in itself is a problem that is easily encountered, even if the use case of having two jobs for a branch with the same name is not supported.
    via by Matthew DeTullio,
  • cc [~jglick] If you have multiple {{SCMSource}} s on a multibranch project, for example two Git repos that both have a "master" branch (or any branch name for that matter), and one source does not exclude the conflict, then the {{MultiBranchProject}} attempts to create the branch again for each source. Because the project for that branch already exists and has built, you end up with a bunch of dead executors because builds for these new projects get triggered. {noformat} Started Setting origin to /foo/bar/project1.git Fetching origin... Pruning stale remotes... Getting remote branches... Checking branch stable Checking branch feat/tracking-data Checking branch master Scheduling build for branch: master Checking branch development Scheduling build for branch: development Checking branch feat/test Done. Setting origin to /foo/bar/project2.git Fetching origin... Pruning stale remotes... Getting remote branches... Checking branch master Scheduling build for branch: master Checking branch development Scheduling build for branch: development Done. Finished: SUCCESS {noformat} {noformat} Thread has died java.lang.IllegalStateException: /Users/mjdetullio/jenkins/jobs/freestyle-multi/branches/master/builds/1 already existed; will not overwrite with freestyle-multi/master #1 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) {noformat} The obvious solution is to make sure your includes/excludes are properly defined. However, if users do not have a clearly defined naming convention and wish to pull from multiple {{SCMSource}} s, then there is nothing to prevent them from entering an erroneous state where multiple projects for a branch exist in memory trying to share the same config location on the filesystem. This in itself is a problem that is easily encountered, even if the use case of having two jobs for a branch with the same name is not supported.
    via by Matthew DeTullio,
  • 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.
    via by Riddhi Sharma,
  • [JIRA] [core] (JENKINS-34103) jenkins reindex purges build queue
    via by ja...@sandlininc.com (JIRA),
  • We have recently upgraded jenkins from version 1.580.3 to 1.642.3, after upgradation sometimes one of jenkins slave shows *dead* executor error. Log :- Slave executor log :- java.lang.IllegalStateException: /d0/jenkins/jobs/QA_bifrost_kafka_Dev_KAFKA-50/builds/32 already existed; will not overwrite with QA_bifrost_kafka_Dev_KAFKA-50 #32 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 log :- Mar 21, 2016 12:56:49 PM SEVERE hudson.remoting.SynchronousCommandTransport$ReaderThread run I/O error in channel RMT-Test-Slave-3-build2003 java.io.IOException: Unexpected termination of the channel at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50) Caused by: java.io.EOFException at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2335) at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2804) at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:802) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299) at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48) at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34) at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)
    via by ayush sahu,
  • 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.
    via by Jeff Miller,
  • We have been getting this error for the past day or so. Per instructions at https://wiki.jenkins-ci.org/display/JENKINS/Dead+Executor, am filing a JIRA bug. May 04, 2016 11:49:24 AM hudson.WebAppMain$3 run INFO: Jenkins is fully up and running May 04, 2016 11:49:33 AM javax.jmdns.impl.DNSStatefulObject$DefaultImplementation waitForAnnounced WARNING: Wait for announced timed out: DNS: JSERVER07.local. state: announcing 1 task: Announcer(JSERVER07.local.) state: announcing 1 May 04, 2016 11:49:39 AM javax.jmdns.impl.DNSStatefulObject$DefaultImplementation waitForAnnounced WARNING: Wait for announced timed out: DNS: JSERVER07.local. state: probing 1 task: Prober(JSERVER07.local.) state: probing 1 May 04, 2016 11:49:45 AM javax.jmdns.impl.DNSStatefulObject$DefaultImplementation waitForAnnounced WARNING: Wait for announced timed out: DNS: JSERVER07.local. state: probing 1 task: Prober(JSERVER07.local.) state: probing 1 May 04, 2016 11:51:07 AM hudson.model.Executor run SEVERE: Unexpected executor death java.lang.IllegalStateException: /var/lib/jenkins/builds/my_project/2 already existed; will not overwrite with my_project #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)
    via by M Chon,
  • 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.
    via by Riddhi Sharma,
    • java.lang.IllegalStateException: /Users/mjdetullio/jenkins/jobs/freestyle-multi/branches/master/builds/1 already existed; will not overwrite with freestyle-multi/master #1 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)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,