{"record":{"id":"204e01feae0afa7b","repo":"apache/hadoop","slug":"namesystem-has-not-been-initialized-yet","errorCode":null,"errorMessage":"Namesystem has not been initialized yet.","messagePattern":"Namesystem has not been initialized yet\\.","errorType":"http","errorClass":"IOException","httpStatus":403,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java","lineNumber":290,"sourceCode":"  }\n\n  protected void queueExternalCall(ExternalCall call)\n      throws IOException, InterruptedException {\n    final NameNode namenode = (NameNode)context.getAttribute(\"name.node\");\n    namenode.queueExternalCall(call);\n  }\n\n  /**\n   * Chooses a Datanode to redirect a request to.\n   */\n  @VisibleForTesting\n  static DatanodeInfo chooseDatanode(final NameNode namenode,\n      final String path, final HttpOpParam.Op op, final long openOffset,\n      final long blocksize, final String excludeDatanodes,\n      final String remoteAddr, final HdfsFileStatus status) throws IOException {\n    FSNamesystem fsn = namenode.getNamesystem();\n    if (fsn == null) {\n      throw new IOException(\"Namesystem has not been initialized yet.\");\n    }\n    final BlockManager bm = fsn.getBlockManager();\n\n    Set<Node> excludes = new HashSet<>();\n    if (excludeDatanodes != null) {\n      for (String host : StringUtils\n          .getTrimmedStringCollection(excludeDatanodes)) {\n        int idx = host.indexOf(':');\n        Node excludeNode = null;\n        if (idx == -1) {\n          excludeNode = bm.getDatanodeManager().getDatanodeByHost(host);\n        } else {\n          excludeNode = bm.getDatanodeManager().getDatanodeByXferAddr(\n            host.substring(0, idx), Integer.parseInt(host.substring(idx + 1)));\n        }\n\n        if (excludeNode != null) {\n          excludes.add(excludeNode);","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java#L272-L308","documentation":"Error \"Namesystem has not been initialized yet.\" thrown in apache/hadoop.","triggerScenarios":"A WebHDFS request arrives before the FSNamesystem has been initialized.","commonSituations":"WebHDFS calls during NameNode boot, failover transition, or safemode.","solutions":["Retry after NameNode initialization completes; the namesystem is not ready yet."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}