apache/druid · error · IllegalArgumentException
At least one of the druid.enablePlaintextPort or druid.enabl
Error message
At least one of the druid.enablePlaintextPort or druid.enableTlsPort needs to be true.
What it means
DruidNode's init() validates that a node exposes at least one listener port. If both druid.enablePlaintextPort and druid.enableTlsPort are set to false, the node has no way to accept connections, so an IllegalArgumentException is thrown at startup.
Source
Thrown at server/src/main/java/org/apache/druid/server/DruidNode.java:171
labels
);
}
private void init(
String serviceName,
String host,
boolean bindOnHost,
Integer plainTextPort,
Integer tlsPort,
boolean enablePlaintextPort,
boolean enableTlsPort,
Map<String, String> labels
)
{
Preconditions.checkNotNull(serviceName);
if (!enableTlsPort && !enablePlaintextPort) {
throw new IAE("At least one of the druid.enablePlaintextPort or druid.enableTlsPort needs to be true.");
}
this.enablePlaintextPort = enablePlaintextPort;
this.enableTlsPort = enableTlsPort;
final boolean nullHost = host == null;
HostAndPort hostAndPort;
Integer portFromHostConfig;
if (host != null) {
hostAndPort = HostAndPort.fromString(host);
host = hostAndPort.getHost();
portFromHostConfig = hostAndPort.hasPort() ? hostAndPort.getPort() : null;
if (plainTextPort != null && portFromHostConfig != null && !plainTextPort.equals(portFromHostConfig)) {
throw new IAE("Conflicting host:port [%s] and port [%d] settings", host, plainTextPort);
}
if (portFromHostConfig != null) {
plainTextPort = portFromHostConfig;
}View on GitHub (pinned to 9b90983fd2)
Solutions
- Set druid.enableTlsPort=true and configure druid.tlsPort for TLS-only deployments
- Set druid.enablePlaintextPort=true if plaintext HTTP is desired
- Review node runtime.properties to ensure at least one enable flag is true
Example fix
// before runtime.properties: druid.enablePlaintextPort=false druid.enableTlsPort=false // after druid.enablePlaintextPort=false druid.enableTlsPort=true druid.tlsPort=8281
Defensive patterns
Strategy: validation
Validate before calling
Properties props = loadRuntimeProperties();
boolean plain = Boolean.parseBoolean(props.getProperty("druid.enablePlaintextPort", "true"));
boolean tls = Boolean.parseBoolean(props.getProperty("druid.enableTlsPort", "false"));
if (!plain && !tls) {
throw new IllegalArgumentException("At least one of enablePlaintextPort/enableTlsPort must be true");
} Try / catch
try {
node = new DruidNode(service, host, plain, port, tlsPort, false, false);
} catch (IllegalArgumentException e) {
log.fatal("Node has no enabled listener port: %s", e.getMessage());
System.exit(1);
} Prevention
- Never set both enablePlaintextPort and enableTlsPort to false
- For TLS-only nodes, explicitly set enableTlsPort=true and druid.tlsPort
- Validate node runtime.properties in config CI before deployment
- Keep a per-role config checklist including port enable flags
When it happens
Trigger: Setting druid.enablePlaintextPort=false and druid.enableTlsPort=false (e.g. druid.server.http.enable... disabled or explicit enable flags both false) in a node's runtime.properties.
Common situations: Operators disabling plaintext for TLS-only deployments but also forgetting to enable the TLS port; templated configs where enable flags resolve to false on all nodes.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- Conflicting host:port [%s] and port [%d] settings
- plaintextPort and tlsPort cannot be null or same if both htt
- A valid tlsPort needs to specified when druid.enableTlsPort
- The gRPC query server requires either a Basic or Anonymous a
- Set only one of 'key' or 'sharedAccessStorageToken' or 'useA
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/5bed07a03e224653.
Report an issue: GitHub.