{"record":{"id":"9bbe07d1911fe176","repo":"oracle/graal","slug":"failed-to-parse-experiment-experimentid-in-reso-9bbe07","errorCode":null,"errorMessage":"Failed to parse experiment {experimentId} in {resource}: {message}","messagePattern":"Failed to parse experiment (.+?) in (.+?): (.+?)","errorType":"exception","errorClass":"ExperimentParserError","httpStatus":null,"severity":"error","filePath":"compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentJSONParser.java","lineNumber":180,"sourceCode":"     */\n    private final FileView file;\n\n    public ExperimentJSONParser(ExperimentId experimentId, FileView file) {\n        this.experimentId = experimentId;\n        this.file = file;\n    }\n\n    /**\n     * Parses the source string as a JSON literal.\n     *\n     * @return the parsed JSON literal\n     * @throws ExperimentParserError failed to parse the experiment\n     */\n    public JSONLiteral parse() throws ExperimentParserError, IOException {\n        try {\n            return new JSONLiteral(new JsonParser(file.readFully()).parse(), null);\n        } catch (JsonParserException parserException) {\n            throw new ExperimentParserError(experimentId, file.getSymbolicPath(), parserException.getMessage());\n        }\n    }\n\n    /**\n     * Parses the source string as a JSON map using a list of allowed keys. It is assumed that the\n     * source string comes from the assigned file view.\n     *\n     * @param allowedKeys the list of allowed keys\n     * @param source the source string containing the JSON map\n     * @return the parsed JSON map containing only values for (not necessarily all) allowed keys\n     * @throws ExperimentParserError failed to parse the experiment\n     * @see JsonParser#parseAllowedKeys(List)\n     */\n    public JSONMap parseAllowedKeys(List<String> allowedKeys, String source) throws ExperimentParserError, IOException {\n        try {\n            return new JSONMap(new JsonParser(source).parseAllowedKeys(allowedKeys));\n        } catch (JsonParserException parserException) {\n            throw new ExperimentParserError(experimentId, file.getSymbolicPath(), parserException.getMessage());","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentJSONParser.java#L162-L198","documentation":"ExperimentJSONParser.parse wraps any JsonParserException raised while parsing a whole file's JSON into ExperimentParserError, carrying the experiment id, the file's symbolic path, and the parser's position-tagged message. It means the file is not syntactically valid JSON at all (as opposed to a type mismatch inside valid JSON).","triggerScenarios":"A truncated or concatenated-wrongly optimization-log file (units are newline-separated JSON), binary garbage, HTML error pages saved as logs, or a proftool output cut off mid-write.","commonSituations":"Logs truncated by a killed JVM or full disk; files transferred with encoding corruption; multiple JSON documents concatenated without the expected newline framing; appending to an existing log with a partial line.","solutions":["Open the named file at the character position in the parser message and inspect the syntax error.","Regenerate the log from a clean, completed run.","If hand-assembling logs, keep exactly one JSON value per line for optimization logs and one document for proftool output.","Check disk space / process exit status of the original run."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-validate JSON syntax with the same parser used internally\ntry {\n    new org.graalvm.profdiff.utils.JsonParser(source).parse();\n} catch (JsonParserException e) {\n    throw new IllegalArgumentException(\"Invalid JSON in \" + path + \": \" + e.getMessage());\n}","typeGuard":null,"tryCatchPattern":"try {\n    parser.parse();\n} catch (ExperimentParserError e) {\n    // contains the JsonParserException message with line/column; fix or regenerate the file\n}","preventionTips":["Ensure the measured JVM exits cleanly so logs are fully flushed.","Keep one JSON document per line in optimization logs."],"tags":["profdiff","json","syntax-error","io"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}