{"record":{"id":"90ddab4c602056a8","repo":"jenkinsci/jenkins","slug":"this-jenkins-lifecycle-does-not-support-dynamic-lo","errorCode":null,"errorMessage":"This Jenkins lifecycle does not support dynamic loading of plugins. Jenkins needs to be restarted for the update to take effect.","messagePattern":"This Jenkins lifecycle does not support dynamic loading of plugins\\. Jenkins needs to be restarted for the update to take effect\\.","errorType":"exception","errorClass":"RestartRequiredException","httpStatus":null,"severity":"warning","filePath":"core/src/main/java/hudson/PluginManager.java","lineNumber":950,"sourceCode":"                p = strategy.createPluginWrapper(arc);\n                sn = p.getShortName();\n            }\n            PluginWrapper pw = getPlugin(sn);\n            if (pw != null) {\n                if (removeExisting) { // try to load disabled plugins\n                    for (Iterator<PluginWrapper> i = plugins.iterator(); i.hasNext();) {\n                        pw = i.next();\n                        if (sn.equals(pw.getShortName())) {\n                            i.remove();\n                            break;\n                        }\n                    }\n                } else {\n                    throw new RestartRequiredException(Messages._PluginManager_PluginIsAlreadyInstalled_RestartRequired(sn));\n                }\n            }\n            if (!Lifecycle.get().supportsDynamicLoad()) {\n                throw new RestartRequiredException(Messages._PluginManager_LifecycleDoesNotSupportDynamicLoad_RestartRequired());\n            }\n            if (p == null) {\n                p = strategy.createPluginWrapper(arc);\n            }\n            if (p.supportsDynamicLoad() == YesNoMaybe.NO)\n                throw new RestartRequiredException(Messages._PluginManager_PluginDoesntSupportDynamicLoad_RestartRequired(sn));\n\n            // there's no need to do cyclic dependency check, because we are deploying one at a time,\n            // so existing plugins can't be depending on this newly deployed one.\n\n            plugins.add(p);\n            if (p.isActive()) {\n                activePlugins.add(p);\n                ((UberClassLoader) uberClassLoader).clearCacheMisses();\n            }\n\n            // TODO antimodular; perhaps should have a PluginListener to complement ExtensionListListener?\n            CustomClassFilter.Contributed.load();","sourceCodeStart":932,"sourceCodeEnd":968,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/PluginManager.java#L932-L968","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install a Lifecycle plugin that supports dynamic loading if hot-deploy is required.","Restart Jenkins after plugin installation instead of attempting dynamic load.","Check Lifecycle.get().supportsDynamicLoad() before attempting dynamic deployment and fall back to restart-based installation."],"exampleFix":"// before\npluginManager.dynamicLoad(arc);\n\n// after — check lifecycle capability first\nif (!Lifecycle.get().supportsDynamicLoad()) {\n    // schedule a restart-based installation\n    updateCenter.getPlugin(sn).deploy(false, correlationId);\n} else {\n    pluginManager.dynamicLoad(arc);\n}","handlingStrategy":"validation","validationCode":"if (!Lifecycle.get().supportsDynamicLoad()) {\n    // cannot hot-deploy; must restart\n    listener.getLogger().println(\"Dynamic load not supported; schedule restart.\");\n}","typeGuard":"public static boolean canDynamicLoad() {\n    return Lifecycle.get().supportsDynamicLoad();\n}","tryCatchPattern":"try {\n    pluginManager.dynamicLoad(arc);\n} catch (RestartRequiredException e) {\n    if (e.getMessage().contains(\"lifecycle\")) {\n        // Fall back to restart-based installation\n        updateCenter.getPlugin(sn).deploy(false, correlationId);\n    } else {\n        throw e;\n    }\n}","preventionTips":["Check Lifecycle.get().supportsDynamicLoad() before attempting dynamic deploy.","Install a lifecycle plugin that supports dynamic loading if hot-deploy is a requirement."],"tags":["plugin-manager","lifecycle","restart-required","dynamic-load"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}