{"record":{"id":"9d42639c7aeb0faf","repo":"jenkinsci/jenkins","slug":"failed-to-install-embedded-lifecycle-implementatio","errorCode":null,"errorMessage":"Failed to install embedded lifecycle implementation, so cannot restart: {t}","messagePattern":"Failed to install embedded lifecycle implementation, so cannot restart: (.+?)","errorType":"exception","errorClass":"RestartNotSupportedException","httpStatus":null,"severity":"warning","filePath":"core/src/main/java/hudson/lifecycle/Lifecycle.java","lineNumber":128,"sourceCode":"                                    \"Default Windows lifecycle does not support restart.\");\n                        }\n                    };\n                } else if (System.getenv(\"SMF_FMRI\") != null && System.getenv(\"SMF_RESTARTER\") != null) {\n                    // when we are run by Solaris SMF, these environment variables are set.\n                    instance = new SolarisSMFLifecycle();\n                } else if (System.getenv(\"NOTIFY_SOCKET\") != null) {\n                    // When we are running under systemd with Type=notify, this environment variable is set.\n                    instance = new SystemdLifecycle();\n                } else {\n                    // if run on Unix, we can do restart\n                    try {\n                        instance = new UnixLifecycle();\n                    } catch (final Throwable t) {\n                        LOGGER.log(Level.WARNING, \"Failed to install embedded lifecycle implementation\", t);\n                        instance = new Lifecycle() {\n                            @Override\n                            public void verifyRestartable() throws RestartNotSupportedException {\n                                throw new RestartNotSupportedException(\n                                        \"Failed to install embedded lifecycle implementation, so cannot restart: \" + t, t);\n                            }\n                        };\n                    }\n                }\n            }\n            assert instance != null;\n            INSTANCE = instance;\n        }\n\n        return INSTANCE;\n    }\n\n    /**\n     * If the location of {@code jenkins.war} is known in this life cycle,\n     * return it location. Otherwise return null to indicate that it is unknown.\n     *\n     * <p>","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/lifecycle/Lifecycle.java#L110-L146","documentation":"Thrown by an anonymous fallback Lifecycle when instantiation of UnixLifecycle failed (caught a Throwable t). The UnixLifecycle constructor typically fails when it cannot locate the jenkins.war or determine the executable path needed for exec-based restart. verifyRestartable() wraps the original cause t into the message, so the root reason is embedded in the string.","triggerScenarios":"Lifecycle.get() attempts new UnixLifecycle() on a non-Windows, non-SMF, non-systemd Unix host; the constructor throws (e.g. cannot resolve the launch command or the war file). The catch(Throwable) block logs a WARNING, installs this anonymous Lifecycle, and any later call to verifyRestartable() throws RestartNotSupportedException with the original cause.","commonSituations":"Running Jenkins from a repackaged/custom war whose path does not match expectations, running inside a minimal container where /proc/self/exe or the classpath war location cannot be resolved, JVM security manager blocking reflection/native calls used by UnixLifecycle.","solutions":["Check the Jenkins log for the WARNING 'Failed to install embedded lifecycle implementation' — the attached Throwable t is the real cause","Ensure the process was launched with a resolvable jenkins.war path (avoid unpacking the war in a temp dir that gets cleaned)","Use an external process manager (systemd, SMF) so Lifecycle picks SystemdLifecycle/SolarisSMFLifecycle instead of UnixLifecycle","If the war location is custom, set the relevant system property or ensure getHudsonWar() can resolve it"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    Lifecycle.get().verifyRestartable();\n} catch (RestartNotSupportedException e) {\n    // the cause (Throwable t) is attached; inspect e.getCause() for the real UnixLifecycle failure\n    LOGGER.log(Level.WARNING, \"Restart unavailable: \" + e.getMessage(), e.getCause());\n}","preventionTips":["Monitor Jenkins logs for the 'Failed to install embedded lifecycle implementation' WARNING at startup","Ensure jenkins.war is launched from a stable, resolvable path","Prefer systemd or SMF on Unix so the robust lifecycle is selected"],"tags":["lifecycle","unix","restart","war-location","fallback"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}