prestodb/presto · error · PrestoException

CASSANDRA_VERSION_ERROR

CASSANDRA_VERSION_ERROR

Error message

The cluster version is not available. Please make sure that the Cassandra cluster is up and running, and that the contact points are specified correctly.

What it means

resolveCassandraVersion falls back to 'select release_version from system.local' when node metadata lacks a version; if that query returns no row, the connector cannot determine the cluster version and throws CASSANDRA_VERSION_ERROR. The version is needed for version-specific behavior, so its absence is fatal.

Source

Thrown at presto-cassandra/src/main/java/com/facebook/presto/cassandra/NativeCassandraSession.java:181

    }

    private String resolveCassandraVersion()
    {
        // Prefer the version already present in the driver's cached node metadata to avoid a network
        // round-trip. In a mixed-version cluster take the lowest version so feature gating stays safe.
        Optional<Version> nodeVersion = executeWithSession(session -> session.getMetadata().getNodes().values().stream()
                .map(Node::getCassandraVersion)
                .filter(Objects::nonNull)
                .min(Comparator.naturalOrder()));
        if (nodeVersion.isPresent()) {
            return nodeVersion.get().toString();
        }

        // Fall back to querying system.local if node metadata does not expose a version.
        ResultSet result = executeWithSession(session -> session.execute("select release_version from system.local"));
        Row versionRow = result.one();
        if (versionRow == null) {
            throw new PrestoException(CASSANDRA_VERSION_ERROR, "The cluster version is not available. " +
                    "Please make sure that the Cassandra cluster is up and running, " +
                    "and that the contact points are specified correctly.");
        }
        return versionRow.getString("release_version");
    }

    @Override
    public String getPartitioner()
    {
        return executeWithSession(session -> session.getMetadata().getTokenMap()
                .orElseThrow(() -> new IllegalStateException("Token map is not available"))
                .getPartitionerName());
    }

    @Override
    public Set<TokenRange> getTokenRanges()
    {
        return executeWithSession(session -> {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Ensure the Cassandra cluster is up and system.local is queryable (cqlsh: SELECT release_version FROM system.local;)
  2. Fix cassandra.contact-points in the catalog properties to point at live nodes
  3. Check network/firewall connectivity from Presto nodes to port 9042
  4. Restart the Presto coordinator or reconnect the session once Cassandra is healthy
Defensive patterns

Strategy: validation

Validate before calling

Row row = session.execute("SELECT release_version FROM system.local").one();
if (row == null || row.getString("release_version") == null) {
    throw new IllegalStateException("Cassandra version unavailable; cluster not healthy");
}

Try / catch

try {
    String version = session.resolveCassandraVersion();
} catch (PrestoException e) {
    if (CASSANDRA_VERSION_ERROR.toErrorCode().getCode() == e.getErrorCode().getCode()) {
        alertClusterDown(); // nodetool status, fix contact points, retry later
    }
    throw e;
}

Prevention

When it happens

Trigger: Session/version resolution when the cluster is unreachable or partially initialized such that the system.local query executes but returns null Row — dead contact points, node still starting, or a broken control connection.

Common situations: Cassandra nodes down during Presto startup; contact points misconfigured; system.local unreadable due to permissions or cluster-wide failure; driver session established against a node that then fails.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/65fd0960d1e6c05d. Report an issue: GitHub.