{"record":{"id":"5bed07a03e224653","repo":"apache/druid","slug":"at-least-one-of-the-druid-enableplaintextport-or-d","errorCode":null,"errorMessage":"At least one of the druid.enablePlaintextPort or druid.enableTlsPort needs to be true.","messagePattern":"At least one of the druid\\.enablePlaintextPort or druid\\.enableTlsPort needs to be true\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/server/DruidNode.java","lineNumber":171,"sourceCode":"        labels\n    );\n  }\n\n  private void init(\n      String serviceName,\n      String host,\n      boolean bindOnHost,\n      Integer plainTextPort,\n      Integer tlsPort,\n      boolean enablePlaintextPort,\n      boolean enableTlsPort,\n      Map<String, String> labels\n  )\n  {\n    Preconditions.checkNotNull(serviceName);\n\n    if (!enableTlsPort && !enablePlaintextPort) {\n      throw new IAE(\"At least one of the druid.enablePlaintextPort or druid.enableTlsPort needs to be true.\");\n    }\n\n    this.enablePlaintextPort = enablePlaintextPort;\n    this.enableTlsPort = enableTlsPort;\n\n    final boolean nullHost = host == null;\n    HostAndPort hostAndPort;\n    Integer portFromHostConfig;\n    if (host != null) {\n      hostAndPort = HostAndPort.fromString(host);\n      host = hostAndPort.getHost();\n      portFromHostConfig = hostAndPort.hasPort() ? hostAndPort.getPort() : null;\n      if (plainTextPort != null && portFromHostConfig != null && !plainTextPort.equals(portFromHostConfig)) {\n        throw new IAE(\"Conflicting host:port [%s] and port [%d] settings\", host, plainTextPort);\n      }\n      if (portFromHostConfig != null) {\n        plainTextPort = portFromHostConfig;\n      }","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/server/DruidNode.java#L153-L189","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nruntime.properties:\n  druid.enablePlaintextPort=false\n  druid.enableTlsPort=false\n// after\n  druid.enablePlaintextPort=false\n  druid.enableTlsPort=true\n  druid.tlsPort=8281","handlingStrategy":"validation","validationCode":"Properties props = loadRuntimeProperties();\nboolean plain = Boolean.parseBoolean(props.getProperty(\"druid.enablePlaintextPort\", \"true\"));\nboolean tls = Boolean.parseBoolean(props.getProperty(\"druid.enableTlsPort\", \"false\"));\nif (!plain && !tls) {\n  throw new IllegalArgumentException(\"At least one of enablePlaintextPort/enableTlsPort must be true\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  node = new DruidNode(service, host, plain, port, tlsPort, false, false);\n} catch (IllegalArgumentException e) {\n  log.fatal(\"Node has no enabled listener port: %s\", e.getMessage());\n  System.exit(1);\n}","preventionTips":["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"],"tags":["configuration","startup","druid-node","ports"],"backgroundTag":"missing-required-config-field","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}