openzipkin/zipkin · critical · ClosedComponentException
Session initialization failed. See server logs
Error message
Session initialization failed. See server logs
What it means
LazySession.get() throws ClosedComponentException('Session initialization failed. See server logs') when the Cassandra session ends up closed after the initialization block (USE keyspace, UDT registration, health-check preparation, or schema ensure/validate) failed. The code deliberately closes the session on failure and does not retry, so any later get() sees session.isClosed() and throws this.
Source
Thrown at zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/LazySession.java:54
if (session != null) return session; // lost race
session = sessionFactory.create(storage);
// If we got this far, the session is healthy. So, everything below only happens once.
try {
metadata = ensureSchema.apply(storage, session);
session.execute("USE " + storage.keyspace);
Schema.initializeUDTs(session, storage.keyspace);
healthCheck = session.prepare("SELECT trace_id FROM " + TABLE_SPAN + " limit 1");
} catch (RuntimeException | Error e) {
propagateIfFatal(e);
// An error here was from installing or validating the schema. To ensure we don't repeat
// failed commands, close, but don't null the session. For example, repeating may look like
// an upgrade due to the first failure, and distract from the original problem.
session.close();
}
}
if (session.isClosed()) {
throw new ClosedComponentException("Session initialization failed. See server logs");
}
return session;
}
Schema.Metadata metadata() {
get();
return metadata;
}
void healthCheck() {
get();
session.execute(healthCheck.bind());
}
void close() {
CqlSession maybeSession = session;
if (maybeSession != null) {
session.close();View on GitHub (pinned to 878ce2a1fa)
Solutions
- Check the server logs for the ORIGINAL error thrown during initialization — this exception only tells you init failed earlier.
- Verify Cassandra contact points, port, credentials, and network connectivity, then restart the process so LazySession can initialize cleanly.
- If the schema is missing, either apply the schema cql files manually or set CASSANDRA_ENSURE_SCHEMA=true.
Defensive patterns
Strategy: retry
Validate before calling
// Probe connectivity before building storage
try (CqlSession probe = CqlSession.builder().addContactPoint(contactPoint).build()) {
probe.execute("SELECT release_version FROM system.local");
} catch (AllNodesFailedException e) { throw new IllegalStateException("Cassandra unreachable", e); } Try / catch
catch (ClosedComponentException e) { log.error("Cassandra session init failed; inspect earlier startup logs for the root cause", e); scheduleRestartWithBackoff(); } Prevention
- Order startup so Cassandra is healthy before Zipkin starts (health-check dependency in compose/k8s).
- Always read the first ERROR log line during init — this exception is only a symptom.
When it happens
Trigger: Schema install/validation throwing during LazySession init (bad contact points, auth failure, missing schema with ensureSchema=false, unreachable keyspace); any subsequent storage call (span store, health check) then hits this exception.
Common situations: Server starts before Cassandra is reachable; CASSANDRA_ENSURE_SCHEMA=false against a fresh cluster with no schema; wrong credentials or keyspace; the original root cause is only in the logs because the exception itself is swallowed after session.close().
Related errors
- schema not installed: apply %s, or set CASSANDRA_ENSURE_SCHE
- No nodes in the cluster
- {annotationQueryString} query unsupported due to missing ann
- remoteService={remoteService} unsupported due to missing tab
- schema lacks indexing: apply %s, or set CASSANDRA_ENSURE_SCH
AI-assisted analysis of openzipkin/zipkin@878ce2a1fa (2026-08-14).
Data as JSON: /api/errors/3071da1a1da7a6a7.
Report an issue: GitHub.