{"record":{"id":"c722661ad4db438c","repo":"apache/hadoop","slug":"unknown-scheme-for-endpoint","errorCode":null,"errorMessage":"unknown scheme for endpoint:{}","messagePattern":"unknown scheme for endpoint:(.+?)","errorType":"exception","errorClass":"HadoopIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java","lineNumber":586,"sourceCode":"      server.loadListeners();\n      return server;\n    }\n\n    @VisibleForTesting\n    HttpServer2 addConnectors(\n        URI ep, InetAddress[] addresses, HttpServer2 server,\n        HttpConfiguration httpConfig, int backlogSize, int idleTimeout){\n      for (InetAddress addr : addresses) {\n        ServerConnector connector;\n        String scheme = ep.getScheme();\n        if (HTTP_SCHEME.equals(scheme)) {\n          connector = createHttpChannelConnector(\n              server.webServer, httpConfig);\n        } else if (HTTPS_SCHEME.equals(scheme)) {\n          connector = createHttpsChannelConnector(\n              server.webServer, httpConfig);\n        } else {\n          throw new HadoopIllegalArgumentException(\n              \"unknown scheme for endpoint:\" + ep);\n        }\n        LOG.debug(\"Adding connector to WebServer for address {}\",\n            addr.getHostAddress());\n        connector.setHost(addr.getHostAddress());\n        connector.setPort(ep.getPort() == -1 ? 0 : ep.getPort());\n        connector.setAcceptQueueSize(backlogSize);\n        connector.setIdleTimeout(idleTimeout);\n        server.addListener(connector);\n      }\n      return server;\n    }\n\n    private ServerConnector createHttpChannelConnector(\n        Server server, HttpConfiguration httpConfig) {\n      ServerConnector conn = new ServerConnector(server,\n          conf.getInt(HTTP_ACCEPTOR_COUNT_KEY, HTTP_ACCEPTOR_COUNT_DEFAULT),\n          conf.getInt(HTTP_SELECTOR_COUNT_KEY, HTTP_SELECTOR_COUNT_DEFAULT));","sourceCodeStart":568,"sourceCodeEnd":604,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java#L568-L604","documentation":"While constructing listeners, HttpServer2 maps each endpoint URI's scheme to a connector type: 'http' gets a plain ServerConnector, 'https' an SSL connector, and anything else throws HadoopIllegalArgumentException (an IllegalArgumentException) with the full endpoint. A URI with no scheme (null) also fails, since neither branch matches.","triggerScenarios":"HttpServer2.Builder.addEndpoint(URI.create(\"host:8088\")) with no scheme; a config address like 'hdfs://nn:9870' or 'ftp://...' fed into a web UI address property; a hand-built URI whose scheme string is misspelled ('htp').","commonSituations":"Custom services embedding HttpServer2 and passing raw host:port strings; configuration migrations where a HA/RPC-style address got copied into a *-http-address / webapp address key.","solutions":["Prefix the endpoint with a scheme the server supports: http://host:port (or https:// when TLS is configured)","Check the exact URI being printed in the exception and fix the source property or addEndpoint call","If https was intended, ensure the SSL configuration path (ssl-server.xml etc.) is in place so the https branch is usable"],"exampleFix":"// before\nbuilder.addEndpoint(URI.create(\"namenode:9870\"));\n\n// after\nbuilder.addEndpoint(URI.create(\"http://namenode:9870\"));","handlingStrategy":"validation","validationCode":"URI ep = URI.create(addr);\nString scheme = ep.getScheme() == null ? null : ep.getScheme().toLowerCase(Locale.ROOT);\nif (!(\"http\".equals(scheme) || \"https\".equals(scheme))) {\n  throw new ConfigValidationException(\"endpoint must start with http:// or https://: \" + addr);\n}\nbuilder.addEndpoint(ep);","typeGuard":null,"tryCatchPattern":"try {\n  builder.addEndpoint(URI.create(addr));\n} catch (HadoopIllegalArgumentException e) {\n  // message prints the endpoint: fix the config key that supplied it\n  throw new ConfigValidationException(\"bad web address, need scheme: \" + addr, e);\n}","preventionTips":["Always write web UI addresses with an explicit scheme in config and code","Validate address strings once at config load instead of deep inside server construction","Remember URI schemes are lowercased by java.net.URI; do not rely on case tricks"],"tags":["hadoop","http-server","jetty","uri","configuration"],"backgroundTag":"invalid-endpoint-uri-scheme","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}