criticalAdvancedSymptom-first#plugin#crash#restart#loop

Jenkins master restart loop - broken plugin causes crash

Jenkins master starts and crashes repeatedly within seconds

Likely source:availabilityconfiguration

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.log
  • Recently 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 -20
READ

Read the SEVERE error details

Fix

ssh <JENKINS_HOST> rm -rf /var/lib/jenkins/plugins/<BROKEN_PLUGIN>.jpi && sudo systemctl restart jenkins
DESTRUCTIVE

Remove 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.

1
ssh <JENKINS_HOST> tail -200 /var/log/jenkins/jenkins.log | grep -E 'SEVERE|Error|ClassNotFound|plugin'
READ

Read the crash log

2
ssh <JENKINS_HOST> ls -lt /var/lib/jenkins/plugins/ | head -10
READ

Find the most recently modified plugin

3
ssh <JENKINS_HOST> rm -rf /var/lib/jenkins/plugins/<BROKEN_PLUGIN>.jpi && sudo systemctl restart jenkins
DESTRUCTIVE

Remove the broken plugin and restart

4
ssh <JENKINS_HOST> sudo systemctl status jenkins
READ

Verify 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.

Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.