apache/hadoop · error · IllegalArgumentException
Invalid registration, no rpc address specified {}
Error message
Invalid registration, no rpc address specified {} What it means
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.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/records/MembershipState.java:254
}
/**
* Validates the entry. Throws an IllegalArgementException if the data record
* is missing required information.
*/
@Override
public void validate() {
super.validate();
if (getNameserviceId() == null || getNameserviceId().length() == 0) {
throw new IllegalArgumentException(
ERROR_MSG_NO_NS_SPECIFIED + this);
}
if (getWebAddress() == null || getWebAddress().length() == 0) {
throw new IllegalArgumentException(
ERROR_MSG_NO_WEB_ADDR_SPECIFIED + this);
}
if (getRpcAddress() == null || getRpcAddress().length() == 0) {
throw new IllegalArgumentException(
ERROR_MSG_NO_RPC_ADDR_SPECIFIED + this);
}
if (!isBadState() &&
(getBlockPoolId().isEmpty() || getBlockPoolId().length() == 0)) {
throw new IllegalArgumentException(
ERROR_MSG_NO_BP_SPECIFIED + this);
}
}
/**
* Overrides the cached getBlockPoolId() with an update. The state will be
* reset when the cache is flushed
*
* @param newState Service state of the namenode.
*/
public void overrideState(FederationNamenodeServiceState newState) {
this.setState(newState);View on GitHub (pinned to 2add963021)
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.
Example fix
// before
m.setNameserviceId("ns1");
m.setWebAddress("nn1:9870");
store.put(m); // throws: no rpc address specified
// after
m.setNameserviceId("ns1");
m.setRpcAddress("nn1:8020");
m.setWebAddress("nn1:9870");
store.put(m); Defensive patterns
Strategy: validation
Validate before calling
if (m.getRpcAddress() == null || m.getRpcAddress().isEmpty()) {
throw new IllegalArgumentException(
"rpc address required (configure dfs.namenode.servicerpc-address on the NN)");
} Type guard
boolean hasRpcAddress(MembershipState m) {
return m.getRpcAddress() != null && !m.getRpcAddress().isEmpty();
} Try / catch
try {
store.put(membership);
} catch (IllegalArgumentException e) {
if (e.getMessage().contains("no rpc address specified")) {
throw new IllegalStateException("Registration missing RPC address; check NN rpc config", e);
}
throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Invalid registration, no nameservice specified {}
- Invalid registration, no web address specified {}
- Invalid registration, no block pool specified {}
- The creation time for the record cannot be negative.
- The modification time for the record cannot be negative.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/a383d3d79241c1ee.
Report an issue: GitHub.