apache/cassandra · error · IllegalArgumentException

Missing name argument in column spec

Error message

Missing name argument in column spec

What it means

Every column spec in a stress profile YAML must include a 'name' key identifying the column it configures. init throws this IllegalArgumentException when a spec map has no name key. The name is required to seed the value generator and map the config to a schema column.

Solutions

  1. Add the required 'name' key to each column spec in the YAML
  2. Verify YAML indentation so 'name' belongs to the same spec mapping
  3. Compare against an example stress profile YAML for the correct structure

Example fix

# before
columnspec:
  population: uniform(1..1M)
# after
columnspec:
  name: c1
  population: uniform(1..1M)
Defensive patterns

Strategy: validation

Validate before calling

// require name in each column spec
if (!specMap.containsKey("name")) throw new IllegalArgumentException("column spec missing 'name'");

Try / catch

try { profile.init(yaml); } catch (IllegalArgumentException e) { if (e.getMessage().contains("Missing name")) log.error("Add 'name' to every columnspec entry"); throw e; }

Prevention

When it happens

Trigger: profile.init(yaml) encountering a column spec entry that specifies population/size/cluster but omits the mandatory 'name' key.

Common situations: Hand-editing YAML and deleting the name line, YAML indentation errors that break key association, copy-pasting partial spec blocks.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at tools/stress/src/org/apache/cassandra/stress/StressProfile.java:257

            tableCql = null;
        }

        columnConfigs = new HashMap<>();

        if (yaml.columnspec != null)
        {
            for (Map<String, Object> spec : yaml.columnspec)
            {
                lowerCase(spec);
                String name = (String) spec.remove("name");
                DistributionFactory population = !spec.containsKey("population") ? null : OptionDistribution.get((String) spec.remove("population"));
                DistributionFactory size = !spec.containsKey("size") ? null : OptionDistribution.get((String) spec.remove("size"));
                DistributionFactory clustering = !spec.containsKey("cluster") ? null : OptionDistribution.get((String) spec.remove("cluster"));

                if (!spec.isEmpty())
                    throw new IllegalArgumentException("Unrecognised option(s) in column spec: " + spec);
                if (name == null)
                    throw new IllegalArgumentException("Missing name argument in column spec");

                GeneratorConfig config = new GeneratorConfig(seedStr + name, clustering, size, population);
                columnConfigs.put(name, config);
            }
        }
    }

    public void maybeCreateSchema(StressSettings settings)
    {
        if (!schemaCreated)
        {
            JavaDriverClient client = settings.getJavaDriverClient();

            if (keyspaceCql != null)
            {
                try
                {
                    client.execute(keyspaceCql, org.apache.cassandra.db.ConsistencyLevel.ONE);

View on GitHub (pinned to 88fd0f6a0e)