{"record":{"id":"298c2cf594f3fc74","repo":"openzipkin/zipkin","slug":"no-nodes-in-the-cluster","errorCode":null,"errorMessage":"No nodes in the cluster","messagePattern":"No nodes in the cluster","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/Schema.java","lineNumber":145,"sourceCode":"        \n          \"Cannot read keyspace metadata for keyspace: %s and cluster: %s\".formatted(\n          keyspace, session.getMetadata().getClusterName()));\n    }\n    return keyspaceMetadata;\n  }\n\n  static Version ensureVersion(com.datastax.oss.driver.api.core.metadata.Metadata metadata) {\n    Version version = null;\n    for (Map.Entry<UUID, Node> entry : metadata.getNodes().entrySet()) {\n      version = entry.getValue().getCassandraVersion();\n      if (version == null) throw new RuntimeException(\"node had no version: \" + entry.getValue());\n      if (Version.parse(\"3.11.3\").compareTo(version) > 0) {\n        throw new RuntimeException(\n          \"Node %s is running Cassandra %s, but minimum version is 3.11.3\".formatted(\n          entry.getKey(), entry.getValue().getCassandraVersion()));\n      }\n    }\n    if (version == null) throw new RuntimeException(\"No nodes in the cluster\");\n    LOG.info(\"Detected Cassandra version {}\", version);\n    return version;\n  }\n\n  static void ensureExists(CqlSession session, String keyspace, boolean searchEnabled) {\n    KeyspaceMetadata result = session.getMetadata().getKeyspace(keyspace).orElse(null);\n    Version version = ensureVersion(session.getMetadata());\n    if (result == null || result.getTable(Schema.TABLE_SPAN).isEmpty()) {\n      LOG.info(\"Installing schema {} for keyspace {}\", SCHEMA_RESOURCE, keyspace);\n      applyCqlFile(version, keyspace, session, SCHEMA_RESOURCE);\n      if (searchEnabled) {\n        LOG.info(\"Installing indexes {} for keyspace {}\", INDEX_RESOURCE, keyspace);\n        applyCqlFile(version, keyspace, session, INDEX_RESOURCE);\n      }\n    } else if (searchEnabled) { // prior installation\n      if (!hasUpgrade1_autocompleteTags(result)) {\n        LOG.info(\"Upgrading schema {}\", UPGRADE_1);\n        applyCqlFile(version, keyspace, session, UPGRADE_1);","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/Schema.java#L127-L163","documentation":"ensureVersion throws RuntimeException('No nodes in the cluster') when the cluster metadata contains zero nodes after iterating them. The driver established a session object but knows of no Cassandra nodes, so version detection and schema work cannot continue.","triggerScenarios":"Session built with contact points that are unreachable or wrong (driver may still construct a session lazily), so metadata.getNodes() is empty when schema code runs.","commonSituations":"Wrong CASSANDRA_CONTACT_POINTS host/port; firewall or DNS failure; TLS/auth mismatch preventing node discovery; server started before Cassandra in docker-compose.","solutions":["Verify CASSANDRA_CONTACT_POINTS host and port (default 9042) resolve and accept connections.","Check auth (username/password) and TLS settings match the cluster.","Ensure Cassandra is fully up before starting Zipkin; add health-check-based startup ordering."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (session.getMetadata().getNodes().isEmpty()) {\n  throw new IllegalStateException(\"No Cassandra nodes discovered; check contact points, TLS, and auth\");\n}","typeGuard":null,"tryCatchPattern":"catch (RuntimeException e) { if (\"No nodes in the cluster\".equals(e.getMessage())) retryStartupWithBackoff(); else throw e; }","preventionTips":["Add a depends-on/health-check for Cassandra before Zipkin in orchestration.","Smoke-test contact points with cqlsh before deploying."],"tags":["cassandra","zipkin","discovery","connection","startup"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}