apache/hadoop · error · StandbyException

Router is in safe mode and cannot handle requests

Error message

Router {} is in safe mode and cannot handle {} requests

What it means

Router safe-mode gate: the Router is still in safe mode (cache not warmed or state store unavailable) and cannot serve the operation category; a StandbyException is thrown so HA clients retry another router or later.

Solutions

  1. Wait for the Router to leave safe mode (it exits automatically after startup checks/State Store sync).
  2. Check Router logs for why safe mode persists (State Store unavailable, mount table load failures).
  3. Manually leave safe mode via the Router admin command only after verifying state consistency.
Defensive patterns

Strategy: retry

When it happens

Trigger: A client request reached the Router while it is in safe mode and the request type is blocked in safe mode.

Common situations: Clients hitting the Router immediately after startup/restart before it finishes initialization.


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

Appendix: source

Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java:884

    if (op == OperationCategory.UNCHECKED || op == OperationCategory.READ) {
      return;
    }
    checkSafeMode();
  }

  /**
   * Check if the Router is in safe mode.
   * @throws StandbyException If the Router is in safe mode and cannot serve
   *                          client requests.
   */
  private void checkSafeMode() throws StandbyException {
    if (isSafeMode()) {
      // Throw standby exception, router is not available
      if (rpcMonitor != null) {
        rpcMonitor.routerFailureSafemode();
      }
      OperationCategory op = opCategory.get();
      throw new StandbyException("Router " + router.getRouterId() +
          " is in safe mode and cannot handle " + op + " requests");
    }
  }

  /**
   * Return true if the Router is in safe mode.
   *
   * @return true if the Router is in safe mode.
   */
  boolean isSafeMode() {
    RouterSafemodeService safemodeService = router.getSafemodeService();
    return (safemodeService != null && safemodeService.isInSafeMode());
  }

  /**
   * Get the name of the method that is calling this function.
   *
   * @return Name of the method calling this function.

View on GitHub (pinned to 2add963021)