{"record":{"id":"f0ac6e13e264842c","repo":"apache/hadoop","slug":"could-not-find-any-configured-addresses-for-uri","errorCode":null,"errorMessage":"Could not find any configured addresses for URI {}","messagePattern":"Could not find any configured addresses for URI (.+?)","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/AbstractNNFailoverProxyProvider.java","lineNumber":203,"sourceCode":"            this.getClass().getSimpleName(), pi.address, ioe);\n        throw new RuntimeException(ioe);\n      }\n    }\n    return pi;\n  }\n\n  /**\n   * Get list of configured NameNode proxy addresses.\n   * Randomize the list if requested.\n   */\n  protected List<NNProxyInfo<T>> getProxyAddresses(URI uri, String addressKey) {\n    final List<NNProxyInfo<T>> proxies = new ArrayList<NNProxyInfo<T>>();\n    Map<String, Map<String, InetSocketAddress>> map =\n        DFSUtilClient.getAddresses(conf, null, addressKey);\n    Map<String, InetSocketAddress> addressesInNN = map.get(uri.getHost());\n\n    if (addressesInNN == null || addressesInNN.size() == 0) {\n      throw new RuntimeException(\"Could not find any configured addresses \" +\n          \"for URI \" + uri);\n    }\n\n    Collection<InetSocketAddress> addressesOfNns = addressesInNN.values();\n    try {\n      addressesOfNns = getResolvedHostsIfNecessary(addressesOfNns, uri);\n    } catch (IOException e) {\n      throw new RuntimeException(e);\n    }\n    for (InetSocketAddress address : addressesOfNns) {\n      proxies.add(new NNProxyInfo<T>(address));\n    }\n    // Randomize the list to prevent all clients pointing to the same one\n    boolean randomized = getRandomOrder(conf, uri);\n    if (randomized) {\n      Collections.shuffle(proxies);\n    }\n","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/server/namenode/ha/AbstractNNFailoverProxyProvider.java#L185-L221","documentation":"HA proxy providers (ConfiguredFailoverProxyProvider and subclasses) resolve NameNode addresses for the logical URI's nameservice via DFSUtilClient.getAddresses over keys such as dfs.ha.namenodes.<ns>.rpc-address. When the returned map has no entry for the URI host, the client has no HA address config for that nameservice and getProxyAddresses throws RuntimeException during proxy provider construction - before any RPC.","triggerScenarios":"FileSystem.get on hdfs://ns1/... where dfs.nameservices / dfs.ha.namenodes.ns1.<nn> address keys are absent from the client Configuration; or the URI authority is a nameservice id that is misspelled relative to the configured one.","commonSituations":"Client core-site.xml missing the HA block; HADOOP_CONF_DIR pointing at the wrong config directory; using a logical URI while only physical dfs.namenode.rpc-address entries exist; nameservice typos (ns1 vs prod-ns).","solutions":["Add the full HA block: dfs.nameservices=<ns>, dfs.ha.namenodes.<ns>=nn1,nn2, dfs.ha.namenodes.<ns>.nn1=<host:port>, dfs.ha.namenodes.<ns>.nn2=<host:port>, dfs.client.failover.proxy.provider.<ns>=org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider","Verify the URI authority matches the configured nameservice id exactly","Point HADOOP_CONF_DIR (or the Configuration resources) at the cluster's real config directory"],"exampleFix":"<!-- before: only nameservice referenced, no HA entries -->\n\n<!-- after: add to core-site.xml -->\n<property>\n  <name>dfs.nameservices</name>\n  <value>ns1</value>\n</property>\n<property>\n  <name>dfs.ha.namenodes.ns1</name>\n  <value>nn1,nn2</value>\n</property>\n<property>\n  <name>dfs.ha.namenodes.ns1.nn1</name>\n  <value>nn1.example.com:8020</value>\n</property>\n<property>\n  <name>dfs.ha.namenodes.ns1.nn2</name>\n  <value>nn2.example.com:8020</value>\n</property>\n<property>\n  <name>dfs.client.failover.proxy.provider.ns1</name>\n  <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>\n</property>","handlingStrategy":"validation","validationCode":"String ns = uri.getHost();\nif (conf.get(\"dfs.ha.namenodes.\" + ns) == null) {\n  throw new IllegalArgumentException(\n      \"No HA configuration for nameservice '\" + ns\n      + \"' - check dfs.nameservices and dfs.ha.namenodes.\" + ns + \" entries\");\n}\nFileSystem fs = FileSystem.get(uri, conf);","typeGuard":null,"tryCatchPattern":"catch (RuntimeException e) with message containing \"Could not find any configured addresses\": fail startup with a config checklist instead of retrying.","preventionTips":["Smoke-test FileSystem.get(logicalUri) at application startup with a clear config error","Keep the HA block (nameservices, ha.namenodes, addresses, provider) as one templated unit","Verify HADOOP_CONF_DIR points at the cluster config in all runtime environments"],"tags":["hdfs","high-availability","nameservice","configuration","client-setup"],"backgroundTag":"missing-ha-nameservice-config","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}