{"record":{"id":"f1263872630bf4cf","repo":"apache/cassandra","slug":"e-getmessage-f12638","errorCode":null,"errorMessage":"e.getMessage()","messagePattern":"e\\.getMessage\\(\\)","errorType":"console","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/GetTimeout.java","lineNumber":48,"sourceCode":"public class GetTimeout extends AbstractCommand\n{\n    public static final String TIMEOUT_TYPES = \"read, range, write, counterwrite, cascontention, truncate, internodeconnect, internodeuser, internodestreaminguser, misc (general rpc_timeout_in_ms)\";\n\n    @CassandraUsage(usage = \"<timeout_type>\", description = \"The timeout type, one of (\" + TIMEOUT_TYPES + \")\")\n    private List<String> args = new ArrayList<>();\n\n    @Parameters (index = \"0\", description = \"The timeout type, one of (\" + TIMEOUT_TYPES + ')', arity = \"1\")\n    private String timeout_type;\n\n    @Override\n    public void execute(NodeProbe probe)\n    {\n        try\n        {\n            probe.output().out.println(\"Current timeout for type \" + timeout_type + \": \" + probe.getTimeout(timeout_type) + \" ms\");\n        } catch (Exception e)\n        {\n            throw new IllegalArgumentException(e.getMessage());\n        }\n\n    }\n}\n","sourceCodeStart":30,"sourceCodeEnd":53,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/GetTimeout.java#L30-L53","documentation":"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.","triggerScenarios":"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.","commonSituations":"Typos like `nodetool gettimeout reads` (plural) or `read_timeout`; following outdated docs that name a timeout type differently across Cassandra versions.","solutions":["Use one of the valid timeout type names: read, write, range, counterwrite, casread, caswrite, or request.","Run `nodetool help gettimeout` to list accepted types.","Check the exact error text in the wrapped message to confirm which value was rejected."],"exampleFix":"// before\nnodetool gettimeout reads\n// after\nnodetool gettimeout read","handlingStrategy":"validation","validationCode":"VALID_TYPES = {'read','write','range','counterwrite','casread','caswrite','request'}\ndef validate_timeout_type(t):\n    if t not in VALID_TYPES:\n        raise SystemExit(f'invalid timeout type: {t}; use one of {sorted(VALID_TYPES)}')","typeGuard":null,"tryCatchPattern":"try {\n    probe.getTimeout(timeoutType);\n} catch (IllegalArgumentException e) {\n    System.err.println(\"Invalid timeout type, see nodetool help gettimeout: \" + e.getMessage());\n}","preventionTips":["Validate the timeout type against the documented list before calling.","Beware singular vs plural typos (read vs reads)."],"tags":["cli","nodetool","invalid-argument","timeout"],"backgroundTag":"invalid-argument-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}