{"record":{"id":"d735de01fd7aa4b9","repo":"GoogleContainerTools/jib","slug":"unknown-os-rawosname","errorCode":null,"errorMessage":"Unknown OS: + rawOsName","messagePattern":"Unknown OS: \\+ rawOsName","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"jib-core/src/main/java/com/google/cloud/tools/jib/filesystem/XdgDirectories.java","lineNumber":155,"sourceCode":"      }\n      return localAppData.resolve(windowsSubDirectory);\n\n    } else if (osName.contains(\"mac\") || osName.contains(\"darwin\")) {\n      // Use XDG environment variable if set and not empty.\n      if (xdgHome != null && !xdgHome.trim().isEmpty()) {\n        return Paths.get(xdgHome).resolve(JIB_SUBDIRECTORY_OTHER);\n      }\n\n      // Use '~/Library/...' for macOS.\n      Path macDirectory = Paths.get(userHome, \"Library\", macFolder);\n      if (!Files.exists(macDirectory)) {\n        LOGGER.warning(() -> macDirectory + \" does not exist\");\n        return xdgPath.resolve(JIB_SUBDIRECTORY_OTHER);\n      }\n      return macDirectory.resolve(JIB_SUBDIRECTORY_OTHER);\n    }\n\n    throw new IllegalStateException(\"Unknown OS: \" + rawOsName);\n  }\n\n  private XdgDirectories() {}\n}\n","sourceCodeStart":137,"sourceCodeEnd":160,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-core/src/main/java/com/google/cloud/tools/jib/filesystem/XdgDirectories.java#L137-L160","documentation":"XdgDirectories resolves Jib's cache/config locations per OS using the 'os.name' system property. When the resolved OS name is neither Linux, macOS, nor Windows, it cannot determine a directory and throws this IllegalStateException. The OS is not supported by Jib's XDG directory resolution.","triggerScenarios":"Running Jib on a JVM whose os.name is not recognized (e.g. unusual Linux distro reporting a nonstandard name, Solaris, AIX, FreeBSD, or a JVM with a modified os.name property).","commonSituations":"Building inside unusual containers or CI images with patched JVMs, running on BSD/Solaris, or setting -Dos.name=... to nonstandard values.","solutions":["Use a supported OS (Linux, macOS, Windows) or a standard JVM whose os.name is conventional","Run on a standard Linux base image in containers/CI","Remove any custom -Dos.name JVM flag","As a workaround, pre-create the expected directory or file an issue upstream to support the OS"],"exampleFix":"// before (Dockerfile)\nFROM some-unusual-os\nCMD java ... -Dos.name=WeirdOS\n// after\nFROM eclipse-temurin:17\nCMD java -jar jib-build.jar # standard os.name=Linux","handlingStrategy":"validation","validationCode":"String os = System.getProperty(\"os.name\", \"\").toLowerCase();\nboolean supported = os.contains(\"linux\") || os.contains(\"mac\") || os.contains(\"windows\");\nif (!supported) throw new IllegalStateException(\"Jib XDG directories unsupported on OS: \" + os);","typeGuard":"boolean isJibSupportedOs() { String os = System.getProperty(\"os.name\", \"\").toLowerCase(); return os.contains(\"linux\") || os.contains(\"mac\") || os.contains(\"windows\"); }","tryCatchPattern":"try { jibStep(); } catch (IllegalStateException e) { if (e.getMessage().startsWith(\"Unknown OS\")) { failBuild(\"Run Jib on Linux/macOS/Windows\"); } throw e; }","preventionTips":["Run builds on Linux/macOS/Windows with standard JVM images","Avoid custom -Dos.name JVM flags","In CI, use official base images (eclipse-temurin, etc.)"],"tags":["operating-system","configuration","unsupported-platform","jvm"],"backgroundTag":"unsupported-platform","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}