{"record":{"id":"16dc68d67a7c67db","repo":"apache/hadoop","slug":"no-services-to-connect-missing-namenode-address","errorCode":null,"errorMessage":"No services to connect, missing NameNode address.","messagePattern":"No services to connect, missing NameNode address\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolManager.java","lineNumber":166,"sourceCode":"  void refreshNamenodes(Configuration conf)\n      throws IOException {\n    LOG.info(\"Refresh request received for nameservices: \" +\n        conf.get(DFSConfigKeys.DFS_NAMESERVICES));\n\n    Map<String, Map<String, InetSocketAddress>> newAddressMap = null;\n    Map<String, Map<String, InetSocketAddress>> newLifelineAddressMap = null;\n\n    try {\n      newAddressMap =\n          DFSUtil.getNNServiceRpcAddressesForCluster(conf);\n      newLifelineAddressMap =\n          DFSUtil.getNNLifelineRpcAddressesForCluster(conf);\n    } catch (IOException ioe) {\n      LOG.warn(\"Unable to get NameNode addresses.\", ioe);\n    }\n\n    if (newAddressMap == null || newAddressMap.isEmpty()) {\n      throw new IOException(\"No services to connect, missing NameNode \" +\n          \"address.\");\n    }\n\n    synchronized (refreshNamenodesLock) {\n      doRefreshNamenodes(newAddressMap, newLifelineAddressMap);\n    }\n  }\n  \n  private void doRefreshNamenodes(\n      Map<String, Map<String, InetSocketAddress>> addrMap,\n      Map<String, Map<String, InetSocketAddress>> lifelineAddrMap)\n      throws IOException {\n    assert Thread.holdsLock(refreshNamenodesLock);\n\n    Set<String> toRefresh = new LinkedHashSet<>();\n    Set<String> toAdd = new LinkedHashSet<>();\n    Set<String> toRemove;\n    ","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolManager.java#L148-L184","documentation":"DataNode startup/reconfiguration (BlockPoolManager.refreshNamenodes) resolved zero NameNode service-RPC addresses from the configuration — DFSUtil.getNNServiceRpcAddressesForCluster returned null/empty (any lookup IOException was logged as a warning just above). With no endpoints the DN refuses to reconfigure its block pool connections.","triggerScenarios":"dfs.namenode.servicerpc-address (and its rpc-address fallback) unset for the nameservice(s); HA config missing dfs.ha.namenodes.<ns> or the per-NN addresses; dfs.nameservices/dfs.internal.nameservices empty or not matching the DN's config; unparsable hdfs-site.xml.","commonSituations":"DN installed with a minimal or NN-only hdfs-site.xml; federation configs where the DN's dfs.nameservices omits a namespace; typos in property suffixes (nameservice/NN names are case-sensitive).","solutions":["Set dfs.namenode.servicerpc-address.<ns>.<nn> (or at least dfs.namenode.rpc-address) for every NameNode this DN must serve","For HA, define dfs.ha.namenodes.<nameservice> plus both namenode RPC addresses","Confirm dfs.nameservices lists the namespaces and that the DN reads the same hdfs-site.xml you edited, then restart/reload the DN"],"exampleFix":"<!-- before -->\n<property><name>dfs.nameservices</name><value>ns1</value></property>\n<!-- no addresses -->\n\n<!-- after -->\n<property><name>dfs.namenode.servicerpc-address.ns1.nn1</name>\n  <value>nn1-host:8022</value></property>\n<property><name>dfs.namenode.servicerpc-address.ns1.nn2</name>\n  <value>nn2-host:8022</value></property>","handlingStrategy":"validation","validationCode":"Map<String, Map<String, InetSocketAddress>> addrs =\n    DFSUtil.getNNServiceRpcAddressesForCluster(conf);\nif (addrs == null || addrs.isEmpty()) {\n  throw new IllegalStateException(\n      \"No NameNode service RPC addresses found; set \"\n      + \"dfs.namenode.servicerpc-address.<ns>.<nn> and dfs.nameservices\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always configure dfs.namenode.servicerpc-address for every NameNode, not just the client-facing RPC address","For HA, define dfs.ha.namenodes.<nameservice> plus both per-NN addresses in the DN's hdfs-site.xml","Smoke-test config with `hdfs getconf -namenodes` (or an equivalent address dump) before starting DNs"],"tags":["hdfs","datanode","configuration","namenode","rpc-address"],"backgroundTag":"missing-rpc-address-config","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}