title: Jenkins cannot start after disk restored from snapshot
body: <p>This Jenkins installation is running on a GCE since the beginning of 2020, pipelines, plugins and other configurations are working without issue.</p>
  <p>After a day of experimenting with it to introduce some new OS-level additional features that should have taken 5 minutes and ended up taking the whole day, I realized I was hitting a wall and decided to clean the board by deleting the VM and creating a new one using a snapshot taken back in november, last time the VM was properly working without modification. This particular Jenkins installation is used to build staging version of our internal applications so I wasn't that concerned with downtime and such.</p>
  <p>After creating a new VM, same specifications of the previous one, running Debian 10, and assigning the snapshot as source for the disk and went to reload the dashboard and got surprised with this:</p>
  <p><a href="https://i.stack.imgur.com/OHSLU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OHSLU.png" alt="enter image description here" /></a></p>
  <p>Logging in the vm itself I find that everything directory/file wise is there but running <code>sudo systemctl status jenkins</code> returns this:</p>
  <pre><code>● jenkins.service - LSB: Start Jenkins at boot time
     Loaded: loaded (/etc/init.d/jenkins; generated; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2021-01-05 17:54:55 UTC; 5s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 653 ExecStart=/etc/init.d/jenkins start (code=exited, status=7)
      Tasks: 0 (limit: 4915)
     CGroup: /system.slice/jenkins.service
  
  Jan 05 17:52:34 jenkins-1-vm systemd[1]: Starting LSB: Start Jenkins at boot time...
  Jan 05 17:52:40 jenkins-1-vm jenkins[653]: Correct java version found
  Jan 05 17:52:41 jenkins-1-vm su[767]: Successful su for jenkins by root
  Jan 05 17:52:41 jenkins-1-vm su[767]: + ??? root:jenkins
  Jan 05 17:52:41 jenkins-1-vm su[767]: pam_unix(su:session): session opened for user jenkins by (uid=0)
  Jan 05 17:54:55 jenkins-1-vm jenkins[653]: Starting Jenkins Automation Server: jenkins failed!
  Jan 05 17:54:55 jenkins-1-vm systemd[1]: jenkins.service: Control process exited, code=exited status=7
  Jan 05 17:54:55 jenkins-1-vm systemd[1]: Failed to start LSB: Start Jenkins at boot time.
  Jan 05 17:54:55 jenkins-1-vm systemd[1]: jenkins.service: Unit entered failed state.
  Jan 05 17:54:55 jenkins-1-vm systemd[1]: jenkins.service: Failed with result 'exit-code'.
  </code></pre>
  <p>I started searching on google, basically spending the last 2 hours on this, and found nothing relevant apart a lot of articles mentioning using Java8 which cannot be applying to this case as java is there and the log itself says <code>Correct java version found</code>.</p>
  <p>As a last attempt I tried to <code>apt purge jenkins</code> and reinstall it and after that everything works but, of course, everything is also wiped out. So I created another vm and before attempting anything else, decided to ask here for help.</p>
  <p>Is there something in Jenkins that could not being brought over in a snapshot of the disk and cause this terrible <code>Failed to start LSB: Start Jenkins at boot time.</code> message? What can I try to fix this and restore it?</p>
  <p>Adding more information: Trying to launch jenkins via the <code>.war</code> file (<code>java -jar /usr/share/jenkins/jenkins.war</code>) works but start it as if it's a new installation, asking for an admin password and all the rest, ignoring the existing <code>config.xml</code> and all the rest already present in <code>/var/lib/jenkins</code>.</p>