apache/hadoop · error · EOFException

Response is null.

Error message

Response is null.

What it means

Client.checkResponse validates the RPC response header; a null header means no response protobuf was decoded where one was mandatory. It throws EOFException("Response is null."), signalling the connection delivered EOF or desynchronized data before a complete header arrived — the server closed/dropped the connection mid-response or the stream ended prematurely.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java:308

  /**
   * Increment this client's reference count
   */
  void incCount() {
    refCount.incrementAndGet();
  }
  
  /**
   * Decrement this client's reference count
   */
  int decAndGetCount() {
    return refCount.decrementAndGet();
  }

  /** Check the rpc response header. */
  void checkResponse(RpcResponseHeaderProto header) throws IOException {
    if (header == null) {
      throw new EOFException("Response is null.");
    }
    if (header.hasClientId()) {
      // check client IDs
      final byte[] id = header.getClientId().toByteArray();
      if (!Arrays.equals(id, RpcConstants.DUMMY_CLIENT_ID)) {
        if (!Arrays.equals(id, clientId)) {
          throw new IOException("Client IDs not matched: local ID="
              + StringUtils.byteToHexString(clientId) + ", ID in response="
              + StringUtils.byteToHexString(header.getClientId().toByteArray()));
        }
      }
    }
  }

  Call createCall(RPC.RpcKind rpcKind, Writable rpcRequest) {
    return new Call(rpcKind, rpcRequest);
  }

View on GitHub (pinned to 2add963021)

Solutions

  1. Check the server logs at the same timestamp for the true cause (handler exception, shutdown, resource exhaustion).
  2. Retry idempotent operations — Hadoop RPC clients typically reconnect on next call; for application-level calls wrap with retry policy.
  3. Verify network path stability (firewall/NAT idle timeouts) for long-lived IPC connections.
  4. Align client and server Hadoop versions if the error is persistent and correlated with an upgrade.
Defensive patterns

Strategy: retry

Try / catch

try {
  call();
} catch (EOFException e) {
  if ("Response is null.".equals(e.getMessage())) {
    // connection ended mid-response; discard connection and retry once if the call is idempotent
    retryWithFreshConnection();
  } else { throw e; }
}

Prevention

When it happens

Trigger: Server closing the IPC connection while the client waits on a call (shutdown, OOM kill, RPC handler crash); network devices resetting long-lived connections; reading a response off a connection whose framing already desynced after a prior error; server-side 'too many open files' aborting the socket.

Common situations: NameNode/ResourceManager restarts under long-running clients; flaky NAT/firewall idle handling killing TCP; client and server exchanging data after a partial write; seen alongside RetriableException/reconnect logic in HDFS clients.

Related errors


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