{
  "id": "kafka/network-exception-read-timeout",
  "signature": "org.apache.kafka.common.errors.NetworkException: The server disconnected before a response was received. Timeout: 30000 ms",
  "signature_zh": "org.apache.kafka.common.errors.NetworkException: 服务器在收到响应前断开连接。超时时间：30000 毫秒",
  "regex": "NetworkException.*The server disconnected before a response was received",
  "domain": "kafka",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "Kafka broker closed the TCP connection before sending a response, often due to request timeout or network congestion between client and broker.",
  "root_cause_type": "generic",
  "root_cause_zh": "Kafka 代理在发送响应前关闭了 TCP 连接，通常是由于请求超时或客户端与代理之间的网络拥塞。",
  "versions": [
    {
      "version": "kafka_2.13-3.3.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "kafka_2.13-3.4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "kafka_2.13-3.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The timeout is on the broker side; increasing client timeout does not prevent the broker from disconnecting.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Network issues (e.g., firewall, TCP keepalive) persist after reboot; the error recurs on the next request.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling socket timeout can cause resource exhaustion and does not address the root cause of disconnection.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase `broker.request.timeout.ms` in `server.properties` (e.g., from 30000 to 60000) and restart the broker to allow longer processing time for slow requests.",
      "success_rate": 0.8,
      "how": "Increase `broker.request.timeout.ms` in `server.properties` (e.g., from 30000 to 60000) and restart the broker to allow longer processing time for slow requests.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Enable TCP keepalive on both client and broker: set `socket.connection.setup.timeout.ms=10000` and `socket.connection.setup.timeout.max.ms=30000` in `server.properties`, and on the client set `connections.max.idle.ms=300000`.",
      "success_rate": 0.85,
      "how": "Enable TCP keepalive on both client and broker: set `socket.connection.setup.timeout.ms=10000` and `socket.connection.setup.timeout.max.ms=30000` in `server.properties`, and on the client set `connections.max.idle.ms=300000`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using a load balancer, check idle timeout settings (e.g., AWS NLB idle timeout) and increase them to match Kafka's `connections.max.idle.ms`.",
      "success_rate": 0.9,
      "how": "If using a load balancer, check idle timeout settings (e.g., AWS NLB idle timeout) and increase them to match Kafka's `connections.max.idle.ms`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase `broker.request.timeout.ms` in `server.properties` (e.g., from 30000 to 60000) and restart the broker to allow longer processing time for slow requests.",
    "Enable TCP keepalive on both client and broker: set `socket.connection.setup.timeout.ms=10000` and `socket.connection.setup.timeout.max.ms=30000` in `server.properties`, and on the client set `connections.max.idle.ms=300000`.",
    "If using a load balancer, check idle timeout settings (e.g., AWS NLB idle timeout) and increase them to match Kafka's `connections.max.idle.ms`."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kafka.apache.org/documentation/#networking",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2023-06-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}