stanfordnlp/CoreNLP · error · ProcessException
process exited with value
Error message
process %s exited with value %d
What it means
SystemUtils.run throws ProcessException when an external process started via ProcessBuilder exits with a nonzero exit code. The message embeds the command and its exit value so the developer can see which program failed and how. It is the library's way of surfacing subprocess failure rather than silently returning a bad status.
Solutions
- Read the exit value and the command in the message; rerun the command manually to see its stderr/stdout.
- Fix the command arguments or input files so the subprocess exits 0.
- Ensure the required binary is installed and is the expected version on PATH.
- Catch ProcessException at the call site and handle/retry or surface it to the user.
Example fix
// before
SystemUtils.run(new String[] {"gzip", badFile}, ...);
// after
File f = new File(path);
if (!f.exists() || f.length() == 0) throw new IOException("bad input: " + path);
try {
SystemUtils.run(new String[] {"gzip", f.getPath()}, ...);
} catch (ProcessException e) {
log.warning("subprocess failed: " + e.getMessage());
} Defensive patterns
Strategy: try-catch
Validate before calling
// verify the binary exists and args are sane before running
if (new File(cmd[0]).exists() == false && binOnPath(cmd[0]) == null)
throw new IllegalStateException("binary not found: " + cmd[0]); Try / catch
try {
SystemUtils.run(cmd, stdout, stderr);
} catch (ProcessException e) {
log.warning("process failed: " + e.getMessage());
// inspect stderr, retry or surface
} Prevention
- Run the command manually first to confirm exit code 0.
- Check the binary and version on PATH.
- Log captured stderr to diagnose nonzero exits.
- Wrap subprocess calls in a helper that retries transient failures.
When it happens
Trigger: Calling edu.stanford.nlp.util.SystemUtils.run (or the Runnable wrapper that invokes it) with a command that completes with waitFor() != 0, e.g. a nonexistent subcommand of a real binary or a tool failing on its input.
Common situations: Running helper binaries (gzip, svn, etc.) that are missing flags, wrong version, or operating on bad files; PATH resolves to a different binary than expected; the process writes errors to stderr and exits nonzero.
Related errors
- Must supply a target label to compute precision and recall…
- Cannot compute precision and recall on unlabelled dataset…
- Line format error at line
- Error: Line has too few tab-separated columns
- Dataset could not be loaded
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/f7f0e3237dc7b63a.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/util/SystemUtils.java:60
}
/**
* Start the process defined by the ProcessBuilder, and run until complete.
*
* @param builder The ProcessBuilder defining the process to run.
* @param output Where the process output should be written. If null, the
* process output will be written to System.out.
* @param error Where the process error output should be written. If null,
* the process error output will written to System.err.
*/
public static void run(ProcessBuilder builder, Writer output, Writer error) {
try {
Process process = builder.start();
consume(process, output, error);
int result = process.waitFor();
if (result != 0) {
String msg = "process %s exited with value %d";
throw new ProcessException(String.format(msg, builder.command(), result));
}
} catch (InterruptedException | IOException e) {
throw new ProcessException(e);
}
}
/**
* Helper method that consumes the output and error streams of a process.
*
* This should avoid deadlocks where, e.g. the process won't complete because
* it is waiting for output to be read from stdout or stderr.
*
* @param process A running process.
* @param outputWriter Where to write output. If null, System.out is used.
* @param errorWriter Where to write error output. If null, System.err is used.
*/
private static void consume(Process process, Writer outputWriter, Writer errorWriter)
throws InterruptedException {View on GitHub (pinned to 1b7edd19c4)