{"record":{"id":"92217f5591cd2945","repo":"apache/cassandra","slug":"either-sstables-or-journal-segments-must-be-pr","errorCode":null,"errorMessage":"Either --sstables or --journal-segments must be provided","messagePattern":"Either --sstables or --journal-segments must be provided","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java","lineNumber":224,"sourceCode":"        public String txnId;\n\n        @Option(names = {\"--since\"}, description = \"Filter transactions since this timestamp (inclusive)\")\n        public String since;\n\n        @Option(names = {\"--until\"}, description = \"Filter transactions until this timestamp (inclusive)\")\n        public String until;\n\n        @Option(names = {\"-e\", \"--skip-errors\"}, description = \"Skip errors: 'true' to skip all, or comma-separated exception class names to skip specific types\")\n        public String skipErrors;\n\n        @Option(names = {\"-c\", \"--construct\"}, description = \"Construct entry\")\n        public boolean construct;\n\n\n        public void run()\n        {\n            if (sstables == null && journalSegments == null)\n                throw new IllegalArgumentException(\"Either --sstables or --journal-segments must be provided\");\n\n            Timestamp txnId = this.txnId != null ? TxnId.parse(this.txnId) : null;\n            Timestamp sinceTimestamp = this.since != null ? TxnId.parse(this.since) : null;\n            Timestamp untilTimestamp = this.until != null ? TxnId.parse(this.until) : null;\n\n            boolean skipAllErrors;\n            Set<String> skipExceptionTypes = new HashSet<>();\n\n            if (skipErrors != null && !skipErrors.trim().isEmpty())\n            {\n                String trimmed = skipErrors.trim();\n                if (\"true\".equalsIgnoreCase(trimmed))\n                {\n                    skipAllErrors = true;\n                }\n                else\n                {\n                    skipAllErrors = false;","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java#L206-L242","documentation":"StandaloneJournalUtil's runner validates that at least one input source is given before doing any work: either SSTable data files (--sstables) or journal segments (--journal-segments). Running a standalone journal tool (e.g. dump) with neither option means there is nothing to inspect, so it throws IllegalArgumentException immediately in run().","triggerScenarios":"Invoking a standalone journal command (e.g. bin/nodetool-style offline tool wrapping StandaloneJournalUtil) without passing --sstables and without passing --journal-segments; or passing both as null programmatically.","commonSituations":"Operator forgets the input flag when running offline journal inspection on a stopped node; a script builds the command line conditionally and drops the argument when a variable is empty.","solutions":["Pass --journal-segments with the segment name(s) to inspect","Pass --sstables with the SSTable data file(s) to inspect","Check the tool's help output for the exact flag spelling","Fix the wrapper script so at least one of the two arguments is always populated"],"exampleFix":"// before\njava -cp cassandra.jar org.apache.cassandra.tools.StandaloneJournalUtil dump --txn-id 123\n// after\njava -cp cassandra.jar org.apache.cassandra.tools.StandaloneJournalUtil dump --journal-segments timeline1","handlingStrategy":"validation","validationCode":"if (sstables == null && journalSegments == null)\n    throw new IllegalArgumentException(\"Either --sstables or --journal-segments must be provided\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --journal-segments (or --sstables) explicitly in scripts","Add a pre-run check in wrappers that at least one input flag is non-empty","Consult the tool's --help before upgrades, as flags change between versions"],"tags":["cli","offline-tools","validation"],"backgroundTag":"missing-required-argument","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"}