openzipkin/zipkin · error · IllegalArgumentException
autocompleteTtl <= 0
Error message
autocompleteTtl <= 0
What it means
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.
Source
Thrown at zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java:82
@Override public B strictTraceId(boolean strictTraceId) {
this.strictTraceId = strictTraceId;
return (B) this;
}
@Override public B searchEnabled(boolean searchEnabled) {
this.searchEnabled = searchEnabled;
return (B) this;
}
@Override public B autocompleteKeys(List<String> keys) {
if (keys == null) throw new NullPointerException("keys == null");
this.autocompleteKeys = Set.copyOf(keys);
return (B) this;
}
@Override public B autocompleteTtl(int autocompleteTtl) {
if (autocompleteTtl <= 0) throw new IllegalArgumentException("autocompleteTtl <= 0");
this.autocompleteTtl = autocompleteTtl;
return (B) this;
}
@Override public B autocompleteCardinality(int autocompleteCardinality) {
if (autocompleteCardinality <= 0) {
throw new IllegalArgumentException("autocompleteCardinality <= 0");
}
this.autocompleteCardinality = autocompleteCardinality;
return (B) this;
}
/**
* Comma separated list of host addresses part of Cassandra cluster. You can also specify a custom
* port with 'host:port'. Defaults to localhost on port 9042 *
*/
public B contactPoints(String contactPoints) {
if (contactPoints == null) throw new NullPointerException("contactPoints == null");View on GitHub (pinned to 878ce2a1fa)
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)
Example fix
# before zipkin.storage.cassandra.autocomplete-ttl=0 # or unset mapping to 0 # after # TTL is in milliseconds; 3600000 = 1 hour zipkin.storage.cassandra.autocomplete-ttl=3600000
Defensive patterns
Strategy: validation
Validate before calling
int ttlMs = config.getInt("autocompleteTtl", (int) TimeUnit.HOURS.toMillis(3));
if (ttlMs <= 0) throw new IllegalArgumentException("autocompleteTtl must be positive millis"); Prevention
- Give every optional numeric config an explicit positive default
- Remember Zipkin durations in Cassandra storage are milliseconds
When it happens
Trigger: 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).
Common situations: 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.
Related errors
AI-assisted analysis of openzipkin/zipkin@878ce2a1fa (2026-08-14).
Data as JSON: /api/errors/a791e2868503e293.
Report an issue: GitHub.