stanfordnlp/CoreNLP · error · RuntimeException
Output path does not exist
Error message
Output path ${file} does not exist What it means
FileSystem.checkExistsOrFail(file) throws RuntimeException if the given file does not exist, logging 'Output path <file> does not exist'. It is a fail-fast precondition for reading or reusing an expected file.
Solutions
- Verify the path exists from the shell (ls -l) with the same user and working directory as the Java process.
- Use absolute paths or resolve against an explicit base directory.
- Ensure the producing step completed before this check (ordering/synchronization).
- Check case sensitivity and symlink targets on the filesystem.
Example fix
// before
FileSystem.checkExistsOrFail(new File("model.ser.gz"));
// after
File f = new File("model.ser.gz").getAbsoluteFile();
System.err.println("Looking for " + f);
FileSystem.checkExistsOrFail(f); Defensive patterns
Strategy: validation
Validate before calling
File f = file.getAbsoluteFile();
if (!f.exists()) throw new FileNotFoundException("Expected output missing: " + f); Try / catch
try {
FileSystem.checkExistsOrFail(file);
} catch (RuntimeException e) {
log.severe("Missing path: " + e.getMessage() + " cwd=" + new File(".").getAbsolutePath());
} Prevention
- Use absolute paths or resolve against explicit base dirs
- Verify prerequisite stages completed
- Watch out for case-sensitive filesystems
When it happens
Trigger: Calling checkExistsOrFail on a path that is missing: wrong relative path for current working directory, file not yet generated, deleted by a cleanup step, or case-mismatch on case-sensitive filesystems.
Common situations: Pipeline assumes a prior stage's output; models/JARs resource paths typed incorrectly; running from a different directory than during development; NAS mount not mounted.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- File doesn't exist
- can't open file
- Cannot find or open + sentFileName
- Cannot initialize logger!
- Collection elements must be Files or Strings
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/70a49930987b4451.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/io/FileSystem.java:135
mkdirOrFail(new File(dir));
}
/**
* Make the given directory or throw a RuntimeException
*/
public static void mkdirOrFail(File dir) {
if (!dir.mkdirs()) {
String error = "Could not create " + dir;
log.info(error);
throw new RuntimeException(error);
}
}
public static void checkExistsOrFail(File file) {
if (!file.exists()) {
String error = "Output path " + file + " does not exist";
log.info(error);
throw new RuntimeException(error);
}
}
public static void checkNotExistsOrFail(File file) {
if (file.exists()) {
String error = "Output path " + file + " already exists";
log.info(error);
throw new RuntimeException(error);
}
}
/**
* Unit test code
*/
public static void main(String[] args) {
String testDirName = "FileSystemTest";
String testFileName = "Pair.java";
View on GitHub (pinned to 1b7edd19c4)