openzipkin/zipkin · critical · RuntimeException

No nodes in the cluster

Error message

No nodes in the cluster

What it means

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.

Source

Thrown at zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/Schema.java:145

        
          "Cannot read keyspace metadata for keyspace: %s and cluster: %s".formatted(
          keyspace, session.getMetadata().getClusterName()));
    }
    return keyspaceMetadata;
  }

  static Version ensureVersion(com.datastax.oss.driver.api.core.metadata.Metadata metadata) {
    Version version = null;
    for (Map.Entry<UUID, Node> entry : metadata.getNodes().entrySet()) {
      version = entry.getValue().getCassandraVersion();
      if (version == null) throw new RuntimeException("node had no version: " + entry.getValue());
      if (Version.parse("3.11.3").compareTo(version) > 0) {
        throw new RuntimeException(
          "Node %s is running Cassandra %s, but minimum version is 3.11.3".formatted(
          entry.getKey(), entry.getValue().getCassandraVersion()));
      }
    }
    if (version == null) throw new RuntimeException("No nodes in the cluster");
    LOG.info("Detected Cassandra version {}", version);
    return version;
  }

  static void ensureExists(CqlSession session, String keyspace, boolean searchEnabled) {
    KeyspaceMetadata result = session.getMetadata().getKeyspace(keyspace).orElse(null);
    Version version = ensureVersion(session.getMetadata());
    if (result == null || result.getTable(Schema.TABLE_SPAN).isEmpty()) {
      LOG.info("Installing schema {} for keyspace {}", SCHEMA_RESOURCE, keyspace);
      applyCqlFile(version, keyspace, session, SCHEMA_RESOURCE);
      if (searchEnabled) {
        LOG.info("Installing indexes {} for keyspace {}", INDEX_RESOURCE, keyspace);
        applyCqlFile(version, keyspace, session, INDEX_RESOURCE);
      }
    } else if (searchEnabled) { // prior installation
      if (!hasUpgrade1_autocompleteTags(result)) {
        LOG.info("Upgrading schema {}", UPGRADE_1);
        applyCqlFile(version, keyspace, session, UPGRADE_1);

View on GitHub (pinned to 878ce2a1fa)

Solutions

  1. Verify CASSANDRA_CONTACT_POINTS host and port (default 9042) resolve and accept connections.
  2. Check auth (username/password) and TLS settings match the cluster.
  3. Ensure Cassandra is fully up before starting Zipkin; add health-check-based startup ordering.
Defensive patterns

Strategy: retry

Validate before calling

if (session.getMetadata().getNodes().isEmpty()) {
  throw new IllegalStateException("No Cassandra nodes discovered; check contact points, TLS, and auth");
}

Try / catch

catch (RuntimeException e) { if ("No nodes in the cluster".equals(e.getMessage())) retryStartupWithBackoff(); else throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: Wrong CASSANDRA_CONTACT_POINTS host/port; firewall or DNS failure; TLS/auth mismatch preventing node discovery; server started before Cassandra in docker-compose.

Related errors


AI-assisted analysis of openzipkin/zipkin@878ce2a1fa (2026-08-14). Data as JSON: /api/errors/298c2cf594f3fc74. Report an issue: GitHub.