stanfordnlp/CoreNLP · critical · TimeoutException
Never got readiness from annotator:
Error message
Never got readiness from annotator:
What it means
After the server is live, WebServiceAnnotator.ensureServer waits for the server's own readiness signal (server.ready / ready(true)). If readiness is never reported within CONNECT_TIMEOUT, it throws this TimeoutException.
Solutions
- Increase the connect/readiness timeout so slow initialization can complete
- Confirm the service's readiness/health endpoint actually flips to ready (curl the health path)
- Check service logs for initialization errors or deadlocks during warm-up
- Restart the service; if readiness is never signalled even when healthy, update the annotator configuration to point at the correct health URL
Example fix
// before
WebServiceAnnotator a = new WebServiceAnnotator(props); // default short timeout
// after
props.setProperty("webservice.connectTimeout", "300000");
WebServiceAnnotator a = new WebServiceAnnotator(props); Defensive patterns
Strategy: retry
Validate before calling
// Poll the health endpoint until ready before using the annotator
long deadline = System.currentTimeMillis() + 300_000;
while (System.currentTimeMillis() < deadline) {
try {
int code = ((java.net.HttpURLConnection) new java.net.URL(healthUrl).openConnection()).getResponseCode();
if (code == 200) break;
} catch (java.io.IOException ignored) {}
try { Thread.sleep(1000); } catch (InterruptedException ignored) {}
} Try / catch
try {
pipeline.annotate(doc);
} catch (java.util.concurrent.TimeoutException e) {
if (e.getMessage().contains("Never got readiness")) {
log.error("Server live but not ready in time: check health endpoint and init logs");
}
} Prevention
- Set a readiness timeout larger than the service's worst-case warm-up time
- Verify the readiness/health endpoint returns ready=true manually
- Look for initialization hangs or errors in service logs
- Restart the service if readiness has been stuck; escalate if reproducible
When it happens
Trigger: The server process is up and answering connections but its readiness check never returns true within the timeout — e.g. the service reports liveness before models finish loading, or the readiness endpoint is unreachable while the main endpoint is not.
Common situations: Slow model warm-up exceeding the timeout, a readiness endpoint path misconfigured, server started externally (no managed server object) so readiness must come from polling ready(false/true), or hung initialization in the service.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
Related errors
- Could not connect to annotator:
- Could not start a local server!
- Server is not ready and can not start it!
- Could not annotate document after 3 tries:
- Could not ensure a server:
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/f1ea650ca27d9ae5.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/pipeline/WebServiceAnnotator.java:278
if (System.currentTimeMillis() > startTime + CONNECT_TIMEOUT) {
throw new TimeoutException("Could not connect to annotator: " + this);
}
if (!live()) {
try {
Thread.sleep(1000);
} catch (InterruptedException ignored) {}
} else {
everLive = true;
}
}
log.info("Got liveness from server for " + this);
// 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 continueView on GitHub (pinned to 1b7edd19c4)