jenkinsci/jenkins · warning · RestartNotSupportedException
Restart is not supported in this running mode ({getClass().g
Error message
Restart is not supported in this running mode ({getClass().getName()}). What it means
Thrown by the default Lifecycle.verifyRestartable() when the restart() method has NOT been overridden by the concrete Lifecycle subclass. It uses Util.isOverridden to check whether the subclass provides a real restart implementation; if not, restart is unsupported in that running mode. The message includes the actual class name so the operator knows which Lifecycle is active.
Source
Thrown at core/src/main/java/hudson/lifecycle/Lifecycle.java:227
* case this method will successfully return.)
*
* <p>
* Throw an exception if the operation fails unexpectedly.
*/
public void restart() throws IOException, InterruptedException {
throw new UnsupportedOperationException();
}
/**
* Can the {@link #restart()} method restart Hudson?
*
* @throws RestartNotSupportedException
* If the restart is not supported, throw this exception and explain the cause.
*/
public void verifyRestartable() throws RestartNotSupportedException {
// the rewriteHudsonWar method isn't overridden.
if (!Util.isOverridden(Lifecycle.class, getClass(), "restart"))
throw new RestartNotSupportedException("Restart is not supported in this running mode (" +
getClass().getName() + ").");
}
/**
* The same as {@link #verifyRestartable()} except the status is indicated by the return value,
* not by an exception.
*/
public boolean canRestart() {
try {
verifyRestartable();
return true;
} catch (RestartNotSupportedException e) {
return false;
}
}
/**
* Called when Jenkins startup is finished or when Jenkins has finished reloading itsView on GitHub (pinned to 2e228ff40b)
Solutions
- If you wrote a custom Lifecycle, override the restart() method to provide a real restart implementation
- Before calling restart, check Lifecycle.get().canRestart() and present a graceful 'not supported' message to users
- Use a supported lifecycle (Windows service, systemd, SMF) so restart() is overridden
- Catch RestartNotSupportedException at the UI/CLI layer and inform the user instead of failing
Example fix
// before
Lifecycle.get().restart();
// after
Lifecycle lc = Lifecycle.get();
if (!lc.canRestart()) {
throw new IllegalStateException("Restart unsupported with lifecycle " + lc.getClass().getName());
}
lc.restart(); Defensive patterns
Strategy: validation
Validate before calling
if (!Lifecycle.get().canRestart()) {
// do not offer restart; show 'unsupported' message
return;
} Try / catch
try {
Lifecycle.get().verifyRestartable();
} catch (RestartNotSupportedException e) {
// inform user that restart is not supported for lifecycle: included in message
} Prevention
- If implementing a custom Lifecycle, override restart() to enable restart
- Gate all restart-triggering UI/CLI behind canRestart() checks
- Use a supported lifecycle implementation (WindowsService, Systemd, SMF, Unix)
When it happens
Trigger: verifyRestartable() is called on a Lifecycle subclass that does not override restart() — e.g. the default no-op Lifecycle, or a custom Lifecycle that only overrides rewriteHudsonWar but not restart. Triggered by the Restart button, CLI restart command, or any plugin calling Lifecycle.get().verifyRestartable().
Common situations: A custom Lifecycle implementation that forgot to override restart(); running in an embedded/test mode where the default Lifecycle is installed; a plugin or core path that calls restart without first checking canRestart().
Related errors
- Default Windows lifecycle does not support restart.
- Failed to install embedded lifecycle implementation, so cann
- jenkins.war location is not known.
- Failed to exec '{exe}' {LIBC.strerror(Native.getLastError())
- Restart is not supported on platforms without libc
AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14).
Data as JSON: /api/errors/e04111ad06070f3c.
Report an issue: GitHub.