{"record":{"id":"012329ac540cd7b3","repo":"apache/hadoop","slug":"response-is-null","errorCode":null,"errorMessage":"Response is null.","messagePattern":"Response is null\\.","errorType":"exception","errorClass":"EOFException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java","lineNumber":308,"sourceCode":"\n  /**\n   * Increment this client's reference count\n   */\n  void incCount() {\n    refCount.incrementAndGet();\n  }\n  \n  /**\n   * Decrement this client's reference count\n   */\n  int decAndGetCount() {\n    return refCount.decrementAndGet();\n  }\n\n  /** Check the rpc response header. */\n  void checkResponse(RpcResponseHeaderProto header) throws IOException {\n    if (header == null) {\n      throw new EOFException(\"Response is null.\");\n    }\n    if (header.hasClientId()) {\n      // check client IDs\n      final byte[] id = header.getClientId().toByteArray();\n      if (!Arrays.equals(id, RpcConstants.DUMMY_CLIENT_ID)) {\n        if (!Arrays.equals(id, clientId)) {\n          throw new IOException(\"Client IDs not matched: local ID=\"\n              + StringUtils.byteToHexString(clientId) + \", ID in response=\"\n              + StringUtils.byteToHexString(header.getClientId().toByteArray()));\n        }\n      }\n    }\n  }\n\n  Call createCall(RPC.RpcKind rpcKind, Writable rpcRequest) {\n    return new Call(rpcKind, rpcRequest);\n  }\n","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java#L290-L326","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the server logs at the same timestamp for the true cause (handler exception, shutdown, resource exhaustion).","Retry idempotent operations — Hadoop RPC clients typically reconnect on next call; for application-level calls wrap with retry policy.","Verify network path stability (firewall/NAT idle timeouts) for long-lived IPC connections.","Align client and server Hadoop versions if the error is persistent and correlated with an upgrade."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  call();\n} catch (EOFException e) {\n  if (\"Response is null.\".equals(e.getMessage())) {\n    // connection ended mid-response; discard connection and retry once if the call is idempotent\n    retryWithFreshConnection();\n  } else { throw e; }\n}","preventionTips":["Keep retry policies enabled for HDFS/IPC clients so dropped connections self-heal.","Monitor server health (memory, fd count, handler crashes) at the moment these appear.","Check firewall/NAT idle timeouts for long-lived RPC connections.","Correlate with server logs before assuming a client bug."],"tags":["hadoop","ipc","rpc-client","network","eof","connection-drop"],"backgroundTag":"eof-connection-closed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}