Jenkins Job disappeared after restart

jenkins

Solution

After Jenkins restarts, there is the case when some jobs are missing if the syntax in their config.xml contains errors.

- Check Jenkins logs for errors (Manage Jenkins/System Log)

- Fix the errors in config.xml of each job. ( path: JENKINS_HOME/jobs//config.xml)

- Restart jenkins or choose option reload configurations from disk (Manage Jenkins/Reload Configuration from Disk).

When all errors are fixed the job should appear. You can validate your configurations against some online tool, f.e.: https://www.xmlvalidation.com/

Another case is when all Jenkins jobs are missing and an empty dashboard is loaded. This indicates that Jenkins home directory is wrong, so make sure to specify JENKINS_HOME correctly and restart Jenkins.

Problem

I have this strange problem in Jenkins 1.5.31 . I had configured Maven jobs which I still see in Jenkins_Home directory. My Jenkins Windows service was not getting started even though I could still access the Jenkins on default port 8080. When I found in event viewer found that service is trying for 8080 which it found to be in use, so I did taskkilPID using the 8080 port process and it successfully restarted the Windows Jenkins service. However, when I opened the Jenkins URL, I saw only two of my jobs were there and rest disappeared. Has any one faced this issue? I checked plugins and found that Maven project plugin installed is 1.5.3.1 and 2.1 is available but it has message `-Warning: This plugin is built for Jenkins 1.538 or newer. It may or may not work in your Jenkins`. I don't see those jobs in `config.xml` and nor in its old copy backup.

Original source