{"record":{"id":"65fd0960d1e6c05d","repo":"prestodb/presto","slug":"cassandra-version-error","errorCode":"CASSANDRA_VERSION_ERROR","errorMessage":"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.","messagePattern":"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\\.","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-cassandra/src/main/java/com/facebook/presto/cassandra/NativeCassandraSession.java","lineNumber":181,"sourceCode":"    }\n\n    private String resolveCassandraVersion()\n    {\n        // Prefer the version already present in the driver's cached node metadata to avoid a network\n        // round-trip. In a mixed-version cluster take the lowest version so feature gating stays safe.\n        Optional<Version> nodeVersion = executeWithSession(session -> session.getMetadata().getNodes().values().stream()\n                .map(Node::getCassandraVersion)\n                .filter(Objects::nonNull)\n                .min(Comparator.naturalOrder()));\n        if (nodeVersion.isPresent()) {\n            return nodeVersion.get().toString();\n        }\n\n        // Fall back to querying system.local if node metadata does not expose a version.\n        ResultSet result = executeWithSession(session -> session.execute(\"select release_version from system.local\"));\n        Row versionRow = result.one();\n        if (versionRow == null) {\n            throw new PrestoException(CASSANDRA_VERSION_ERROR, \"The cluster version is not available. \" +\n                    \"Please make sure that the Cassandra cluster is up and running, \" +\n                    \"and that the contact points are specified correctly.\");\n        }\n        return versionRow.getString(\"release_version\");\n    }\n\n    @Override\n    public String getPartitioner()\n    {\n        return executeWithSession(session -> session.getMetadata().getTokenMap()\n                .orElseThrow(() -> new IllegalStateException(\"Token map is not available\"))\n                .getPartitionerName());\n    }\n\n    @Override\n    public Set<TokenRange> getTokenRanges()\n    {\n        return executeWithSession(session -> {","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-cassandra/src/main/java/com/facebook/presto/cassandra/NativeCassandraSession.java#L163-L199","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure the Cassandra cluster is up and system.local is queryable (cqlsh: SELECT release_version FROM system.local;)","Fix cassandra.contact-points in the catalog properties to point at live nodes","Check network/firewall connectivity from Presto nodes to port 9042","Restart the Presto coordinator or reconnect the session once Cassandra is healthy"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Row row = session.execute(\"SELECT release_version FROM system.local\").one();\nif (row == null || row.getString(\"release_version\") == null) {\n    throw new IllegalStateException(\"Cassandra version unavailable; cluster not healthy\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    String version = session.resolveCassandraVersion();\n} catch (PrestoException e) {\n    if (CASSANDRA_VERSION_ERROR.toErrorCode().getCode() == e.getErrorCode().getCode()) {\n        alertClusterDown(); // nodetool status, fix contact points, retry later\n    }\n    throw e;\n}","preventionTips":["Ensure Cassandra is fully started before Presto opens sessions","Verify contact points and network reachability to port 9042","Add health checks that query system.local at deployment time"],"tags":["cassandra","version-detection","connectivity","system-local"],"backgroundTag":"cassandra-metadata-unavailable","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}