{"record":{"id":"cada9340decd1c64","repo":"apache/hadoop","slug":"namenode-is-in-startup-mode","errorCode":null,"errorMessage":"Namenode is in startup mode","messagePattern":"Namenode is in startup mode","errorType":"exception","errorClass":"RetriableException","httpStatus":null,"severity":"warning","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java","lineNumber":523,"sourceCode":"   * @return {@link FSNamesystem} object.\n   */\n  public FSNamesystem getNamesystem() {\n    return namesystem;\n  }\n\n  public NamenodeProtocols getRpcServer() {\n    return rpcServer;\n  }\n\n  @VisibleForTesting\n  public HttpServer2 getHttpServer() {\n    return httpServer.getHttpServer();\n  }\n\n  public void queueExternalCall(ExternalCall<?> extCall)\n      throws IOException, InterruptedException {\n    if (rpcServer == null) {\n      throw new RetriableException(\"Namenode is in startup mode\");\n    }\n    rpcServer.getClientRpcServer().queueCall(extCall);\n  }\n\n  public static void initMetrics(Configuration conf, NamenodeRole role) {\n    metrics = NameNodeMetrics.create(conf, role);\n  }\n\n  public static NameNodeMetrics getNameNodeMetrics() {\n    return metrics;\n  }\n\n  /**\n   * Try to obtain the actual client info according to the current user.\n   * @param ipProxyUsers Users who can override client infos\n   */\n  private static String clientInfoFromContext(\n      final String[] ipProxyUsers) {","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java#L505-L541","documentation":"NameNode.queueExternalCall throws RetriableException('Namenode is in startup mode') when rpcServer is still null: the NameNode object exists but startCommonServices has not finished bringing up the client RPC server. RetriableException tells the calling framework (RetryProxy) that the failure is transient and the same call should be re-issued later, not surfaced to the user.","triggerScenarios":"Queueing an external call (RequestHedgingBroker/router-style external call path) in the window between NameNode construction and RPC server start, or against a standby NameNode where the client RPC server is not started.","commonSituations":"Clients firing requests immediately after the NN process starts; HA failover racing a NameNode restart; scripts that start the NN and instantly run jobs or admin commands against it.","solutions":["Retry the call: RetriableException is by design retryable; the client retry policy (ipc.Client / RetryProxy) will re-issue it once the NN is up.","Gate traffic on readiness: poll 'hdfs haadmin -getServiceStatus' or the JMX/RPC state until the NN reports active/standby-ready before issuing calls.","In HA clusters, ensure requests route through the configured failover proxy so they land on a ready NN."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// readiness gate before queueing external calls\nHAServiceProtocol proto = haServiceProtocolProxy;\nHAServiceStatus st = proto.getServiceStatus(); // throws until RPC server is up\nif (st.getState() != HAServiceState.ACTIVE) throw new IllegalStateException(\"NN not active yet\");","typeGuard":"boolean isStartupRetryable(Throwable t) {\n  return t instanceof org.apache.hadoop.ipc.RetriableException;\n}","tryCatchPattern":"catch (RetriableException e) {\n  // NN still in startup mode: honor the retry policy with backoff, do not surface to caller\n  retryWithBackoff(extCall, /*initial*/1_000L, /*max*/30_000L, TimeUnit.MILLISECONDS);\n}","preventionTips":["Gate client traffic on an active/ready service-state probe instead of a bare process check.","Configure generous client retry windows around NN restart windows (retry policy + ipc ping).","In HA, route through the failover proxy so a restarting NN is skipped automatically."],"tags":["hdfs","namenode","startup","retry","rpc"],"backgroundTag":"service-startup-retryable","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}