Jenkins instance got erased after server reboot

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Jenkins instance got erased after server reboot

Ricky LI
Hey guys, got a very weird case here... My jenkins master instance which was installed on a linux VM on our server got completely erased after a reboot (I ran a reboot command on that server).

When the server restarted, I noticed that my jenkins server url didn't work anymore, so I performed a java -jar jenkins.war to restart jenkins manually, but it actually asked me to enter an admin password to unblock jenkins, as if it was the very first time I installed a jenkins instance, and when i looked at the password, it was a new one, the old one doesn't work anymore.

Now what's even stranger is, after this reboot, I need to keep my ssh connection to the VM active in order to keep jenkins server on, at the moment I terminate my SSH session (closing the remote console), jenkins server is offline too. Before it was not like this, I can access jenkins server url anytime even if there's no remote session with the VM.

Although my entire jenkins server got wipped out, my /var/jenkins/workspace directory is still alive and all data inside is safe and sound.

What happened here? Why a simple VM reboot would wipe out my jenkins instance, and why would I need to keep the SSH remote session open to keep jenkins server online? Anyone experienced similar issue? Anyone knows the reason? I'd like to prevent this from happening again because impacts the workflow and takes time to all configure and debug again...

Thanks and cheers!

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/22e3204b-4ea8-4a76-9342-3f6dade0cf4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins instance got erased after server reboot

Björn Pedersen
Hi,

some simple things to check:

 * do you persist your VM state, or is the VM restarting  from  a clean snapshot?
 * You need to run java -jar...  detached, otherwise  closing the controling console (ssh-connection) will kill it.

Björn

Am Dienstag, 10. Juli 2018 00:58:53 UTC+2 schrieb jack:
Hey guys, got a very weird case here... My jenkins master instance which was installed on a linux VM on our server got completely erased after a reboot (I ran a reboot command on that server).

When the server restarted, I noticed that my jenkins server url didn't work anymore, so I performed a java -jar jenkins.war to restart jenkins manually, but it actually asked me to enter an admin password to unblock jenkins, as if it was the very first time I installed a jenkins instance, and when i looked at the password, it was a new one, the old one doesn't work anymore.

Now what's even stranger is, after this reboot, I need to keep my ssh connection to the VM active in order to keep jenkins server on, at the moment I terminate my SSH session (closing the remote console), jenkins server is offline too. Before it was not like this, I can access jenkins server url anytime even if there's no remote session with the VM.

Although my entire jenkins server got wipped out, my /var/jenkins/workspace directory is still alive and all data inside is safe and sound.

What happened here? Why a simple VM reboot would wipe out my jenkins instance, and why would I need to keep the SSH remote session open to keep jenkins server online? Anyone experienced similar issue? Anyone knows the reason? I'd like to prevent this from happening again because impacts the workflow and takes time to all configure and debug again...

Thanks and cheers!

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/07aba492-b99a-4294-8838-9f20e099ffd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins instance got erased after server reboot

Ricky LI
Thank you very much for your reply Björn.

The VM wasn't restarting from a clean snapshot, a simple reboot ought to preserve all data, as all my jenkins files are still on the server, so does the workspace directory.

Actually we took a closer look and I have found the origin of the error: I rebooted the VM because I attempted to permenantly set new JAVA_HOME globally in /etc/profile and /etc/environment. 

After reboot, these changes took effect and jenkins is offline; when I executed (detached or not) the jenkins.war, it gave me a new blank instance. When we tried to do a systemctl restart jenkins.service, it displays an error, saying that my jdk/jre folder is not safe because it is group and wolrd writable (because I obviously did a chmod 777 :/ ). So I restrainded the permission, jenkins service started again as a deamon by itself and all my jobs and configs are back ;)

Now just got one more question: where is that new blank jenkins instance I strated after the reboot (for which i also donwloaded all recommended plugins) ? I'd like to delete it... lol

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a99a4596-73b2-4672-9995-94b1d5f0dff7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.