apache/cassandra · error · IllegalArgumentException

e.getMessage()

Error message

e.getMessage()

What it means

nodetool gettimeout wraps any exception from NodeProbe.getTimeout (most commonly an unknown timeout type from the JMX call) into an IllegalArgumentException carrying the original message. The thrown message is thus whatever the server rejected with, e.g. the invalid timeout type name.

Source

Thrown at src/java/org/apache/cassandra/tools/nodetool/GetTimeout.java:48

public class GetTimeout extends AbstractCommand
{
    public static final String TIMEOUT_TYPES = "read, range, write, counterwrite, cascontention, truncate, internodeconnect, internodeuser, internodestreaminguser, misc (general rpc_timeout_in_ms)";

    @CassandraUsage(usage = "<timeout_type>", description = "The timeout type, one of (" + TIMEOUT_TYPES + ")")
    private List<String> args = new ArrayList<>();

    @Parameters (index = "0", description = "The timeout type, one of (" + TIMEOUT_TYPES + ')', arity = "1")
    private String timeout_type;

    @Override
    public void execute(NodeProbe probe)
    {
        try
        {
            probe.output().out.println("Current timeout for type " + timeout_type + ": " + probe.getTimeout(timeout_type) + " ms");
        } catch (Exception e)
        {
            throw new IllegalArgumentException(e.getMessage());
        }

    }
}

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Use one of the valid timeout type names: read, write, range, counterwrite, casread, caswrite, or request.
  2. Run `nodetool help gettimeout` to list accepted types.
  3. Check the exact error text in the wrapped message to confirm which value was rejected.

Example fix

// before
nodetool gettimeout reads
// after
nodetool gettimeout read
Defensive patterns

Strategy: validation

Validate before calling

VALID_TYPES = {'read','write','range','counterwrite','casread','caswrite','request'}
def validate_timeout_type(t):
    if t not in VALID_TYPES:
        raise SystemExit(f'invalid timeout type: {t}; use one of {sorted(VALID_TYPES)}')

Try / catch

try {
    probe.getTimeout(timeoutType);
} catch (IllegalArgumentException e) {
    System.err.println("Invalid timeout type, see nodetool help gettimeout: " + e.getMessage());
}

Prevention

When it happens

Trigger: Running `nodetool gettimeout <type>` with a type string that is not a known timeout type (read, range, write, counterwrite, caswrite, etc.), causing the server-side lookup to fail.

Common situations: Typos like `nodetool gettimeout reads` (plural) or `read_timeout`; following outdated docs that name a timeout type differently across Cassandra versions.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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