{"record":{"id":"267c1fc285049b06","repo":"openzipkin/zipkin","slug":"autocompletecardinality-0","errorCode":null,"errorMessage":"autocompleteCardinality <= 0","messagePattern":"autocompleteCardinality <= 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java","lineNumber":89,"sourceCode":"    this.searchEnabled = searchEnabled;\n    return (B) this;\n  }\n\n  @Override public B autocompleteKeys(List<String> keys) {\n    if (keys == null) throw new NullPointerException(\"keys == null\");\n    this.autocompleteKeys = Set.copyOf(keys);\n    return (B) this;\n  }\n\n  @Override public B autocompleteTtl(int autocompleteTtl) {\n    if (autocompleteTtl <= 0) throw new IllegalArgumentException(\"autocompleteTtl <= 0\");\n    this.autocompleteTtl = autocompleteTtl;\n    return (B) this;\n  }\n\n  @Override public B autocompleteCardinality(int autocompleteCardinality) {\n    if (autocompleteCardinality <= 0) {\n      throw new IllegalArgumentException(\"autocompleteCardinality <= 0\");\n    }\n    this.autocompleteCardinality = autocompleteCardinality;\n    return (B) this;\n  }\n\n  /**\n   * Comma separated list of host addresses part of Cassandra cluster. You can also specify a custom\n   * port with 'host:port'. Defaults to localhost on port 9042 *\n   */\n  public B contactPoints(String contactPoints) {\n    if (contactPoints == null) throw new NullPointerException(\"contactPoints == null\");\n    this.contactPoints = contactPoints;\n    return (B) this;\n  }\n\n  /**\n   * Name of the datacenter that will be considered \"local\" for latency load balancing. When unset,\n   * load-balancing is round-robin.","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java#L71-L107","documentation":"CassandraStorageBuilder.autocompleteCardinality(int) throws IllegalArgumentException ('autocompleteCardinality <= 0') when a non-positive cardinality limit is configured for autocomplete values. This bounds how many distinct values per autocomplete key are kept; zero or negative would mean no values could ever be stored, so the builder fails fast.","triggerScenarios":"Calling autocompleteCardinality(0) or a negative number, or wiring an optional config property (zipkin.storage.cassandra.autocomplete-cardinality) that resolved to 0 because it was unset.","commonSituations":"Property omitted and mapped to Java int default 0; operators misreading the setting as a boolean/percentage; copy-paste from another storage module with different semantics.","solutions":["Set a positive cardinality, e.g. zipkin.storage.cassandra.autocomplete-cardinality=20000 (the documented default)","Fix config mapping so unset properties fall back to the default instead of 0","Only tune this when autocomplete value sets are very large"],"exampleFix":"# before\nzipkin.storage.cassandra.autocomplete-cardinality=0\n\n# after\nzipkin.storage.cassandra.autocomplete-cardinality=20000","handlingStrategy":"validation","validationCode":"int cardinality = config.getInt(\"autocompleteCardinality\", 20000);\nif (cardinality <= 0) throw new IllegalArgumentException(\"autocompleteCardinality must be positive\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bind optional numeric properties with non-zero defaults","Add config validation rules rejecting zero for capacity/limit settings"],"tags":["zipkin","cassandra","autocomplete","cardinality","configuration"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}