apache/hadoop · error · IOException

Namesystem has not been initialized yet.

Error message

Namesystem has not been initialized yet.

What it means

Error "Namesystem has not been initialized yet." thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/web/resources/NamenodeWebHdfsMethods.java:290

  }

  protected void queueExternalCall(ExternalCall call)
      throws IOException, InterruptedException {
    final NameNode namenode = (NameNode)context.getAttribute("name.node");
    namenode.queueExternalCall(call);
  }

  /**
   * Chooses a Datanode to redirect a request to.
   */
  @VisibleForTesting
  static DatanodeInfo chooseDatanode(final NameNode namenode,
      final String path, final HttpOpParam.Op op, final long openOffset,
      final long blocksize, final String excludeDatanodes,
      final String remoteAddr, final HdfsFileStatus status) throws IOException {
    FSNamesystem fsn = namenode.getNamesystem();
    if (fsn == null) {
      throw new IOException("Namesystem has not been initialized yet.");
    }
    final BlockManager bm = fsn.getBlockManager();

    Set<Node> excludes = new HashSet<>();
    if (excludeDatanodes != null) {
      for (String host : StringUtils
          .getTrimmedStringCollection(excludeDatanodes)) {
        int idx = host.indexOf(':');
        Node excludeNode = null;
        if (idx == -1) {
          excludeNode = bm.getDatanodeManager().getDatanodeByHost(host);
        } else {
          excludeNode = bm.getDatanodeManager().getDatanodeByXferAddr(
            host.substring(0, idx), Integer.parseInt(host.substring(idx + 1)));
        }

        if (excludeNode != null) {
          excludes.add(excludeNode);

View on GitHub (pinned to 2add963021)

Solutions

  1. Retry after NameNode initialization completes; the namesystem is not ready yet.

When it happens

Trigger: A WebHDFS request arrives before the FSNamesystem has been initialized.

Common situations: WebHDFS calls during NameNode boot, failover transition, or safemode.


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