{"record":{"id":"49cc137662221a41","repo":"apache/cassandra","slug":"arguments-for-f-are-yaml-and-json-only","errorCode":null,"errorMessage":"arguments for -F are yaml and json only.","messagePattern":"arguments for -F are yaml and json only\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/nodetool/DataPaths.java","lineNumber":48,"sourceCode":"import picocli.CommandLine.Option;\nimport picocli.CommandLine.Parameters;\n\n@Command(name = \"datapaths\", description = \"Print all directories where data of tables are stored\")\npublic class DataPaths extends AbstractCommand\n{\n    @CassandraUsage(usage = \"[<keyspace.table>...]\", description = \"List of table (or keyspace) names\")\n    @Parameters(paramLabel = \"keyspace.table\", description = \"List of table (or keyspace) names\")\n    private List<String> tableNames = new ArrayList<>();\n\n    @Option(paramLabel = \"format\", names = { \"-F\", \"--format\" }, description = \"Output format (json, yaml)\")\n    private String outputFormat = \"\";\n\n    @Override\n    protected void execute(NodeProbe probe)\n    {\n        if (!outputFormat.isEmpty() && !\"json\".equals(outputFormat) && !\"yaml\".equals(outputFormat))\n        {\n            throw new IllegalArgumentException(\"arguments for -F are yaml and json only.\");\n        }\n\n        DataPathsHolder holder = new DataPathsHolder(probe, tableNames);\n        StatsPrinter<DataPathsHolder> printer = DataPathsPrinter.from(outputFormat);\n        printer.print(holder, probe.output().out);\n    }\n}\n","sourceCodeStart":30,"sourceCodeEnd":56,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/nodetool/DataPaths.java#L30-L56","documentation":"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.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/tools/nodetool/DataPaths.java:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass -F json or -F yaml, or omit -F","Fix typos in the format argument","Update calling scripts to use a supported format"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}