apache/hadoop · error · IllegalArgumentException

Invalid registration, no block pool specified {}

Error message

Invalid registration, no block pool specified {}

What it means

MembershipState.validate() requires a block pool id unless the membership is in a 'bad' state — isBadState() is true only for EXPIRED or UNAVAILABLE. For an ACTIVE/STANDBY/OBSERVER registration, an empty blockPoolId throws IllegalArgumentException(ERROR_MSG_NO_BP_SPECIFIED + this). The BPID comes from the Namenode at registration and identifies the namespace's block pool to the Router.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/records/MembershipState.java:259

   */
  @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);
  }

  /**
   * Sort by nameservice, namenode, and router.
   *

View on GitHub (pinned to 2add963021)

Solutions

  1. When building MembershipState in code, set the block pool id obtained from the Namenode (.getBlockPoolId of the NNInfo) alongside nsId/rpc/web addresses.
  2. Prefer the automatic heartbeat path — it fills the BPID from the real Namenode.
  3. If the record is stale, mark it EXPIRED/UNAVAILABLE or remove it, since bad states are exempt from the BPID requirement.
  4. Check the record dump in the message for the state and missing field.

Example fix

// before: live-state registration without BPID
m.setNameserviceId("ns1");
m.setRpcAddress("nn1:8020");
m.setWebAddress("nn1:9870");
m.setState(ACTIVE);
store.put(m); // throws: no block pool specified

// after: include the block pool id from the Namenode
m.setBlockPoolId("BP-1542879483-10.1.1.1-1680000000000");
store.put(m);
Defensive patterns

Strategy: validation

Validate before calling

// BPID is required for live states; EXPIRED/UNAVAILABLE are exempt
if (!m.isBadStateFlag() /* state != EXPIRED && != UNAVAILABLE */
    && (m.getBlockPoolId() == null || m.getBlockPoolId().isEmpty())) {
  throw new IllegalArgumentException("block pool id required for state " + m.getState());
}

Type guard

boolean passesBpidRule(MembershipState m) {
  FederationNamenodeServiceState s = m.getState();
  if (s == FederationNamenodeServiceState.EXPIRED
      || s == FederationNamenodeServiceState.UNAVAILABLE) {
    return true; // exempt
  }
  return m.getBlockPoolId() != null && !m.getBlockPoolId().isEmpty();
}

Try / catch

try {
  store.put(membership);
} catch (IllegalArgumentException e) {
  if (e.getMessage().contains("no block pool specified")) {
    // either fetch the BPID from the Namenode, or mark the record EXPIRED/UNAVAILABLE
    throw new IllegalStateException("Registration missing block pool id for live state", e);
  }
  throw e;
}

Prevention

When it happens

Trigger: Registering a membership in a live state (ACTIVE/STANDBY/OBSERVER) without setBlockPoolId: programmatic registrations or migrations that omitted it; a resolver/heartbeat that could not obtain the BPID from the Namenode. Note the code first calls getBlockPoolId().isEmpty() — a null BPID can NPE before this message, so an empty string is the classic trigger.

Common situations: Custom tooling/tests writing membership records with only addresses; state store row migrations dropping the bpId column; heartbeats from configurations where the BPID lookup failed. EXPIRED/UNAVAILABLE members intentionally bypass this check.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/f4a967016720137e. Report an issue: GitHub.