apache/hadoop · error · IOException

Unable to create new block.

Error message

Unable to create new block.

What it means

Error "Unable to create new block." thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java:1865

        LOG.warn("Exception in setupPipelineForCreate " + this, ie);
        success = false;
      }
      if (!success) {
        LOG.warn("Abandoning " + block);
        dfsClient.namenode.abandonBlock(block.getCurrentBlock(),
            stat.getFileId(), src, dfsClient.clientName);
        block.setCurrentBlock(null);
        final DatanodeInfo badNode = errorState.getBadNodeIndex() == -1
              ? Iterables.getLast(failed)
              : nodes[errorState.getBadNodeIndex()];
        LOG.warn("Excluding datanode " + badNode);
        excludedNodes.put(badNode, badNode);
        setPipeline(null, null, null);
      }
    } while (!success && --count >= 0);

    if (!success) {
      throw new IOException("Unable to create new block.");
    }
  }

  // connects to the first datanode in the pipeline
  // Returns true if success, otherwise return failure.
  //
  boolean createBlockOutputStream(DatanodeInfo[] nodes,
      StorageType[] nodeStorageTypes, String[] nodeStorageIDs,
      long newGS, boolean recoveryFlag) {
    if (nodes.length == 0) {
      LOG.info("nodes are empty for write pipeline of " + block);
      return false;
    }
    String firstBadLink = "";
    boolean checkRestart = false;
    if (LOG.isDebugEnabled()) {
      LOG.debug("pipeline = " + Arrays.toString(nodes) + ", " + this);
    }

View on GitHub (pinned to 2add963021)

Solutions

  1. Check NameNode logs for block allocation failures (no space, no live DataNodes, safemode).
  2. Verify enough DataNodes are live and have free storage via hdfs dfsadmin -report.
  3. Check dfs.replication vs number of available DataNodes and adjust if the cluster is too small.

When it happens

Trigger: The client asks the NameNode to allocate a new block during a write or append, and the allocation fails (for example NameNode error, safemode, or no usable DataNodes), so the streamer cannot proceed.

Common situations: See trigger scenarios.


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