{"record":{"id":"7958f0a3fcdb0e2c","repo":"oracle/graal","slug":"could-not-read-the-files-of-the-experiment-experi","errorCode":null,"errorMessage":"Could not read the files of the experiment {experimentId}: {message}","messagePattern":"Could not read the files of the experiment (.+?): (.+?)","errorType":"panic","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentParser.java","lineNumber":368,"sourceCode":"     * Parses an experiment by reading the provided logs. If anything fails, it throws an unchecked\n     * exception.\n     *\n     * @param experimentId the ID of the parsed experiment\n     * @param compilationKind the compilation kind of this experiment\n     * @param proftoolPath the file path to the JSON proftool output (mx profjson), can be\n     *            {@code null} if the experiment does not have any associated proftool output\n     * @param optimizationLogPath the path to the directory containing optimization logs\n     * @param warningWriter a writer for warning messages\n     * @return an experiment parsed from the provided files\n     */\n    public static Experiment parseOrPanic(ExperimentId experimentId, Experiment.CompilationKind compilationKind,\n                    String proftoolPath, String optimizationLogPath, Writer warningWriter) {\n        ExperimentFiles files = new ExperimentFilesImpl(experimentId, compilationKind, proftoolPath, optimizationLogPath);\n        ExperimentParser parser = new ExperimentParser(files, warningWriter);\n        try {\n            return parser.parse();\n        } catch (IOException e) {\n            throw new RuntimeException(\"Could not read the files of the experiment \" + experimentId + \": \" + e.getMessage());\n        } catch (ExperimentParserError e) {\n            throw new RuntimeException(e.getMessage());\n        }\n    }\n}\n","sourceCodeStart":350,"sourceCodeEnd":374,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentParser.java#L350-L374","documentation":"ExperimentParser.parseOrPanic is the convenience entry used by the profdiff CLI: it catches any IOException from parsing an experiment's files and rethrows it as a plain RuntimeException('Could not read the files of the experiment X: <cause>'). It means reading the proftool output or optimization-log directory failed at the I/O level (missing file, non-directory, unreadable), and the tool aborts.","triggerScenarios":"parseOrPanic with a --proftool path that does not exist, an optimization-log path that is a file or unreadable directory (listFiles() returns null), or any other disk/permission error while reading the experiment's files.","commonSituations":"Wrong or relative paths resolved from a different cwd, files not yet written (benchmark still running), permission-restricted directories, paths with typos, or data moved after the run.","solutions":["Verify both the proftool file and the optimization-log directory exist and are readable before running profdiff.","Use absolute paths to avoid working-directory surprises.","Wait for the measured JVM to finish writing its logs before diffing.","Re-run the experiment if the output files are missing."],"exampleFix":"# before\nmx profdiff normal-tier --experiment1 exp1 --proftool1 /nonexistent/proftool.json --optimization-log1 /tmp/opt\n# after\nmx profdiff normal-tier --experiment1 exp1 --proftool1 /data/exp1/proftool.json --optimization-log1 /data/exp1/optlogs/","handlingStrategy":"validation","validationCode":"// Pre-flight all inputs before parseOrPanic\nFile proftool = new File(proftoolPath);\nFile optLog = new File(optimizationLogPath);\nif (!proftool.isFile() || !proftool.canRead()) throw new IllegalArgumentException(\"Missing proftool file: \" + proftoolPath);\nif (!optLog.isDirectory() || !optLog.canRead()) throw new IllegalArgumentException(\"Bad optimization-log dir: \" + optimizationLogPath);","typeGuard":null,"tryCatchPattern":"try {\n    ExperimentParser.parseOrPanic(experimentId, kind, proftoolPath, optimizationLogPath, warningWriter);\n} catch (RuntimeException e) {\n    // 'Could not read the files of the experiment X' — resolve the IO cause, then retry once\n}","preventionTips":["Check existence and readability of all input paths before launching profdiff.","Use absolute paths in scripts.","Parse only after the measured JVM has terminated."],"tags":["profdiff","io","filesystem","configuration"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}