{"record":{"id":"2c632d6c56c471fc","repo":"apache/druid","slug":"port-must-be-between-1-and-65535","errorCode":null,"errorMessage":"port must be between 1 and 65535","messagePattern":"port must be between 1 and 65535","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java","lineNumber":260,"sourceCode":"      this.socketTimeout = validatePositive(socketTimeout, DEFAULT_SOCKET_TIMEOUT_MS, \"socketTimeout\");\n      this.sslClientConfig = sslClientConfig;\n      this.maxTotalConnections = validateConnectionPoolSize(\n          maxTotalConnections,\n          DEFAULT_MAX_TOTAL_CONNECTIONS,\n          \"maxTotalConnections\"\n      );\n      this.maxConnectionsPerRoute = validateConnectionPoolSize(\n          maxConnectionsPerRoute,\n          DEFAULT_MAX_CONNECTIONS_PER_ROUTE,\n          \"maxConnectionsPerRoute\"\n      );\n    }\n\n    private static int validatePort(Integer port)\n    {\n      int portValue = port == null ? 8500 : port;\n      if (portValue < 1 || portValue > 65535) {\n        throw new IllegalArgumentException(\"port must be between 1 and 65535\");\n      }\n      return portValue;\n    }\n\n    private static int validateConnectionPoolSize(Integer value, int defaultValue, String name)\n    {\n      int result = value == null ? defaultValue : value;\n      if (result <= 0) {\n        throw new IAE(name + \" must be positive\");\n      }\n      return result;\n    }\n\n    @JsonProperty\n    public String getHost()\n    {\n      return host;\n    }","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java#L242-L278","documentation":"Generic input validation inside ConsulDiscoveryConfig's private validatePort helper: the configured consul port property parsed to a value outside the valid TCP port range 1-65535. This is a configuration-time validation error — fix the port value in the consul discovery config properties and restart.","triggerScenarios":"Thrown at extensions-contrib/consul-extensions/src/main/java/org/apache/druid/consul/discovery/ConsulDiscoveryConfig.java:260 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set connection.port to a value between 1 and 65535 (default Consul agent port 8500).","Remove the port property to use the 8500 default."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}