Master fails to start after upgrading CloudBees Jenkins Enterprise with the error 'Contains a forbidden character'

Issue

After upgrading CloudBees Jenkins Enterprise (which uses Mesos/Marathon) to version 1.11.23, 1.11.24, or 1.11.25, Masters fail to start up with the error:

Error master.name is invalid because: <div class=error><img src='/cjoc/static/59d37489/images/none.gif' height=16 width=1>Contains a forbidden character. Only digits (0-9), lowercase characters (a-z) and dashes (-) are allowed.</div>

This was caused by a change in the source code of the Master Provisioning plugin, which prevents masters from being created with dots in the master name, but it also causes this failure when you upgrade and already have a Master with dots in the name.

Environment

Resolution

This will be fixed in the January 2020 release of 1.11.26.

Workaround

  1. Locate the backup for the master that fails to start that was taken immediately before the upgrade was started. If you do not have one, take one manually following the steps in Backing up manually.
  2. Create a new master that uses the same Master Docker image version, and all Master provisioning arguments (CPU shares, RAM, JVM arguments, ..) and ensure you use a name that does not have . characters in it.
  3. Install the Recommended plugins during the initial setup wizard.
  4. Create a Restore job on that new master by following Restoring from backup (using a restore job)
  5. Configure that restore job to use a backup from the master that cannot start (the one with the name that has a . in it).
  6. Run that restore job.
  7. Restart the master so the restore takes effect.
  8. If you are using Role Based Access Control, and you have defined RBAC roles and groups at the master level, you will need to migrate those to the new master by accessing the JENKINS_HOME filesystem of the Operations Center, and copy the rbac xml section from the old master’s configuration file at jobs/yourOldMasterName/config.xml to the new master’s configuration file at jobs/yourNewMasterName/config.xml, and then restart the master.
  9. Any jobs that trigger builds on a separate master using the master name would need to be updated, as well as any external scripts that call the Jenkins API or CLI using the master name.

Affected product/plugin versions

Have more questions?

0 Comments

Please sign in to leave a comment.