Jenkins lost the jobs after bulk upgrading the plugins - jenkins

I new this could be an old post, but wanted to understand and fix my issue:
I have a maven job in jenkins which works fine when I build it.
I saw an alert for existing plugins i.e update available, so I selected all plugins and did update; all of a sudden I lost my old projects/jobs in jenkins but the jenkins folder structure is still having the jobs.
Tried:
copy pasting the job folder from my backup-- didn't fix the issue.
installing a new jenkins.war file had showed the project/job in folder structure but not in dashboard
had tried to create new maven project but not getting maven option after clicking on jenkins>>New item>> no maven project here..
Any suggestions please.

Related

Jenkins Deleting Workspace

I have Jenkins pipeline projects, and everything works fine as long as I run the project at least once per month. If I wait more than a month Jenkins will delete the workspace for that pipeline project, causing the project to do a brand new git checkout and compile. This results in a super slow build, since all of the intermediate object files/etc are regenerated from scratch.
I cannot find what setting in Jenkins is causing it to clean up these older workspaces. If I modify the pipeline to check out to a custom directory instead of the workspace directory then it works fine, so it doesn't appear to be the git plugin itself, or anything like that.
'Discard old builds' is disabled in the General settings for these projects.
Can someone point me to the setting that is causing 'older' workspaces to get cleaned up for some reason?

Jenkins Error: org.xmlpull.v1.XmlPullParserException

I have installed successfully Jenkins after the next day, I have tried to reopen by restarting the Service:Jenkins and got this error.
Should I reinstall Jenkins ?
Thank you.
To get rid of the lockout follow these steps to manually change the version, which could just be back to your old working version.
Stop the Jenkins windows service
Rename war directory to war.bak
Rename jenkins.war to jenkins.war.bak
Get a new war file from https://updates.jenkins.io/download/war/
Copy new jenkins.war into jenkins directory
Start Jenkins windows service
Observe creation of war directory which will now contain contents of jenkins.war archive
Navigate to jenkins home page, at which point you will be informed
that Jenkins is preparing your installation
Once complete, test your
existing jobs to verify compatability
Navigate to 'Manage Jenkins'
via the menu and Action any notifications displayed - plugins, data
format conversions etc.
Delete jenkins.war.bak file and war.bak folder
After following those steps you will be able to get back into Jenkins, you might have other version issues with plug-ins but at least you can get back in and not lose everything. Also always put your pipeline scripts in source control and use a back up plug in for Jenkins.

Jenkins Crashes after installing GitHub Plugin

I have a question about updating GitHub plugin.
Everytime I do an update plugin such as GitHub and restart the jenkins, Jenkins start crashing. when I try to access jenkins through URL in my browser, the error page shows up with some exception "class not found jenkins/model jenkins" . and then in order to make jenkins working again , I have to delete the plugin entirely from the plugins directory. I wish someone has an answer for this because I really need to make my github projects available to jenkins for build. Thanks
It is a very usual problem with Jenkins. My workaround was to either update the jenkins (where ever it is installed) and restarting the hudson service.
sometimes even restarting the service works.
often you might need to remove those plugins from within (/var/lib/hudson/plugins/) and restart the service.

jenkins missing jobs after removal of plugins

I have a Jenkins Server (1.510) on Win 2008 with ~100 jobs.
After installing and then uninstalling the CloudBees (Plugin_1, Plugin_2) set of plugins + restart I have the following issues:
half of the Jobs are now missing.
many plugins are not functioning well, for example the green-balls plugin is not working and also the entry to launch the backup plugin is missing
many built in Jenkins buttons such the new "Credentials" is missing from the "Jenkins Configure" Menu.
Looking at the FS, i still see all the jobs.
I already tried :
Using the reload configuration
Reinstalling the plugins
Reinstalling Jenkins with the same version once again
Still the jobs are missing
Any idea how to solve it?
Thanks,
Doron
When job is loaded, many of the related Java classes get instantiated. If instantiation fails, usually because some plugin has been removed and that class is no longer available at all, then the job is hidden.
I suspect you have accidentally removed some other plugin too.
Note: Before actually doing anything, take full backup! Easiest is to backup entire Jenkins folder, where the jobs, configuration etc reside.
Easiest solution might be to just install Jenkins from scratch, install the plugins you do need (see below for troubleshooting if you're missing some), then copy the jobs subfolder to the new Jenkins. It might be best to do any configuration under Manage Jenkins by hand, but you can also just try copying the related XML config files.
If you are missing a plugin and can't figure out which one, you should look at jenkins.out.log and jenkins.err.log log files and search for exceptions happening after Jenkins is started. That may give you a clue on what plugin you are missing.
You can also try editing the job XML files to remove build steps you identified from the exceptions (remember to take backups first!), then restart Jenkins or select Reload configuration from disk from Manage Jenkins page.
If not solved, but you find relevant-looking exceptions or something else interesting, please update the question with details.
After I upgraded Jenkins, one of my jobs disappeared. I found out that although my job directory still existed, the config.xml file inside had somehow gone missing.
I restored this file from a backup, after updating all the plugins that needed updating, and reloaded the configuration, and the job reappeared in Jenkins.

Jenkins - Not Showing Build History

I have a multi-module maven project that I'm building with Jenkins called MyApp. I also have another maven project that depends on MyApp, and this project runs integration tests on MyApp.
In Jenkins, when I view the status of the MyApp project it successfully displays a list of previously run builds and I can click on them to find out more information (and view the console output).
However, the integration test project, while it does build properly, it only displays previously run builds for about 5 minutes, at which point something happens and jenkins completely forgets the build ever ran.
On the filesystem, I am able to cd to:
/usr/share/tomcat6/.jenkins/jobs/My App Integration Test/builds
and ls reveals
me#myserver:/usr/share/tomcat6/.jenkins/jobs/My App Integration Test/builds$ ls
1 2 2013-01-24_16-46-59 2013-01-24_16-51-58 2013-01-24_18-05-09 2013-01-24_18-58-46 3 4
that all my previously run builds are right there, where they should be.
Jenkins has a "discard old builds" feature in its project configuration page, but I obviously have it unchecked.
I'm running jenkins in tomcat6 on Ubuntu.
Help please?
Jenkins has resolved this issue as of 1.505 I recommend everyone upgrade who does not wish to switch from Jenkins back to Hudson.
This can be done through the GUI via Manage Jenkins->Upgrade to Latest (Note for this to work you need to have the appropriate permissions for Jenkins)
More information can be found here For linux users aptitude update or yum update jenkins should also work for you.
I have jenkins running with 1.517, still facing the issue if the number of builds goes more than 65 without discard option. Found that reload configuration bring back the build history.
I've seen this issue and have always been able to resolve it by following these steps:
Going to \\[buildmachine]\C$\Jenkins\jobs\[jobname]
Removing the builds folder.
Removing shortcuts to lastStable and lastSuccessful.
Open file nextBuildNumber and change the number to 1.
Then build new jobs and they no longer disappear.
As mentioned by Dave Bacher, this appears to be a bug in Jenkins. I switched over to Hudson and problem fixed!

Resources