Copying Jenkins home gives duplicate instance ids

Issue

  • Copying JENKINS_HOME causes duplicate instance ids.
  • Multiple masters same instance id
  • Create/regenerate a new instance id.

Environment

  • CloudBees Jenkins Enterprise
  • CloudBees Jenkins Operations Center
  • Jenkins + Nectar License plugin

Resolution

If you need to duplicate a Jenkins instance by copying the entire JENKINS_HOME it will lead to duplicate instance ids. You can re-create the instance id for the new Jenkins installation by doing the following:

  1. Stopped the Jenkins instance.
  2. cd to $JENKINS_HOME
  3. Delete the current secret.key file: rm secret.key
  4. Delete the license.xml file: rm license.xml
  5. Start Jenkins again.

Going to Manage Jenkins > Manage License (or JENKINS_URL/license) will display a new instance id.

Have more questions? Submit a request

2 Comments

  • 1
    Avatar
    Alexander Ost

    It seems that some additional steps are required when copying a JENKINS_HOME of a 2.7.19.1 CJEE master that's connected to CJOC. I had to force-push a new clienst master connection from cjoc side to get the copy running properly.

    Edited by Alexander Ost
  • 0
    Avatar
    Brian Vandegriend

    I tried these steps with Jenkins 2.7.19 and it doesn't work (I'm not using Operation center). 

    I deleted the secrets.key file along with license.xml. When I restarted the Jenkins service on the test server, I got this fatal error: "An error occurred: Default update site connectivity check failed with fatal error: Cannot check connection status of the update site with ID='cje-offline'." 

     

Please sign in to leave a comment.