{"record":{"id":"71c834972e8f4c9a","repo":"oracle/graal","slug":"error-running-command-s-n-s","errorCode":null,"errorMessage":"Error running command: %s%n%s","messagePattern":"Error running command: (.+?)%n(.+?)","errorType":"panic","errorClass":"GraalError","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/GetCompilerConfig.java","lineNumber":154,"sourceCode":"            command.add(\"-esa\");\n            command.add(\"-ea\");\n        }\n\n        command.add(CompilerConfig.class.getName());\n        String base = GetCompilerConfig.class.getSimpleName() + \"_\" + ProcessHandle.current().pid();\n        Path encodedConfigPath = Path.of(base + \".bin\").toAbsolutePath();\n        Path debugPath = Path.of(base + \".txt\").toAbsolutePath();\n        command.add(encodedConfigPath.toString());\n        command.add(debugPath.toString());\n\n        String quotedCommand = command.stream().map(e -> e.indexOf(' ') == -1 ? e : '\\'' + e + '\\'').collect(Collectors.joining(\" \"));\n        ProcessBuilder pb = new ProcessBuilder(command);\n        pb.inheritIO();\n        Process p;\n        try {\n            p = pb.start();\n        } catch (IOException ex) {\n            throw new GraalError(\"Error running command: %s%n%s\", quotedCommand, ex);\n        }\n\n        try {\n            int exitValue = p.waitFor();\n            if (exitValue != 0) {\n                throw new GraalError(\"Command finished with exit value %d (look for stdout and stderr above): %s\", exitValue, quotedCommand);\n            }\n        } catch (InterruptedException e) {\n            throw new GraalError(\"Interrupted waiting for command: %s\", quotedCommand);\n        }\n        try {\n            byte[] encodedConfig = Files.readAllBytes(encodedConfigPath);\n            if (DEBUG) {\n                System.out.printf(\"[%d] Executed: %s%n\", p.pid(), quotedCommand);\n                System.out.printf(\"[%d] Compiler config output saved in '%s'%n\", p.pid(), encodedConfigPath);\n                System.out.printf(\"[%d] Compiler config debug output saved in '%s'%n\", p.pid(), debugPath);\n            } else {\n                Files.deleteIfExists(encodedConfigPath);","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/GetCompilerConfig.java#L136-L172","documentation":"Error \"Error running command: %s%n%s\" thrown in oracle/graal.","triggerScenarios":"Thrown at compiler/src/jdk.graal.compiler.libgraal/src/jdk/graal/compiler/libgraal/GetCompilerConfig.java:154 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: Error running command: {} {}","solutions":["Fix the condition reported by the error: Error running command: {} {}","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: Error running command: {} {}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}