{"record":{"id":"9b5834957022fde8","repo":"apache/cassandra","slug":"the-column-family-list-for-a-snapshot-should-not-b","errorCode":null,"errorMessage":"The column family list for a snapshot should not be empty or null","messagePattern":"The column family list for a snapshot should not be empty or null","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/NodeProbe.java","lineNumber":1004,"sourceCode":"     * Take a snapshot of all column family from different keyspaces.\n     *\n     * @param snapshotName\n     *            the name of the snapshot.\n     * @param options\n     *            Options (skipFlush for now)\n     * @param tableList\n     *            list of columnfamily from different keyspace in the form of ks1.cf1 ks2.cf2\n     */\n    public void takeMultipleTableSnapshot(String snapshotName, Map<String, String> options, String... tableList)\n            throws IOException\n    {\n        if (null != tableList && tableList.length != 0)\n        {\n            snapshotProxy.takeSnapshot(snapshotName, options, tableList);\n        }\n        else\n        {\n            throw new IOException(\"The column family list for a snapshot should not be empty or null\");\n        }\n    }\n\n    /**\n     * Remove all the existing snapshots of given tag for provided keyspaces.\n     * When no keyspaces are specified, take all keyspaces into account. When tag is not specified (null or empty string),\n     * take all tags into account.\n     *\n     * @param tag tag of snapshot to clear\n     * @param keyspaces keyspaces to clear snapshots for\n     */\n    /** @deprecated See CASSANDRA-16860 */\n    @Deprecated(since = \"5.0\")\n    public void clearSnapshot(String tag, String... keyspaces) throws IOException\n    {\n        clearSnapshot(Collections.emptyMap(), tag, keyspaces);\n    }\n","sourceCodeStart":986,"sourceCodeEnd":1022,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/NodeProbe.java#L986-L1022","documentation":"This takeSnapshot overload accepts an explicit table list and refuses to call the JMX operation when the list is null or empty, since a snapshot with no tables specified is ambiguous. It throws IOException with this message.","triggerScenarios":"Calling NodeProbe.takeSnapshot (the tableList overload) with a null or zero-length table array — e.g. nodetool snapshot -cf with an empty/duplicate-filtered table list.","commonSituations":"Shell scripts building the -cf list from variables that expand to nothing; programmatic callers passing new String[0].","solutions":["Pass at least one table name in the table list","Guard the call: skip or fall back to whole-keyspace snapshot when the list is empty","Fix the script producing the table list so it never yields an empty array"],"exampleFix":"// before\nString[] tables = getTables(); // may be empty\nprobe.takeSnapshot(tag, options, tables);\n// after\nif (tables != null && tables.length > 0)\n    probe.takeSnapshot(tag, options, tables);","handlingStrategy":"validation","validationCode":"if (tableList == null || tableList.length == 0)\n    throw new IllegalArgumentException(\"tableList must contain at least one table\");","typeGuard":"boolean hasTables(String[] t) { return t != null && t.length > 0; }","tryCatchPattern":"try {\n    probe.takeSnapshot(snapshotName, options, tableList);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"should not be empty or null\"))\n        System.err.println(\"Provide at least one table name\");\n    else throw e;\n}","preventionTips":["Check shell variables feeding table lists don't expand empty","Skip the snapshot or fall back to full-keyspace snapshot when the list is empty","Filter duplicates/typos before building the list"],"tags":["snapshot","validation","empty-list"],"backgroundTag":"empty-required-field","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"}