{"record":{"id":"903bf04e16cd539d","repo":"github/copilot-sdk","slug":"unsupported-os-arch-osarch","errorCode":null,"errorMessage":"Unsupported os.arch: + osArch","messagePattern":"Unsupported os\\.arch: \\+ osArch","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"java/sdk/src/main/java/com/github/copilot/ffi/PlatformDetector.java","lineNumber":127,"sourceCode":"        }\n        if (normalized.contains(\"win\")) {\n            return \"win32\";\n        }\n        if (normalized.contains(\"linux\")) {\n            return \"linux\";\n        }\n        throw new IllegalStateException(\"Unsupported os.name: \" + osName);\n    }\n\n    static String detectArch(String osArch) {\n        String normalized = osArch.toLowerCase(Locale.ROOT).replace('-', '_');\n        if (normalized.equals(\"amd64\") || normalized.equals(\"x86_64\") || normalized.equals(\"x64\")) {\n            return \"x64\";\n        }\n        if (normalized.equals(\"aarch64\") || normalized.equals(\"arm64\")) {\n            return \"arm64\";\n        }\n        throw new IllegalStateException(\"Unsupported os.arch: \" + osArch);\n    }\n\n    static LinuxLibc detectLinuxLibc(Path executablePath) {\n        try {\n            return detectLinuxLibc(readPrefix(executablePath, ELF_HEADER_PROBE_BYTES));\n        } catch (IOException ex) {\n            return LinuxLibc.UNKNOWN;\n        }\n    }\n\n    static LinuxLibc detectLinuxLibc(byte[] elfPrefix) throws IOException {\n        String interpreter = readElfPtInterp(elfPrefix);\n        if (interpreter.contains(\"/ld-musl-\")) {\n            return LinuxLibc.MUSL;\n        }\n        if (interpreter.contains(\"/ld-linux-\")) {\n            return LinuxLibc.GLIBC;\n        }","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/java/sdk/src/main/java/com/github/copilot/ffi/PlatformDetector.java#L109-L145","documentation":"PlatformDetector.detectArch maps the os.arch system property to 'x64' or 'arm64' (with '-' normalized to '_'). Any other architecture throws IllegalStateException because the library bundles native runtimes only for these two architectures. Like error 188, the message string contains a literal '+ osArch' typo instead of the interpolated value.","triggerScenarios":"Detection runs on a JVM reporting os.arch other than amd64/x86_64/x64/aarch64/arm64 — e.g. 'i386', 'ppc64le', 's390x', 'riscv64', or a blank/custom value from an embedded JVM.","commonSituations":"Deploying to POWER (ppc64le) or IBM Z (s390x) mainframe Linux; 32-bit x86 JVMs on x86_64 hosts; RISC-V development boards; Docker images using non-amd64/arm64 base images.","solutions":["Run on an x64 or arm64 machine (or container image) — the only architectures with bundled natives.","Use a 64-bit JVM on x86_64 hardware instead of a 32-bit (i386/i686) JVM.","Switch container base images/CI runners to linux/amd64 or linux/arm64 platforms (e.g. docker run --platform linux/amd64).","Request upstream support for additional architectures."],"exampleFix":"// before (docker on s390x mainframe)\nFROM ibmjava:8\n// after\nFROM eclipse-temurin:17 --platform=linux/amd64","handlingStrategy":"validation","validationCode":"// Java: check architecture support before initializing the loader\nString arch = System.getProperty(\"os.arch\", \"\").toLowerCase(Locale.ROOT).replace('-', '_');\nboolean supported = arch.equals(\"amd64\") || arch.equals(\"x86_64\") || arch.equals(\"x64\") || arch.equals(\"aarch64\") || arch.equals(\"arm64\");\nif (!supported) throw new IllegalStateException(\"Unsupported os.arch: \" + arch + \"; x64/arm64 only\");","typeGuard":null,"tryCatchPattern":"try { loader.loadRuntime(); } catch (IllegalStateException e) { if (e.getMessage().startsWith(\"Unsupported os.arch\")) { // fail fast or re-run under an amd64/arm64 environment } else throw e; }","preventionTips":["Restrict CI/deploy matrices to amd64 and arm64 runners","Use 64-bit JVMs on x86_64 hardware","Pin --platform linux/amd64 or linux/arm64 in container images","Filter out ppc64le/s390x/i386 targets from release automation"],"tags":["platform","architecture","java","initialization"],"backgroundTag":"unsupported-platform","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}