apache/cassandra · error · java.lang.IllegalArgumentException

Cluster metadata dump file %s does not exist.

Error message

Cluster metadata dump file %s does not exist.

What it means

Thrown by CMSOfflineTool.parseClusterMetadata() when the cluster metadata dump file supplied via --dump doesn't exist on disk. The tool cannot read metadata without the dump produced by `nodetool cms ... loaddump`/`cms loaddump`.

Source

Thrown at src/java/org/apache/cassandra/tools/CMSOfflineTool.java:163

            {
                execute(parent.output);
                parent.output.out.flush();
                parent.output.err.flush();
            }
            catch (IOException e)
            {
                throw new RuntimeException(e);
            }
        }

        protected abstract void execute(Output output) throws IOException;

        public ClusterMetadata parseClusterMetadata() throws IOException
        {
            File file = new File(metadataDumpFile);
            if (!file.exists())
            {
                throw new IllegalArgumentException("Cluster metadata dump file " + metadataDumpFile + " does not exist.");
            }

            // Make sure the partitioner we use to manipulate the metadata is the same one used to generate it
            IPartitioner partitioner;
            try (FileInputStreamPlus fisp = new FileInputStreamPlus(metadataDumpFile))
            {
                int x = fisp.readUnsignedVInt32();
                Version version = Version.fromInt(x);
                partitioner = ClusterMetadata.Serializer.getPartitioner(fisp, version);
            }
            DatabaseDescriptor.toolInitialization();
            DatabaseDescriptor.setPartitionerUnsafe(partitioner);
            ClusterMetadataService.initializeForTools(false);

            return ClusterMetadataService.deserializeClusterMetadata(metadataDumpFile);
        }

        public void writeMetadata(Output output, ClusterMetadata metadata, String outputFilePath) throws IOException

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Generate the dump first (cms loaddump / nodetool equivalent) and pass its actual path
  2. Verify the path with `ls` and use an absolute path in the command
  3. Check the file wasn't removed between generation and tool run

Example fix

# before
cms offline --dump /tmp/wrong-name.cms
# after
cms offline --dump /tmp/cluster-metadata-dump.cms  # verified with ls -l
Defensive patterns

Strategy: validation

Validate before calling

File dump = new File(metadataDumpFile);
if (!dump.exists() || !dump.isFile()) throw new IllegalArgumentException("dump file missing: " + dump);

Try / catch

try { parseClusterMetadata(); } catch (IllegalArgumentException e) { if (e.getMessage().endsWith("does not exist.")) { /* create dump or fix --dump path */ } else throw e; }

Prevention

When it happens

Trigger: Running CMSOfflineTool (e.g. cms offline tasks) with --dump /path that points to a missing file or a typo'd path.

Common situations: Wrong relative path when running from a different working directory; dump was never created or was deleted; filename typo in a script.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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