Jenkins Fixing SCM Sync with Git and Failing with Delete Jobs

https://wiki.jenkins-ci.org/display/JENKINS/SCM+Sync+configuration+plugin

I have encountered this several times where if you try and change a job name along with any configuration for a job Git will get into a bad state and the SCM will start throwing up errors like:

delete Jobs/OLD_JOB_NAME 

The only thing I have found is to fix this is to follow the following steps:

You will have to have admin rights and the ability to restart your jenkins.

  1. recreate the OLD_JOB_NAME
  2. change the system configuration scm sync to none.
  3. restart the jenkins.  via your_jenkins_server/restart
    1. change the system configuration scm sync to git.
  4. Ensure that the configuration is now syncing correctly  and you do not have any more errors.
  5. delete OLD_JOB_NAME again.
  6. If this still does not work you can try downgrading the plugin and repeating the steps again.

Warning:

You may lose all your job configurations after you reenable the SCM sync so you will have to make a small change to each job name such as changing the description by a single letter.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s