How to fix an instance having an invalid identity.key.enc file?


  • Agent starting log contains this exception:
<===[JENKINS REMOTING CAPACITY]===>channel started
Slave.jar version: 2.53.2
This is a Unix agent
Evacuated stdout
ERROR: Unexpected error in launching a agent. This is probably a bug in Jenkins.
	at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.getPublic(
	at org.jenkinsci.modules.upstart_slave_installer.SlaveInstallerFactoryImpl.createIfApplicable(
	at org.jenkinsci.modules.slave_installer.SlaveInstallerFactory.createIfApplicable(
	at org.jenkinsci.modules.slave_installer.SlaveInstallerFactory.createFor(
	at org.jenkinsci.modules.slave_installer.impl.ComputerListenerImpl.onOnline(
	at hudson.slaves.SlaveComputer.setChannel(
	at hudson.slaves.SlaveComputer.setChannel(


  • CloudBees Jenkins Enterprise
  • SSH Build Agents plugin


This issue can happen when identity.key.enc is corrupted, empty or deleted.

To resolve it, follow this procedure:

  • stop the Jenkins instance
  • on the Jenkins server, remove $JENKINS_HOME/identity.key.enc and $JENKINS_HOME/secrets/org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY files
  • start the Jenkins instance

These files will be recreated automatically upon startup on recent Jenkins version. If it’s not the case, you can force that by running this Groovy script in Script Console:

def keyDecorator = new org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl()

Have more questions?


Please sign in to leave a comment.