apache/druid · critical · ProvisionException

Must override the binding for ServerTypeConfig if you want…

Error message

Must override the binding for ServerTypeConfig if you want a DruidServerMetadata.

What it means

StorageNodeModule.getMetadata builds a DruidServerMetadata for storage nodes (historicals, middle managers) and requires a bound ServerTypeConfig. If the binding is absent (null), provisioning fails with this ProvisionException because the server type is needed to describe the node in the cluster.

Solutions

  1. Add a module that binds ServerTypeConfig with the appropriate ServerType (bind(ServerTypeConfig.class).toInstance(new ServerTypeConfig(ServerType.HISTORICAL)))
  2. Ensure the node type's module set (e.g. HistoricalModule) is present, since it installs the binding
  3. In tests, use StorageNodeModule with an override providing ServerTypeConfig

Example fix

// before
binder.install(new StorageNodeModule()); // no ServerTypeConfig
// after
binder.bind(ServerTypeConfig.class).toInstance(new ServerTypeConfig(ServerType.HISTORICAL));
binder.install(new StorageNodeModule());
Defensive patterns

Strategy: validation

Validate before calling

ServerTypeConfig stc = injector.getExistingBinding(Key.get(ServerTypeConfig.class)) == null ? null : injector.getInstance(ServerTypeConfig.class);
if (stc == null) { throw new IllegalStateException("bind ServerTypeConfig before installing StorageNodeModule"); }

Try / catch

try {
  injector.getInstance(DruidServerMetadata.class);
} catch (ProvisionException e) {
  if (e.getMessage().contains("ServerTypeConfig")) {
    log.error("Add a module binding ServerTypeConfig for this node type");
  }
  throw e;
}

Prevention

When it happens

Trigger: Running a node that includes StorageNodeModule without overriding the ServerTypeConfig binding (no ServerType configured, e.g. missing druid.server.type on the node type).

Common situations: Custom node types or test harnesses including StorageNodeModule without the ServerTypeConfig override; stripped-down configs for historicals that omit the server type extension.

Understand the failure class

Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/494a8a54e292d159. Report an issue: GitHub.

Appendix: source

Thrown at server/src/main/java/org/apache/druid/guice/StorageNodeModule.java:87

    JsonConfigProvider.bind(binder, "druid.segment.timeline", SegmentTimelineConfig.class);
    bindLocationSelectorStrategy(binder);
    binder.bind(ServerTypeConfig.class).toProvider(Providers.of(null));
    binder.bind(ColumnConfig.class).to(DruidProcessingConfig.class).in(LazySingleton.class);
    binder.bind(SegmentCacheManager.class).to(SegmentLocalCacheManager.class).in(LazySingleton.class);
    binder.bind(VirtualStorageManager.class).to(StorageLocationVirtualStorageManager.class).in(LazySingleton.class);
    MetricsModule.register(binder, StorageMonitor.class);
  }

  @Provides
  @LazySingleton
  public DruidServerMetadata getMetadata(
      @Self DruidNode node,
      @Nullable ServerTypeConfig serverTypeConfig,
      DruidServerConfig config
  )
  {
    if (serverTypeConfig == null) {
      throw new ProvisionException("Must override the binding for ServerTypeConfig if you want a DruidServerMetadata.");
    }

    return new DruidServerMetadata(
        node.getHostAndPortToUse(),
        node.getHostAndPort(),
        node.getHostAndTlsPort(),
        config.getMaxSize(),
        config.getStorageSize(),
        serverTypeConfig.getServerType(),
        config.getTier(),
        config.getPriority()
    );
  }

  @Provides
  @LazySingleton
  public DataNodeService getDataNodeService(
      @Nullable ServerTypeConfig serverTypeConfig,

View on GitHub (pinned to 9b90983fd2)