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 DataNodeService.
What it means
StorageNodeModule.getDataNodeService creates the DataNodeService advertised to the cluster and requires a bound ServerTypeConfig; if it is null, provisioning fails with this ProvisionException. Without the server type the node cannot describe its data-serving role.
Solutions
- Bind ServerTypeConfig in a module override for the node type
- Use the standard node-type module (e.g. HistoricalModule) which supplies the binding
- Set the node type correctly so the appropriate ServerTypeConfig extension module is loaded
Example fix
// before new StorageNodeModule() // DataNodeService provision fails // after binder.bind(ServerTypeConfig.class).toInstance(new ServerTypeConfig(ServerType.HISTORICAL));
Defensive patterns
Strategy: validation
Validate before calling
if (injector.getExistingBinding(Key.get(ServerTypeConfig.class)) == null) {
throw new IllegalStateException("ServerTypeConfig binding required for DataNodeService");
} Try / catch
try {
injector.getInstance(DataNodeService.class);
} catch (ProvisionException e) {
if (e.getMessage().contains("ServerTypeConfig")) {
log.error("Bind ServerTypeConfig in the node's module set");
}
throw e;
} Prevention
- Reuse standard node-type modules that supply ServerTypeConfig
- Cover custom node types with injector bootstrap tests
- Never install StorageNodeModule bare in tests without an override
When it happens
Trigger: Provisioning DataNodeService on a storage node where ServerTypeConfig was not overridden/bound; same root cause as the DruidServerMetadata check but hit when building the service.
Common situations: Custom/derived node types missing the ServerTypeConfig binding; minimal test setups including StorageNodeModule directly without overrides.
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
- Must override the binding for ServerTypeConfig if you want…
- At least one of the druid.enablePlaintextPort or…
- Config[ ] has been removed. Please use config[ ] instead.
- Dot at the end of property
- Double dot in property
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/ff3eab5cc2779212.
Report an issue: GitHub.
Appendix: source
Thrown at server/src/main/java/org/apache/druid/guice/StorageNodeModule.java:111
node.getHostAndTlsPort(),
config.getMaxSize(),
config.getStorageSize(),
serverTypeConfig.getServerType(),
config.getTier(),
config.getPriority()
);
}
@Provides
@LazySingleton
public DataNodeService getDataNodeService(
@Nullable ServerTypeConfig serverTypeConfig,
DruidServerConfig config,
@Named(IS_SEGMENT_CACHE_CONFIGURED) Boolean isSegmentCacheConfigured
)
{
if (serverTypeConfig == null) {
throw new ProvisionException("Must override the binding for ServerTypeConfig if you want a DataNodeService.");
}
if (!isSegmentCacheConfigured) {
log.info(
"Segment cache not configured on ServerType [%s]. It will not be assignable for segment placement",
serverTypeConfig.getServerType()
);
if (ServerType.HISTORICAL.equals(serverTypeConfig.getServerType())) {
throw new ProvisionException("druid.segmentCache.locations must be set on historicals.");
}
}
return new DataNodeService(
config.getTier(),
config.getMaxSize(),
config.getStorageSize(),
serverTypeConfig.getServerType(),
config.getPriority(),
isSegmentCacheConfiguredView on GitHub (pinned to 9b90983fd2)