{"record":{"id":"e5350c77e7da20e2","repo":"apache/hadoop","slug":"cannot-get-a-connection-to","errorCode":null,"errorMessage":"Cannot get a connection to {}","messagePattern":"Cannot get a connection to (.+?)","errorType":"exception","errorClass":"ConnectionNullException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java","lineNumber":442,"sourceCode":"      // for each individual request.\n\n      // TODO Add tokens from the federated UGI\n      UserGroupInformation connUGI = ugi;\n      if (UserGroupInformation.isSecurityEnabled() || this.enableProxyUser) {\n        UserGroupInformation routerUser = UserGroupInformation.getLoginUser();\n        connUGI = UserGroupInformation.createProxyUser(\n            ugi.getUserName(), routerUser);\n      }\n      connection = this.connectionManager.getConnection(\n          connUGI, rpcAddress, proto, nsId);\n      LOG.debug(\"User {} NN {} is using connection {}\",\n          ugi.getUserName(), rpcAddress, connection);\n    } catch (Exception ex) {\n      LOG.error(\"Cannot open NN client to address: {}\", rpcAddress, ex);\n    }\n\n    if (connection == null) {\n      throw new ConnectionNullException(\"Cannot get a connection to \"\n          + rpcAddress);\n    }\n    return connection;\n  }\n\n  /**\n   * Convert an exception to an IOException.\n   *\n   * For a non-IOException, wrap it with IOException. For a RemoteException,\n   * unwrap it. For an IOException which is not a RemoteException, return it.\n   *\n   * @param e Exception to convert into an exception.\n   * @return Created IO exception.\n   */\n  private static IOException toIOException(Exception e) {\n    if (e instanceof RemoteException) {\n      return ((RemoteException) e).unwrapRemoteException();\n    }","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java#L424-L460","documentation":"Error \"Cannot get a connection to {}\" thrown in apache/hadoop.","triggerScenarios":"RouterRpcClient failed to create an RPC connection/proxy to the given namenode address.","commonSituations":"Namenode down, wrong RPC address in federation config, expired Kerberos ticket, or network partition between Router and a subcluster.","solutions":["Verify the target namenode RPC address is correct and the namenode is running and reachable from the Router.","Check Kerberos credentials/token validity on the Router for the target nameservice.","Confirm network/firewall rules allow the Router to reach the namenode RPC port."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}