{"record":{"id":"2de0f7abfd14097b","repo":"apache/cassandra","slug":"unrecognised-insert-option-s-insert","errorCode":null,"errorMessage":"Unrecognised insert option(s): ${insert}","messagePattern":"Unrecognised insert option\\(s\\): (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tools/stress/src/org/apache/cassandra/stress/StressProfile.java","lineNumber":663,"sourceCode":"                        {\n                            sb.append(quoteIdentifier(c.getName())).append(\", \");\n                            value.append(\"?, \");\n                        }\n                        sb.delete(sb.lastIndexOf(\",\"), sb.length());\n                        value.delete(value.lastIndexOf(\",\"), value.length());\n                        sb.append(\") \").append(\"values(\").append(value).append(')');\n                    }\n\n                    partitions = select(settings.insert.batchsize, \"partitions\", \"fixed(1)\", insert, OptionDistribution.BUILDER);\n                    selectchance = select(settings.insert.selectRatio, \"select\", \"fixed(1)/1\", insert, OptionRatioDistribution.BUILDER);\n                    rowPopulation = select(settings.insert.rowPopulationRatio, \"row-population\", \"fixed(1)/1\", insert, OptionRatioDistribution.BUILDER);\n                    batchType = settings.insert.batchType != null\n                                ? settings.insert.batchType\n                                : !insert.containsKey(\"batchtype\")\n                                  ? BatchStatement.Type.LOGGED\n                                  : BatchStatement.Type.valueOf(insert.remove(\"batchtype\"));\n                    if (!insert.isEmpty())\n                        throw new IllegalArgumentException(\"Unrecognised insert option(s): \" + insert);\n\n                    Distribution visits = settings.insert.visits.get();\n                    // these min/max are not absolutely accurate if selectchance < 1, but they're close enough to\n                    // guarantee the vast majority of actions occur in these bounds\n                    double minBatchSize = selectchance.get().min() * partitions.get().minValue() * generator.minRowCount * (1d / visits.maxValue());\n                    double maxBatchSize = selectchance.get().max() * partitions.get().maxValue() * generator.maxRowCount * (1d / visits.minValue());\n\n                    if (generator.maxRowCount > 100 * 1000 * 1000)\n                        System.err.printf(\"WARNING: You have defined a schema that permits very large partitions (%.0f max rows (>100M))%n\", generator.maxRowCount);\n                    if (batchType == BatchStatement.Type.LOGGED && maxBatchSize > 65535)\n                    {\n                        System.err.printf(\"ERROR: You have defined a workload that generates batches with more than 65k rows (%.0f), but have required the use of LOGGED batches. There is a 65k row limit on a single batch.%n\",\n                                          selectchance.get().max() * partitions.get().maxValue() * generator.maxRowCount);\n                        System.exit(1);\n                    }\n                    if (maxBatchSize > 100000)\n                        System.err.printf(\"WARNING: You have defined a schema that permits very large batches (%.0f max rows (>100K)). This may OOM this stress client, or the server.%n\",\n                                          selectchance.get().max() * partitions.get().maxValue() * generator.maxRowCount);","sourceCodeStart":645,"sourceCodeEnd":681,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/stress/src/org/apache/cassandra/stress/StressProfile.java#L645-L681","documentation":"getInsert parses per-insert options from the YAML/insert spec. Recognized keys are consumed (e.g. batchtype); any remaining keys cause this IllegalArgumentException listing the leftovers. It rejects unknown insert options to surface config mistakes immediately.","triggerScenarios":"Calling getInsert with settings/spec containing insert options other than the supported ones (partitions, selectchance, batchtype, visits, etc.), e.g. misspelled 'batch' instead of 'batchtype' or unsupported keys like 'row-count'.","commonSituations":"Older/other-version option names (option names changed across Cassandra releases), typos, mixing 'user profile' insert options with legacy cassandra-stress insert options.","solutions":["Remove or rename the unrecognized keys listed in the message; check supported insert options for this Cassandra version (visits, partitions, selectchance, batchtype, ...)","Fix common typos (batchtype vs batchtype casing/keys)","Cross-check the option names against the version's documentation or OptionInsert help","Test with a minimal insert spec, then add options incrementally"],"exampleFix":"# before\ninsert:\n  batch: LOGGED\n# after\ninsert:\n  batchtype: LOGGED","handlingStrategy":"validation","validationCode":"// allow only supported insert option keys\nSet<String> allowed = Set.of(\"partitions\",\"selectchance\",\"batchtype\",\"visits\",\"ratelimit\",\"threads\",\"rows\");\ninsert.keySet().forEach(k -> { if (!allowed.contains(k)) throw new IllegalArgumentException(\"bad insert option: \" + k); });","typeGuard":null,"tryCatchPattern":"try { profile.getInsert(...); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unrecognised insert option\")) log.error(\"Remove/rename: {}\", e.getMessage()); throw e; }","preventionTips":["Check option names against your Cassandra version's docs (names changed across releases)","Add insert options incrementally and smoke-test","Avoid mixing legacy cassandra-stress insert options with user-profile options"],"tags":["configuration","cassandra-stress","yaml"],"backgroundTag":"invalid-config-value","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"}