apache/cassandra · error · IllegalArgumentException

Either --sstables or --journal-segments must be provided

Error message

Either --sstables or --journal-segments must be provided

What it means

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().

Source

Thrown at src/java/org/apache/cassandra/tools/StandaloneJournalUtil.java:224

        public String txnId;

        @Option(names = {"--since"}, description = "Filter transactions since this timestamp (inclusive)")
        public String since;

        @Option(names = {"--until"}, description = "Filter transactions until this timestamp (inclusive)")
        public String until;

        @Option(names = {"-e", "--skip-errors"}, description = "Skip errors: 'true' to skip all, or comma-separated exception class names to skip specific types")
        public String skipErrors;

        @Option(names = {"-c", "--construct"}, description = "Construct entry")
        public boolean construct;


        public void run()
        {
            if (sstables == null && journalSegments == null)
                throw new IllegalArgumentException("Either --sstables or --journal-segments must be provided");

            Timestamp txnId = this.txnId != null ? TxnId.parse(this.txnId) : null;
            Timestamp sinceTimestamp = this.since != null ? TxnId.parse(this.since) : null;
            Timestamp untilTimestamp = this.until != null ? TxnId.parse(this.until) : null;

            boolean skipAllErrors;
            Set<String> skipExceptionTypes = new HashSet<>();

            if (skipErrors != null && !skipErrors.trim().isEmpty())
            {
                String trimmed = skipErrors.trim();
                if ("true".equalsIgnoreCase(trimmed))
                {
                    skipAllErrors = true;
                }
                else
                {
                    skipAllErrors = false;

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Pass --journal-segments with the segment name(s) to inspect
  2. Pass --sstables with the SSTable data file(s) to inspect
  3. Check the tool's help output for the exact flag spelling
  4. Fix the wrapper script so at least one of the two arguments is always populated

Example fix

// before
java -cp cassandra.jar org.apache.cassandra.tools.StandaloneJournalUtil dump --txn-id 123
// after
java -cp cassandra.jar org.apache.cassandra.tools.StandaloneJournalUtil dump --journal-segments timeline1
Defensive patterns

Strategy: validation

Validate before calling

if (sstables == null && journalSegments == null)
    throw new IllegalArgumentException("Either --sstables or --journal-segments must be provided");

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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