oracle/graal · error · RuntimeException
Could not read the files of the experiment {experimentId}: {
Error message
Could not read the files of the experiment {experimentId}: {message} What it means
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.
Source
Thrown at compiler/src/org.graalvm.profdiff/src/org/graalvm/profdiff/parser/ExperimentParser.java:368
* Parses an experiment by reading the provided logs. If anything fails, it throws an unchecked
* exception.
*
* @param experimentId the ID of the parsed experiment
* @param compilationKind the compilation kind of this experiment
* @param proftoolPath the file path to the JSON proftool output (mx profjson), can be
* {@code null} if the experiment does not have any associated proftool output
* @param optimizationLogPath the path to the directory containing optimization logs
* @param warningWriter a writer for warning messages
* @return an experiment parsed from the provided files
*/
public static Experiment parseOrPanic(ExperimentId experimentId, Experiment.CompilationKind compilationKind,
String proftoolPath, String optimizationLogPath, Writer warningWriter) {
ExperimentFiles files = new ExperimentFilesImpl(experimentId, compilationKind, proftoolPath, optimizationLogPath);
ExperimentParser parser = new ExperimentParser(files, warningWriter);
try {
return parser.parse();
} catch (IOException e) {
throw new RuntimeException("Could not read the files of the experiment " + experimentId + ": " + e.getMessage());
} catch (ExperimentParserError e) {
throw new RuntimeException(e.getMessage());
}
}
}
View on GitHub (pinned to a66e9ccd1d)
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.
Example fix
# before mx profdiff normal-tier --experiment1 exp1 --proftool1 /nonexistent/proftool.json --optimization-log1 /tmp/opt # after mx profdiff normal-tier --experiment1 exp1 --proftool1 /data/exp1/proftool.json --optimization-log1 /data/exp1/optlogs/
Defensive patterns
Strategy: validation
Validate before calling
// Pre-flight all inputs before parseOrPanic
File proftool = new File(proftoolPath);
File optLog = new File(optimizationLogPath);
if (!proftool.isFile() || !proftool.canRead()) throw new IllegalArgumentException("Missing proftool file: " + proftoolPath);
if (!optLog.isDirectory() || !optLog.canRead()) throw new IllegalArgumentException("Bad optimization-log dir: " + optimizationLogPath); Try / catch
try {
ExperimentParser.parseOrPanic(experimentId, kind, proftoolPath, optimizationLogPath, warningWriter);
} catch (RuntimeException e) {
// 'Could not read the files of the experiment X' — resolve the IO cause, then retry once
} Prevention
- Check existence and readability of all input paths before launching profdiff.
- Use absolute paths in scripts.
- Parse only after the measured JVM has terminated.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Failed to print the optimization log to a file: %s
- The provided optimization log path does not denote a directo
- Cannot use the specified log.file
- Invalid directed inlining rules file path: {path}
- Could not read directed inlining rules file: {path}
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/7958f0a3fcdb0e2c.
Report an issue: GitHub.