apache/hadoop · error · IOException

Bad connect ack, targets={} status={}

Error message

Bad connect ack, targets={} status={}

What it means

Error "Bad connect ack, targets={} status={}" thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java:3143

        blockSender.sendBlock(out, unbufOut, throttler);

        // no response necessary
        LOG.info("{}, at {}: Transmitted {} (numBytes={}) to {}",
            getClass().getSimpleName(), DataNode.this.getDisplayName(),
            b, b.getNumBytes(), curTarget);

        // read ack
        if (isClient) {
          DNTransferAckProto closeAck = DNTransferAckProto.parseFrom(
              PBHelperClient.vintPrefixed(in));
          LOG.debug("{}: close-ack={}", getClass().getSimpleName(), closeAck);
          if (closeAck.getStatus() != Status.SUCCESS) {
            if (closeAck.getStatus() == Status.ERROR_ACCESS_TOKEN) {
              throw new InvalidBlockTokenException(
                  "Got access token error for connect ack, targets="
                   + Arrays.asList(targets));
            } else {
              throw new IOException("Bad connect ack, targets="
                  + Arrays.asList(targets) + " status=" + closeAck.getStatus());
            }
          }
        } else {
          metrics.incrBlocksReplicated();
        }
      } catch (IOException ie) {
        handleBadBlock(b, ie, false);
        LOG.warn("{}:Failed to transfer {} to {} got",
            bpReg, b, targets[0], ie);
      } catch (Throwable t) {
        LOG.error("Failed to transfer block {}", b, t);
      } finally {
        decrementXmitsInProgress();
        IOUtils.closeStream(blockSender);
        IOUtils.closeStream(out);
        IOUtils.closeStream(in);
        IOUtils.closeSocket(sock);

View on GitHub (pinned to 2add963021)

Solutions

  1. Check the status code in the message against DataTransferProtocol statuses; address the reported cause on the target DataNode (e.g., ERROR_ACCESS_TOKEN, ERROR_UNSUPPORTED_OPERATION).
  2. Verify client and DataNode versions and security configuration are consistent across the pipeline.

When it happens

Trigger: A downstream DataNode in a write pipeline replies to the connect request with a non-SUCCESS status.

Common situations: A downstream DataNode returned a bad status on connect ack during pipeline setup. Inspect the target DataNode logs for the underlying error.


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