apache/cassandra · error · IllegalArgumentException

Must only specify a singe YAML file per table (including…

Error message

Must only specify a singe YAML file per table (including keyspace qualifier).

What it means

For the 'user' command, each YAML profile declares a specName (keys.table). Profiles are stored in a map keyed by specName, so declaring two YAML files for the same table would collide; the constructor throws this IllegalArgumentException to reject the duplicate definition.

Solutions

  1. Change the keyspace/table in one of the YAML files so each profile targets a distinct table.
  2. Remove the duplicate profile=<file> argument if both files were meant to be the same profile.
  3. Check the 'specName'/table declaration at the top of each YAML file and make them unique.
  4. Merge the intended operations into a single profile YAML instead of splitting across files.

Example fix

// before: both profile1.yaml and profile2.yaml declare keyspace: ks1, table: t1
// after: edit profile2.yaml
table: t2
Defensive patterns

Strategy: validation

Validate before calling

Set<String> tables = new HashSet<>();
for (String yaml : yamlFiles) { String spec = readSpecName(yaml); if (!tables.add(spec)) throw new IllegalArgumentException("duplicate table profile: " + spec); }

Prevention

When it happens

Trigger: Running 'cassandra-stress user profile=a.yaml profile=b.yaml ops(...)' where both YAML files declare the same keyspace/table combination in their specName, so profiles.containsKey(specName) is true when the second file is loaded.

Common situations: Copying a profile YAML and editing operations but forgetting to change the table name; pointing two profile flags at different files that describe the same table; a generated config loop emitting the same table twice with different op weights.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


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

Appendix: source

Thrown at tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommandUser.java:90

        for (String curYamlPath : yamlPaths)
        {
            File yamlFile = new File(curYamlPath);
            URI yamlURI;
            if (yamlFile.exists()) {
            	yamlURI = yamlFile.toURI();
            } else {
            	yamlURI = URI.create(curYamlPath);
            	String uriScheme = yamlURI.getScheme();
            	if (uriScheme == null || "file".equals(uriScheme)) {
                    throw new IllegalArgumentException("File '" + yamlURI.getPath() + "' doesn't exist!");
            	}
            }
            StressProfile profile = StressProfile.load(yamlURI);
            String specName = profile.specName;
            if (default_profile_name == null) {default_profile_name=specName;} //first file is default
            if (profiles.containsKey(specName))
            {
                throw new IllegalArgumentException("Must only specify a singe YAML file per table (including keyspace qualifier).");
            }
            profiles.put(specName, profile);
        }


        if (ratios.size() == 0)
            throw new IllegalArgumentException("Must specify at least one command with a non-zero ratio");
    }

    public boolean hasInsertOnly()
    {
        return ratios.size() == 1 && ratios.containsKey("insert");
    }

    public OpDistributionFactory getFactory(final StressSettings settings)
    {
        final SeedManager seeds = new SeedManager(settings);

View on GitHub (pinned to 88fd0f6a0e)