{"record":{"id":"be51b71fcd346e2c","repo":"jenkinsci/jenkins","slug":"restart-is-not-supported-on-platforms-without-libc","errorCode":null,"errorMessage":"Restart is not supported on platforms without libc","messagePattern":"Restart is not supported on platforms without libc","errorType":"exception","errorClass":"RestartNotSupportedException","httpStatus":null,"severity":"warning","filePath":"core/src/main/java/hudson/lifecycle/UnixLifecycle.java","lineNumber":91,"sourceCode":"\n        // close all files upon exec, except stdin, stdout, and stderr\n        int sz = LIBC.getdtablesize();\n        for (int i = 3; i < sz; i++) {\n            int flags = LIBC.fcntl(i, F_GETFD);\n            if (flags < 0) continue;\n            LIBC.fcntl(i, F_SETFD, flags | FD_CLOEXEC);\n        }\n\n        // exec to self\n        String exe = args.getFirst();\n        LIBC.execvp(exe, new StringArray(args.toArray(new String[0])));\n        throw new IOException(\"Failed to exec '\" + exe + \"' \" + LIBC.strerror(Native.getLastError()));\n    }\n\n    @Override\n    public void verifyRestartable() throws RestartNotSupportedException {\n        if (!Functions.isGlibcSupported()) {\n            throw new RestartNotSupportedException(\"Restart is not supported on platforms without libc\");\n        }\n\n        // see http://lists.apple.com/archives/cocoa-dev/2005/Oct/msg00836.html and\n        // http://factor-language.blogspot.com/2007/07/execve-returning-enotsup-on-mac-os-x.html\n        // on Mac, execv fails with ENOTSUP if the caller is multi-threaded, resulting in an error like\n        // the one described in http://www.nabble.com/Restarting-hudson-not-working-on-MacOS--to24641779.html\n        //\n        // according to http://www.mail-archive.com/wine-devel@winehq.org/msg66797.html this now works on Snow Leopard\n        if (Platform.isDarwin() && !Platform.isSnowLeopardOrLater())\n            throw new RestartNotSupportedException(\"Restart is not supported on Mac OS X\");\n    }\n\n    private static final Logger LOGGER = Logger.getLogger(UnixLifecycle.class.getName());\n}\n","sourceCodeStart":73,"sourceCodeEnd":106,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/lifecycle/UnixLifecycle.java#L73-L106","documentation":"Thrown by UnixLifecycle.verifyRestartable() when Functions.isGlibcSupported() returns false. UnixLifecycle depends on the JNA-based LIBC binding (glibc) to perform the exec-based restart; without a usable libc/native binding, it cannot exec. This guards against attempting restart on a platform where the native calls would fail.","triggerScenarios":"On a Unix host, Lifecycle.get() constructs UnixLifecycle; verifyRestartable() checks Functions.isGlibcSupported(). Returns false when JNA is absent, libc cannot be loaded, or the platform is not glibc-based (e.g. musl libc without compatibility, or a stripped JVM/JNA).","commonSituations":"Running Jenkins on Alpine Linux (musl libc) without glibc compatibility installed; JNA jar missing from the classpath/war; a JVM that blocks native library loading via security manager; running on an exotic Unix where glibc symbols are unavailable.","solutions":["If on Alpine/musl, install the glibc compatibility package (e.g. libc6-compat or the Alpine gcompat package)","Ensure the JNA library and its native stub are present and loadable on the classpath","Run on a glibc-based Linux distribution (Debian/Ubuntu/RHEL) for full restart support","If libc cannot be provided, restart Jenkins manually by stopping and starting the process"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!Functions.isGlibcSupported()) {\n    // restart via UnixLifecycle will fail; plan to restart manually or use a process manager\n}","typeGuard":null,"tryCatchPattern":"try {\n    Lifecycle.get().verifyRestartable();\n} catch (RestartNotSupportedException e) {\n    if (e.getMessage().contains(\"without libc\")) {\n        // JNA/glibc not available; restart manually\n    }\n}","preventionTips":["On Alpine/musl, install glibc compatibility packages","Ensure JNA and its native stub are on the classpath","Prefer glibc-based Linux distros for Jenkins controllers needing restart"],"tags":["lifecycle","unix","restart","libc","glibc","jna","native"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}