jenkinsci/jenkins · warning · RestartRequiredException

This Jenkins lifecycle does not support dynamic loading of p

Error message

This Jenkins lifecycle does not support dynamic loading of plugins. Jenkins needs to be restarted for the update to take effect.

What it means

RestartRequiredException is thrown when Lifecycle.get().supportsDynamicLoad() returns false, meaning the current Jenkins lifecycle (e.g., the default Lifecycle that manages the JVM as a single process) does not support hot-loading plugins. All plugin installation/updates require a Jenkins restart in this mode.

Source

Thrown at core/src/main/java/hudson/PluginManager.java:950

                p = strategy.createPluginWrapper(arc);
                sn = p.getShortName();
            }
            PluginWrapper pw = getPlugin(sn);
            if (pw != null) {
                if (removeExisting) { // try to load disabled plugins
                    for (Iterator<PluginWrapper> i = plugins.iterator(); i.hasNext();) {
                        pw = i.next();
                        if (sn.equals(pw.getShortName())) {
                            i.remove();
                            break;
                        }
                    }
                } else {
                    throw new RestartRequiredException(Messages._PluginManager_PluginIsAlreadyInstalled_RestartRequired(sn));
                }
            }
            if (!Lifecycle.get().supportsDynamicLoad()) {
                throw new RestartRequiredException(Messages._PluginManager_LifecycleDoesNotSupportDynamicLoad_RestartRequired());
            }
            if (p == null) {
                p = strategy.createPluginWrapper(arc);
            }
            if (p.supportsDynamicLoad() == YesNoMaybe.NO)
                throw new RestartRequiredException(Messages._PluginManager_PluginDoesntSupportDynamicLoad_RestartRequired(sn));

            // there's no need to do cyclic dependency check, because we are deploying one at a time,
            // so existing plugins can't be depending on this newly deployed one.

            plugins.add(p);
            if (p.isActive()) {
                activePlugins.add(p);
                ((UberClassLoader) uberClassLoader).clearCacheMisses();
            }

            // TODO antimodular; perhaps should have a PluginListener to complement ExtensionListListener?
            CustomClassFilter.Contributed.load();

View on GitHub (pinned to 2e228ff40b)

Solutions

  1. Install a Lifecycle plugin that supports dynamic loading if hot-deploy is required.
  2. Restart Jenkins after plugin installation instead of attempting dynamic load.
  3. Check Lifecycle.get().supportsDynamicLoad() before attempting dynamic deployment and fall back to restart-based installation.

Example fix

// before
pluginManager.dynamicLoad(arc);

// after — check lifecycle capability first
if (!Lifecycle.get().supportsDynamicLoad()) {
    // schedule a restart-based installation
    updateCenter.getPlugin(sn).deploy(false, correlationId);
} else {
    pluginManager.dynamicLoad(arc);
}
Defensive patterns

Strategy: validation

Validate before calling

if (!Lifecycle.get().supportsDynamicLoad()) {
    // cannot hot-deploy; must restart
    listener.getLogger().println("Dynamic load not supported; schedule restart.");
}

Type guard

public static boolean canDynamicLoad() {
    return Lifecycle.get().supportsDynamicLoad();
}

Try / catch

try {
    pluginManager.dynamicLoad(arc);
} catch (RestartRequiredException e) {
    if (e.getMessage().contains("lifecycle")) {
        // Fall back to restart-based installation
        updateCenter.getPlugin(sn).deploy(false, correlationId);
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling dynamic plugin deployment when the Lifecycle implementation (e.g., the default Lifecycle or a container lifecycle that doesn't support restart) reports supportsDynamicLoad() == false.

Common situations: Running Jenkins in a Docker container or systemd service without a lifecycle plugin that supports dynamic loading; or the Lifecycle is explicitly configured to disallow dynamic load for stability reasons.

Related errors


AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14). Data as JSON: /api/errors/90ddab4c602056a8. Report an issue: GitHub.