apache/cassandra · error · IllegalArgumentException

arguments for -F are yaml and json only.

Error message

arguments for -F are yaml and json only.

What it means

IllegalArgumentException from DataPaths.execute when the -F/--format option is not yaml or json. Only these two machine-readable formats are supported for the datapaths listing; any other value is rejected before querying data directories.

Solutions

  1. Pass -F json or -F yaml, or omit -F
  2. Fix typos in the format argument
  3. Update calling scripts to use a supported format
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/java/org/apache/cassandra/tools/nodetool/DataPaths.java:48 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

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

import picocli.CommandLine.Option;
import picocli.CommandLine.Parameters;

@Command(name = "datapaths", description = "Print all directories where data of tables are stored")
public class DataPaths extends AbstractCommand
{
    @CassandraUsage(usage = "[<keyspace.table>...]", description = "List of table (or keyspace) names")
    @Parameters(paramLabel = "keyspace.table", description = "List of table (or keyspace) names")
    private List<String> tableNames = new ArrayList<>();

    @Option(paramLabel = "format", names = { "-F", "--format" }, description = "Output format (json, yaml)")
    private String outputFormat = "";

    @Override
    protected void execute(NodeProbe probe)
    {
        if (!outputFormat.isEmpty() && !"json".equals(outputFormat) && !"yaml".equals(outputFormat))
        {
            throw new IllegalArgumentException("arguments for -F are yaml and json only.");
        }

        DataPathsHolder holder = new DataPathsHolder(probe, tableNames);
        StatsPrinter<DataPathsHolder> printer = DataPathsPrinter.from(outputFormat);
        printer.print(holder, probe.output().out);
    }
}

View on GitHub (pinned to 88fd0f6a0e)