{"record":{"id":"a791e2868503e293","repo":"openzipkin/zipkin","slug":"autocompletettl-0","errorCode":null,"errorMessage":"autocompleteTtl <= 0","messagePattern":"autocompleteTtl <= 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java","lineNumber":82,"sourceCode":"\n  @Override public B strictTraceId(boolean strictTraceId) {\n    this.strictTraceId = strictTraceId;\n    return (B) this;\n  }\n\n  @Override public B searchEnabled(boolean searchEnabled) {\n    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\");","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java#L64-L100","documentation":"CassandraStorageBuilder.autocompleteTtl(int) throws IllegalArgumentException ('autocompleteTtl <= 0') when a non-positive TTL is configured for autocomplete tag entries. The TTL controls how long autocomplete rows live in Cassandra before expiring; zero or negative values are meaningless for a Cassandra TTL and would disable cleanup semantics, so the builder rejects them.","triggerScenarios":"Calling autocompleteTtl(0) or autocompleteTtl(-1), or computing the TTL from a config duration that was unset and defaulted to 0 (e.g. property missing -> int default 0).","commonSituations":"Optional duration properties (autocomplete-ttl) absent from config and unboxed to 0; unit conversion bugs turning days into 0 after integer division; passing seconds where milliseconds were expected in a long->int conversion.","solutions":["Set a positive TTL in milliseconds, e.g. autocompleteTtl((int) TimeUnit.HOURS.toMillis(1)) — note the builder default is 3h in ms","Fix the property resolution so an unset value falls back to the documented default rather than 0","Check unit conversions (store ms; ensure you don't pass seconds)"],"exampleFix":"# before\nzipkin.storage.cassandra.autocomplete-ttl=0   # or unset mapping to 0\n\n# after\n# TTL is in milliseconds; 3600000 = 1 hour\nzipkin.storage.cassandra.autocomplete-ttl=3600000","handlingStrategy":"validation","validationCode":"int ttlMs = config.getInt(\"autocompleteTtl\", (int) TimeUnit.HOURS.toMillis(3));\nif (ttlMs <= 0) throw new IllegalArgumentException(\"autocompleteTtl must be positive millis\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give every optional numeric config an explicit positive default","Remember Zipkin durations in Cassandra storage are milliseconds"],"tags":["zipkin","cassandra","autocomplete","ttl","configuration"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}