Reputation: 11
I deleted "config.xml"
file in the Jenkins source folder when Jenkins was running.
When I restarted Jenkins service, it gives Error:
Cannot read config.xml
The config files for all the jobs running are there.
Is there any way through which I can start Jenkins and configure it again ?
Upvotes: 1
Views: 3032
Reputation: 11
Jenkins keeps a history of the configuration, so you should be able to recover your deleted file from /var/lib/jenkins/config-history/[backup date folder]
Upvotes: 1
Reputation: 866
All you need is to create a config.xml in JENKINS_HOME directory with below 3 elements in it:
I have tested this in my Jenkins instance.
<?xml version='1.0' encoding='UTF-8' ?>
<hudson>
<version>1.581</version>
<workspaceDir>${JENKINS_HOME}/workspace/${ITEM_FULLNAME}</workspaceDir>
<buildsDir>${ITEM_ROOTDIR}/builds</buildsDir>
</hudson>
Upvotes: 4