{"record":{"id":"9145f4a8d765efb4","repo":"apache/cassandra","slug":"op-name-s-contains-an-invalid-profile-specname","errorCode":null,"errorMessage":"Op name %s contains an invalid profile specname: %s","messagePattern":"Op name (.+?) contains an invalid profile specname: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommandUser.java","lineNumber":135,"sourceCode":"            protected List<? extends Operation> get(Timer timer, String key, boolean isWarmup)\n            {\n                Matcher m = EXTRACT_SPEC_CMD.matcher(key);\n                final String profile_name;\n                final String sub_key;\n                if (m.matches())\n                {\n                    profile_name = m.group(1);\n                    sub_key = m.group(2);\n                }\n                else\n                {\n                    profile_name = default_profile_name;\n                    sub_key = key;\n                }\n\n                if (!profiles.containsKey(profile_name))\n                {\n                    throw new IllegalArgumentException(String.format(\"Op name %s contains an invalid profile specname: %s\", key, profile_name));\n                }\n                StressProfile profile = profiles.get(profile_name);\n                TokenRangeIterator tokenRangeIterator = tokenRangeIterators.get(profile_name);\n                PartitionGenerator generator = profile.newGenerator(settings);\n                if (sub_key.equalsIgnoreCase(\"insert\"))\n                    return Collections.singletonList(profile.getInsert(timer, generator, seeds, settings));\n                if (sub_key.equalsIgnoreCase(\"validate\"))\n                    return profile.getValidate(timer, generator, seeds, settings);\n\n                if (profile.tokenRangeQueries.containsKey(sub_key))\n                    return Collections.singletonList(profile.getBulkReadQueries(sub_key, timer, settings, tokenRangeIterator, isWarmup));\n\n                return Collections.singletonList(profile.getQuery(sub_key, timer, generator, seeds, settings, isWarmup));\n            }\n        };\n    }\n\n    public void truncateTables(StressSettings settings)","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommandUser.java#L117-L153","documentation":"In the 'user' command, op names can be qualified as <profilename>.<op> to select operations from a specific loaded profile. When the qualifier before the dot doesn't match any loaded profile's specName, get() throws this IllegalArgumentException naming the op and the unrecognized profile name.","triggerScenarios":"Running 'cassandra-stress user profile=p.yaml ops(myprofile.insert=1)' where 'myprofile' is not the specName declared in the YAML (or no profile was loaded with that name); using a dot-qualified op name when the profile map only contains a different key.","commonSituations":"Using the filename (p.yaml) or table shorthand instead of the YAML's specName; editing the keyspace/table in the YAML after writing the ops() list; forgetting that unqualified names resolve to the default (first) profile but qualified names must match exactly.","solutions":["Use the exact specName from the YAML (keys.table) as the qualifier: ops(ks1.t1.insert=1).","Drop the qualifier to use the default profile: ops(insert=1).","Print/inspect specName in the YAML header and keep ops() arguments in sync with it.","Verify all profile= files were loaded (an earlier file-not-found may have removed the expected profile)."],"exampleFix":"// before (YAML declares keyspace: ks1, table: t1)\ncassandra-stress user profile=p.yaml ops(myp.insert=1)\n// after\ncassandra-stress user profile=p.yaml ops(ks1.t1.insert=1)","handlingStrategy":"validation","validationCode":"String specName = yamlSpecName(profileFile); // keys.table from YAML header\nfor (String op : opNames) { if (op.contains(\".\") && !op.startsWith(specName + \".\")) throw new IllegalArgumentException(\"op qualifier must be \" + specName); }","typeGuard":null,"tryCatchPattern":"try { /* build op distribution */ } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"invalid profile specname\")) { System.err.println(\"Use the YAML specName (keyspace.table) as qualifier\"); } throw e; }","preventionTips":["Keep ops() qualifiers in sync with the YAML keyspace.table declaration.","Omit the qualifier when targeting the first/default profile.","Regenerate ops() lists whenever the profile's specName changes."],"tags":["cli","configuration","naming"],"backgroundTag":"invalid-identifier","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"}