{"record":{"id":"9316a2c49cddf3f3","repo":"github/copilot-sdk","slug":"invalid-runtime-asset-mode-in","errorCode":null,"errorMessage":"Invalid runtime asset mode in ","messagePattern":"Invalid runtime asset mode in ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"java/sdk/src/main/java/com/github/copilot/ffi/NativeRuntimeLoader.java","lineNumber":489,"sourceCode":"                String resourcePath = \"native/\" + classifier + \"/\" + fields[1];\n                URL resource = loader.getResource(resourcePath);\n                if (resource == null) {\n                    throw new FileNotFoundException(\"Runtime asset not found on classpath: \" + resourcePath);\n                }\n                Files.createDirectories(cached.getParent());\n                Path temp = Files.createTempFile(cached.getParent(), \"runtime-asset-tmp-\", \"\");\n                try {\n                    copyResourceToTemp(resource, resourcePath, temp);\n                    if (executable) {\n                        makeExecutable(temp);\n                    }\n                    publisher.publish(temp, cached);\n                } finally {\n                    tryDelete(temp);\n                }\n            }\n        } catch (NumberFormatException ex) {\n            throw new IOException(\"Invalid runtime asset mode in \" + inventoryResourcePath, ex);\n        }\n    }\n\n    /**\n     * Extracts the copilot CLI executable from the classpath to the same cache\n     * directory as {@code runtime.node}. Idempotent — skips extraction if already\n     * present and valid.\n     */\n    static void extractCliToCache(Path cacheDir, ClassLoader loader, String classifier, AtomicPublisher publisher)\n            throws IOException {\n        String cliName = isWindows() ? CLI_FILENAME_WINDOWS : CLI_FILENAME;\n        String cliResourcePath = \"native/\" + classifier + \"/\" + cliName;\n        Path cachedCli = cacheDir.resolve(cliName);\n\n        if (isValidCachedCli(cachedCli)) {\n            return;\n        }\n","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/java/sdk/src/main/java/com/github/copilot/ffi/NativeRuntimeLoader.java#L471-L507","documentation":"Inventory lines encode the asset's file mode as an octal integer parsed with Integer.parseInt(fields[0], 8). If that field is not a valid octal number (e.g. '9xx', letters, empty), a NumberFormatException is caught and rethrown as this IOException naming the inventory resource. It signals a malformed or corrupted inventory file, not a problem with the local environment.","triggerScenarios":"An inventory line whose mode field cannot be parsed in base 8 — e.g. '999 file', '0x1ed file', 'rwx file', or an empty mode field.","commonSituations":"Hand-edited or tool-generated inventory using decimal or symbolic ('rwxr-xr-x') modes instead of octal; corrupted jar contents; a new inventory format written by a mismatched library version.","solutions":["Fix the inventory resource so every mode field is a valid octal literal (e.g. 644, 755).","Replace the corrupted/mismatched artifact jar with an intact official build.","If generating inventories yourself, write modes with Integer.toOctalString(mode) and parse with radix 8."],"exampleFix":"// before (inventory line)\nrwxr-xr-x bin/cli\n// after\n755 bin/cli","handlingStrategy":"validation","validationCode":"// Java: pre-scan inventory mode fields for octal validity before extraction\nfor (String line : inventoryLines) {\n    String mode = line.split(\" \", 2)[0];\n    Integer.parseInt(mode, 8); // throws NumberFormatException on bad mode\n}","typeGuard":null,"tryCatchPattern":"try { loader.loadRuntime(); } catch (IOException e) { if (e.getMessage().startsWith(\"Invalid runtime asset mode in\")) { // artifact is malformed: replace jar, do not retry } else throw e; }","preventionTips":["Use official release artifacts; don't regenerate inventories with custom scripts","If generating inventories, always emit modes via Integer.toOctalString","Verify artifact checksums after download"],"tags":["parsing","corrupt-data","java","inventory"],"backgroundTag":"invalid-argument-format","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"}