{"record":{"id":"a383d3d79241c1ee","repo":"apache/hadoop","slug":"invalid-registration-no-rpc-address-specified","errorCode":null,"errorMessage":"Invalid registration, no rpc address specified {}","messagePattern":"Invalid registration, no rpc address specified (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/records/MembershipState.java","lineNumber":254,"sourceCode":"  }\n\n  /**\n   * Validates the entry. Throws an IllegalArgementException if the data record\n   * is missing required information.\n   */\n  @Override\n  public void validate() {\n    super.validate();\n    if (getNameserviceId() == null || getNameserviceId().length() == 0) {\n      throw new IllegalArgumentException(\n          ERROR_MSG_NO_NS_SPECIFIED + this);\n    }\n    if (getWebAddress() == null || getWebAddress().length() == 0) {\n      throw new IllegalArgumentException(\n          ERROR_MSG_NO_WEB_ADDR_SPECIFIED + this);\n    }\n    if (getRpcAddress() == null || getRpcAddress().length() == 0) {\n      throw new IllegalArgumentException(\n          ERROR_MSG_NO_RPC_ADDR_SPECIFIED + this);\n    }\n    if (!isBadState() &&\n        (getBlockPoolId().isEmpty() || getBlockPoolId().length() == 0)) {\n      throw new IllegalArgumentException(\n          ERROR_MSG_NO_BP_SPECIFIED + this);\n    }\n  }\n\n\n  /**\n   * Overrides the cached getBlockPoolId() with an update. The state will be\n   * reset when the cache is flushed\n   *\n   * @param newState Service state of the namenode.\n   */\n  public void overrideState(FederationNamenodeServiceState newState) {\n    this.setState(newState);","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/records/MembershipState.java#L236-L272","documentation":"MembershipState.validate() requires a non-empty RPC address; getRpcAddress() null or empty throws IllegalArgumentException(ERROR_MSG_NO_RPC_ADDR_SPECIFIED + this). The RPC address is the primary endpoint the Router forwards client calls to, so a membership without it is unusable and rejected before reaching the state store.","triggerScenarios":"A registration or programmatic MembershipState put where the Namenode RPC address is unset: NN's dfs.namenode.servicerpc-address/rpc-address misconfigured so the heartbeat registers an empty address; custom resolver failing to translate the NN's RPC address; test/tool code skipping setRpcAddress.","commonSituations":"Namenode in a federation whose rpc/servicerpc address properties are missing or 0.0.0.0 without a routable value; custom ActiveNamenodeResolver implementations; hand-built records in integration tests.","solutions":["Configure dfs.namenode.servicerpc-address (preferred) or dfs.namenode.rpc-address on the Namenode so heartbeats carry a concrete host:port.","Set setRpcAddress(...) when constructing membership records in code.","Use the record dump in the exception message to confirm which fields are empty.","Delete the malformed membership record and let a corrected heartbeat re-register."],"exampleFix":"// before\nm.setNameserviceId(\"ns1\");\nm.setWebAddress(\"nn1:9870\");\nstore.put(m); // throws: no rpc address specified\n\n// after\nm.setNameserviceId(\"ns1\");\nm.setRpcAddress(\"nn1:8020\");\nm.setWebAddress(\"nn1:9870\");\nstore.put(m);","handlingStrategy":"validation","validationCode":"if (m.getRpcAddress() == null || m.getRpcAddress().isEmpty()) {\n  throw new IllegalArgumentException(\n      \"rpc address required (configure dfs.namenode.servicerpc-address on the NN)\");\n}","typeGuard":"boolean hasRpcAddress(MembershipState m) {\n  return m.getRpcAddress() != null && !m.getRpcAddress().isEmpty();\n}","tryCatchPattern":"try {\n  store.put(membership);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"no rpc address specified\")) {\n    throw new IllegalStateException(\"Registration missing RPC address; check NN rpc config\", e);\n  }\n  throw e;\n}","preventionTips":["Set dfs.namenode.servicerpc-address (or dfs.namenode.rpc-address) to a routable host:port on all federated NNs.","Validate address fields in federation tools before writing membership records.","Prefer automatic heartbeats over manual registration so the real NN endpoints are used."],"tags":["hdfs","router-based-federation","state-store","membership","record-validation"],"backgroundTag":"invalid-service-registration","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}