openzipkin/zipkin · error · NullPointerException

settings == null

Error message

settings == null

What it means

MySQLStorage.Builder.settings throws NullPointerException when the jOOQ Settings argument is null. The Settings object configures the DSLContext (dialect quirks, render formatting) that every query is built with. The builder treats null as a caller bug and fails fast at configuration time.

Source

Thrown at zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/MySQLStorage.java:65

    @Override public Builder searchEnabled(boolean searchEnabled) {
      this.searchEnabled = searchEnabled;
      return this;
    }

    @Override public Builder autocompleteKeys(List<String> keys) {
      if (keys == null) throw new NullPointerException("keys == null");
      this.autocompleteKeys = keys;
      return this;
    }

    public Builder datasource(DataSource datasource) {
      if (datasource == null) throw new NullPointerException("datasource == null");
      this.datasource = datasource;
      return this;
    }

    public Builder settings(Settings settings) {
      if (settings == null) throw new NullPointerException("settings == null");
      this.settings = settings;
      return this;
    }

    public Builder listenerProvider(@Nullable ExecuteListenerProvider listenerProvider) {
      this.listenerProvider = listenerProvider;
      return this;
    }

    public Builder executor(Executor executor) {
      if (executor == null) throw new NullPointerException("executor == null");
      this.executor = executor;
      return this;
    }

    @Override public MySQLStorage build() {
      return new MySQLStorage(this);
    }

View on GitHub (pinned to 878ce2a1fa)

Solutions

  1. Pass new Settings() (jOOQ defaults) when no customization is needed.
  2. Guard at the call site: builder.settings(settings != null ? settings : new Settings()).
  3. Ensure the config mapper returns a default Settings instance instead of null.

Example fix

// before
builder.settings(maybeSettings); // maybeSettings is null

// after
builder.settings(maybeSettings != null ? maybeSettings : new Settings());
Defensive patterns

Strategy: validation

Validate before calling

builder.settings(settings != null ? settings : new Settings());

Prevention

When it happens

Trigger: Calling builder.settings(null), commonly from a helper that returns null when no custom jOOQ settings are configured.

Common situations: Optional jOOQ tuning plumbed through config that resolves to null when the tuning section is absent; upgrading jOOq or zipkin versions where a settings helper changed to return null instead of new Settings().

Related errors


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