Error - Jenkins detected running multiple instances
Asked Answered
I

5

10

I am running Jenkins as windows service. It was all good, suddenly from today noon I started seeing the following error while opening it.

Jenkins detected that you appear to be running more than one instance of Jenkins that share the same home directory '’. This greatly confuses Jenkins and you will likely experience strange behaviors, so please correct the situation.

This Jenkins: 17485453 contextPath="" at 1264@< MachineName >
Other Jenkins: 15621395 contextPath="" at 13424@< MachineName >

How this occurs? Any help to solve this?

Any help is appreciated !!

Istria answered 31/1, 2014 at 13:10 Comment(0)
T
18

Stop your Jenkins service. Then use the Windows task manager or better the Sysinternals Process Explorer to kill all Jenkins processes. The numbers at the beginning of "1264@< MachineName >" and "13424@< MachineName >" indicate the id of the processes you need to kill. After that you should be able to start the Jenkins service again.

Thomasinathomasine answered 31/1, 2014 at 13:51 Comment(4)
I had a similar issue on Ubuntu where I needed to kill another instance that was running after service jenkins stop didn't stop both instance.Cusp
On unix-like systems you can just kill it using kill -s 9 <pid>, where the pid is provided by the error message from jenkins (second number).Callender
I had a jenkin server running on the docker container. Got stop and though only single container was started back again, had this issue so as mentioned above checked with ps command and was showing 2 and removed the older oneSeitz
I have both instances with same ID, what should I do in that case? his Jenkins: 921747266 contextPath="" at 6@113c7f12acea Other Jenkins: 921747266 contextPath="" at 6@113c7f12acea Note that i hosted it on docker.Carricarriage
B
3

MacOS Solution for others directed to this question not on Windows:

Here is the error message I saw when I ran into this issue on MacOS: enter image description here

Here are the specs for that machine (if relevant): enter image description here

Despite the scary error message I was actually able to ignore this warning and use Jenkins for a month without noticing any catastrophes, but I'm sure mileage may vary.

I do not know what caused this condition initially.

Note: a search for "Jenkins" in the Activity Monitor reveals nothing, enter image description here

Using top is not that useful either. No Jenkins here… I do see a random Java process, which could be related, but we can’t be sure yet, enter image description here

Changing the search in the Activity Monitor to "Java" gives me what I want enter image description here

On the right side you can see my two Java processes, on the left side you can see that their PIDs match exactly the ones mentioned in the error message shown in the browser. A very nice indicator that we are not chasing some stray Java process. I especially don't want to kill a Java process that I don't know what it is doing.

I click the "Ignore this problem and keep using Jenkings anyway" button in the Browser to go to Jenkins GUI that I normally use.

I start using Jenkins, I actually start a build, so I can see which instance actually gets used. Logically, it’s CPU usage should go up in the Activity Monitor enter image description here

Cool. So I’m gonna keep the top one and trash the bottom one not being used. You can see that the top one is now using 0.2 or 20% of the available CPU.

Problem solved. As far as figuring out how both of them got spun up, that’s another issue. It’s probably related to how you installed and configured it, if you installed it twice, etc.

Bolyard answered 12/12, 2020 at 18:19 Comment(0)
V
0

I had the same errors as the OP and I used Process Explorer as recommended above by Fabian to find two java.exe processes that were related to Jenkins. I killed both java processes using PE, restarted the Jenkins service and Jenkins now operates normally without error.

Vehicle answered 13/4, 2015 at 20:59 Comment(0)
B
0

Alternatively use the Tomcat Manager Gui (http://:8080/manager/html) to stop/undeploy the duplicate process. Username and password is in tomcat/conf/tomcat-users.xml
if not add " password="" roles="manager-gui"/>

to the node.

Barter answered 5/7, 2017 at 15:26 Comment(0)
C
0

Also, look at the details in the error message. I mean this part:

This Jenkins: 1234567890 contextPath="" at 12345@<MachineName>
Other Jenkins: 0978654321 contextPath="" at 54321@<MachineName>

Now the numbers between "at" and "@" are process IDs meant to help identifying the processes involved.

There are cases when those IDs and also the numbers before "contextPath" are the same. Read: "This Jenkins" and "Other Jenkins" is the same process.

This particular case is a known Jenkins bug, see here: https://issues.jenkins.io/browse/JENKINS-61792

Cohby answered 1/9, 2021 at 7:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.