Jenkins master restart loop - broken plugin causes crash
Jenkins master starts and crashes repeatedly within seconds
Focused incident mode — strips away everything but this runbook.
Symptoms
- Jenkins master starts and crashes repeatedly within seconds
- Jenkins log shows 'SEVERE: Failed to initialize Jenkins' or plugin ClassNotFound
- Service keeps restarting: 'jenkins.service: Entered failed state'
When Jenkins enters a restart loop, the fastest path to recovery is to remove the offending plugin from the filesystem. The plugin manager in the UI will not load in this state.
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
Jenkins system log
ssh <JENKINS_HOST> tail -200 /var/log/jenkins/jenkins.logRecently installed/updated plugins
ssh <JENKINS_HOST> ls -lt /var/lib/jenkins/plugins/ | head -10
Diagnostic flow
Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.
Guided decision tree is ready.
Steps with commands, expected output, and pass/fail branches.
Ranked root causes
Evidence checklist
- Crash log shows 'ClassNotFound: org.jenkinsci.plugins.<name>.<class>'
- Plugin was just installed but requires a newer Jenkins core
Confirm before fixing
ssh <JENKINS_HOST> grep -A5 'SEVERE' /var/log/jenkins/jenkins.log | tail -20Read the SEVERE error details
Fix
ssh <JENKINS_HOST> rm -rf /var/lib/jenkins/plugins/<BROKEN_PLUGIN>.jpi && sudo systemctl restart jenkinsRemove the broken plugin and restart Jenkins
Resolution runbook
Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.
ssh <JENKINS_HOST> tail -200 /var/log/jenkins/jenkins.log | grep -E 'SEVERE|Error|ClassNotFound|plugin'Read the crash log
ssh <JENKINS_HOST> ls -lt /var/lib/jenkins/plugins/ | head -10Find the most recently modified plugin
ssh <JENKINS_HOST> rm -rf /var/lib/jenkins/plugins/<BROKEN_PLUGIN>.jpi && sudo systemctl restart jenkinsRemove the broken plugin and restart
ssh <JENKINS_HOST> sudo systemctl status jenkinsVerify Jenkins is running after cleanup
Prevention
- Install plugins one at a time and test before installing more.
- Keep a backup of the plugins/ directory before any plugin installation.
- Use the Jenkins plugin manager CLI to validate dependencies before installing.
- Monitor the Jenkins log for SEVERE entries and alert immediately.
Related runbooks
Same stack, same failure family — worth a skim.
POST to Jenkins API returns 403 with 'No valid crumb was included in the request'
Jenkins agent shows 'Offline' in the node management page
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.