{"record":{"id":"1da619a352828214","repo":"apache/hadoop","slug":"mount-table-not-initialized","errorCode":null,"errorMessage":"Mount Table not initialized","messagePattern":"Mount Table not initialized","errorType":"exception","errorClass":"StateStoreUnavailableException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MountTableResolver.java","lineNumber":562,"sourceCode":"  /**\n   * Get all the mount records at or beneath a given path.\n   * @param path Path to get the mount points from.\n   * @return List of mount table records under the path or null if the path is\n   *         not found.\n   * @throws IOException If it's not connected to the State Store.\n   */\n  public List<MountTable> getMounts(final String path) throws IOException {\n    verifyMountTable();\n    return getTreeValues(RouterAdmin.normalizeFileSystemPath(path), false);\n  }\n\n  /**\n   * Check if the Mount Table is ready to be used.\n   * @throws StateStoreUnavailableException If it cannot connect to the store.\n   */\n  private void verifyMountTable() throws StateStoreUnavailableException {\n    if (!this.init || disabled) {\n      throw new StateStoreUnavailableException(\"Mount Table not initialized\");\n    }\n  }\n\n  @Override\n  public String toString() {\n    readLock.lock();\n    try {\n      return this.tree.toString();\n    } finally {\n      readLock.unlock();\n    }\n  }\n\n  /**\n   * Build a location for this result beneath the discovered mount point.\n   *\n   * @param path Path to build for.\n   * @param entry Mount table entry.","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MountTableResolver.java#L544-L580","documentation":"MountTableResolver.verifyMountTable() guards every mount table query (getMounts, getMountPoint, etc.) and throws StateStoreUnavailableException('Mount Table not initialized') when this.init is false or the resolver is disabled. That state means the mount table cache has not been loaded from the state store yet — typically the router just started and the first cache refresh has not run, or initialization failed because the state store is unreachable.","triggerScenarios":"Any RPC hitting the router in the window between service start and the first successful mount table cache load; the state store (ZooKeeper/DB) going down so the resolver disabled itself; programmatic use of MountTableResolver without triggering loadCache/refresh first.","commonSituations":"Router restarts under load where clients reconnect faster than caches initialize; state store outages; routers parked in SAFEMODE; tools constructing the resolver directly against a state store.","solutions":["Check router state (hdfs dfsrouteradmin -status or the router UI) and let it leave SAFEMODE once caches load; then retry the request","Verify state store connectivity (ZooKeeper/DB) from the router host and look for StateStoreService errors in the logs","Fix the state store first if it is down — the mount table initializes on the next successful refresh","For programmatic use, call resolver.loadCache(true) or wait for initialization before querying"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Tooling/client: wait out the router's cache initialization with backoff\nfor (int i = 0; i < 10; i++) {\n  try {\n    return resolver.getMounts(path);\n  } catch (StateStoreUnavailableException e) {\n    Thread.sleep(1_000L << Math.min(i, 4)); // 1s,2s,4s... capped\n  }\n}\nthrow new IOException(\"mount table still uninitialized after retries\");","preventionTips":["Health-check routers (state ACTIVE, out of SAFEMODE) before routing traffic to them","Monitor state store availability and alert on prolonged SAFEMODE","In tools, trigger/await resolver cache load before the first query","Stagger router restarts so some routers stay ACTIVE for client retries"],"tags":["hadoop","rbf","router","state-store","startup","not-initialized"],"backgroundTag":"service-not-initialized","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}