stanfordnlp/CoreNLP · critical · IOException
Server is not ready and can not start it!
Error message
Server is not ready and can not start it!
What it means
In ensureServer, when no locally managed server exists and a readiness probe (ready(false)) fails, the annotator cannot start or connect to anything, so it throws this IOException. This happens when no start command is configured and the remote target is not ready.
Solutions
- Start the external annotator service before constructing the pipeline (or configure webservice.command so the annotator can launch it)
- Verify the configured URL/port points at the live service (curl it first)
- Check whether the service died; restart it and retry pipeline construction
- Add retry/backoff around pipeline construction if the service startup is asynchronous
Example fix
// before
props.setProperty("webservice.url", "http://localhost:8140"); // service never started
// after
// start service first: server.sh --port 8140 &
props.setProperty("webservice.url", "http://localhost:8140"); Defensive patterns
Strategy: validation
Validate before calling
// Ensure target is ready before constructing the annotator
if (props.getProperty("webservice.command") == null) {
int code;
try {
code = ((java.net.HttpURLConnection) new java.net.URL(props.getProperty("webservice.url")).openConnection()).getResponseCode();
} catch (java.io.IOException e) { code = -1; }
if (code < 200 || code >= 500)
throw new IllegalStateException("External annotator service not reachable at " + props.getProperty("webservice.url"));
} Try / catch
try {
pipeline.annotate(doc);
} catch (java.io.IOException e) {
if (e.getMessage().contains("Server is not ready")) {
log.error("No start command configured and target not ready: start the service or set webservice.command");
}
throw e;
} Prevention
- Always start the external service before building the pipeline
- Configure webservice.command if you want automatic local startup
- Health-check the target URL during deployment readiness probes
- Keep service and pipeline lifecycles coupled (start/stop together)
When it happens
Trigger: Using a WebServiceAnnotator without a start command (expecting an already-running external service) while the remote endpoint is down, wrong port, or still initializing — ready(false) returns false and there is nothing to launch.
Common situations: Forgetting to start the external annotator service before building the pipeline, pointing at the wrong host/port, or the service crashed between checks.
Understand the failure class
Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.
Related errors
- Unknown LogPriorType:
- edu.stanford.nlp.coref.CorefScorer.ScorerMissingException
- Error initializing coref system
- unsupported language
- no sieve type specified
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/760d14a9d653c3f2.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/pipeline/WebServiceAnnotator.java:290
// 3. Wait for the target server to become ready
synchronized (this) {
if (this.server.isPresent()) {
while (!this.server.get().ready) {
if (System.currentTimeMillis() > startTime + CONNECT_TIMEOUT) {
throw new TimeoutException("Never got readiness from annotator: " + this);
}
if (!ready(true)) {
try {
Thread.sleep(1000);
} catch (InterruptedException ignored) {
}
} else {
this.server.get().ready = true;
}
}
} else if (!ready(false)) { // The server is not ready
throw new IOException("Server is not ready and can not start it!");
}
}
log.info("Got readiness from server for " + this);
serverWasActive = true;
// 4. Server is ensured! We can continue
}
/** {@inheritDoc} */
public void unmount() {
log.info("Unmounting server: " + this);
synchronized (this) {
if (this.server.isPresent()) {
this.server.get().kill();
this.server = Optional.empty();
}
// run optional stop script
try {View on GitHub (pinned to 1b7edd19c4)