apache/cassandra · error · RuntimeException

Timeout type requires one of (read, range, write, counterwri

Error message

Timeout type requires one of (read, range, write, counterwrite, cascontention, truncate, internodeconnect, internodeuser, internodestreaminguser, misc (general rpc_timeout_in_ms))

What it means

NodeProbe.getTimeout(String type) validates the timeout-type argument against the fixed set of known types (read, range, write, counterwrite, cascontention, truncate, internodeconnect, internodeuser, internodestreaminguser, misc) and throws for anything unrecognized in the default switch branch. This is a CLI argument validation error surfaced to `nodetool gettimeout` users.

Source

Thrown at src/java/org/apache/cassandra/tools/NodeProbe.java:1635

                return ssProxy.getReadRpcTimeout();
            case "range":
                return ssProxy.getRangeRpcTimeout();
            case "write":
                return ssProxy.getWriteRpcTimeout();
            case "counterwrite":
                return ssProxy.getCounterWriteRpcTimeout();
            case "cascontention":
                return ssProxy.getCasContentionTimeout();
            case "truncate":
                return ssProxy.getTruncateRpcTimeout();
            case "internodeconnect":
                return ssProxy.getInternodeTcpConnectTimeoutInMS();
            case "internodeuser":
                return ssProxy.getInternodeTcpUserTimeoutInMS();
            case "internodestreaminguser":
                return ssProxy.getInternodeStreamingTcpUserTimeoutInMS();
            default:
                throw new RuntimeException("Timeout type requires one of (" + GetTimeout.TIMEOUT_TYPES + ")");
        }
    }

    /** @deprecated See CASSANDRA-17225 */
    @Deprecated(since = "4.1")
    public int getStreamThroughput()
    {
        return ssProxy.getStreamThroughputMbitPerSec();
    }

    public double getStreamThroughputAsDouble()
    {
        return ssProxy.getStreamThroughputMbitPerSecAsDouble();
    }

    /** @deprecated See CASSANDRA-17225 */
    @Deprecated(since = "4.1")
    public int getInterDCStreamThroughput()

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Use exactly one of the listed types: read, range, write, counterwrite, cascontention, truncate, internodeconnect, internodeuser, internodestreaminguser, misc
  2. Check `nodetool help gettimeout` for the types supported by your version
  3. Use 'misc' for the general rpc_timeout_in_ms

Example fix

// before
probe.getTimeout("write_timeout");
// after
probe.getTimeout("write");
Defensive patterns

Strategy: validation

Validate before calling

java.util.Set<String> VALID = Set.of("read","range","write","counterwrite","cascontention","truncate","internodeconnect","internodeuser","internodestreaminguser","misc");
if (!VALID.contains(type)) throw new IllegalArgumentException("Invalid timeout type: " + type);

Try / catch

try { probe.getTimeout(type); } catch (RuntimeException e) { System.err.println("Valid types: " + VALID); }

Prevention

When it happens

Trigger: Running `nodetool gettimeout <badtype>`, e.g. a misspelled or unsupported type like 'read_timeout', 'cas', or a type added only in newer versions.

Common situations: Typo in timeout type name; following outdated documentation or scripts written for a different Cassandra version where a type did not exist (e.g. internodeconnect added later).

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/373a48d342c9971c. Report an issue: GitHub.