openzipkin/zipkin · error · NullPointerException

keys == null

Error message

keys == null

What it means

CassandraStorageBuilder.autocompleteKeys(List<String>) throws NullPointerException ('keys == null') when the autocomplete tag key list is set to null. These keys define which span tags are indexed for autocomplete in Cassandra; a null list has no meaningful interpretation, so the builder rejects it (an empty list is valid and disables autocomplete indexing).

Source

Thrown at zipkin-storage/cassandra/src/main/java/zipkin2/storage/cassandra/CassandraStorageBuilder.java:76

    return result;
  }

  CassandraStorageBuilder(String defaultKeyspace) {
    keyspace = defaultKeyspace;
  }

  @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;
  }

View on GitHub (pinned to 878ce2a1fa)

Solutions

  1. Pass an explicit list: autocompleteKeys(List.of("env", "site")), or an empty list to disable
  2. Default null config values to an empty list before calling the builder
  3. Check the property name spelling that populates the list

Example fix

// before
List<String> keys = config.get("autocompleteKeys"); // null when unset
builder.autocompleteKeys(keys);

// after
List<String> keys = config.getOrDefault("autocompleteKeys", List.of());
builder.autocompleteKeys(keys);
Defensive patterns

Strategy: validation

Validate before calling

List<String> keys = config.get("autocompleteKeys");
builder.autocompleteKeys(keys != null ? keys : List.of());

Prevention

When it happens

Trigger: Calling CassandraStorage.newBuilder().autocompleteKeys(null), or passing a config-derived list where the property was unset and resolved to null.

Common situations: Mapping an optional zipkin.storage.cassandra.autocomplete-keys property straight into the builder when the property is absent; refactoring that made the list @Nullable.

Related errors


AI-assisted analysis of openzipkin/zipkin@878ce2a1fa (2026-08-14). Data as JSON: /api/errors/09f94396048d6660. Report an issue: GitHub.