{
  "id": "grpc/grpc-connection-reset-by-peer",
  "signature": "UNAVAILABLE: grpc: connection error: connection reset by peer",
  "signature_zh": "UNAVAILABLE: grpc: 连接错误: 连接被对端重置",
  "regex": "UNAVAILABLE: grpc: connection error: connection reset by peer",
  "domain": "grpc",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The TCP connection was reset by the remote peer due to a crash, timeout, or firewall interference.",
  "root_cause_type": "generic",
  "root_cause_zh": "TCP 连接被远程对端重置，原因可能是崩溃、超时或防火墙干扰。",
  "versions": [
    {
      "version": "gRPC v1.42.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC v1.55.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC v1.61.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Connection reset is not a timeout issue; longer timeouts won't prevent the peer from resetting the connection.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "TLS is not the cause; disabling it reduces security without fixing the reset.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The server or network issue persists; client restart doesn't address the root cause.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Configure the server to handle graceful shutdown and increase idle timeout. Example in Go: server := grpc.NewServer(grpc.KeepaliveParams(keepalive.ServerParameters{MaxConnectionIdle: 5 * time.Minute}))",
      "success_rate": 0.75,
      "how": "Configure the server to handle graceful shutdown and increase idle timeout. Example in Go: server := grpc.NewServer(grpc.KeepaliveParams(keepalive.ServerParameters{MaxConnectionIdle: 5 * time.Minute}))",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a connection pool with retry logic. In Python, use grpc.aio with automatic reconnection: channel = grpc.aio.insecure_channel('localhost:50051'); await channel.channel_ready()",
      "success_rate": 0.8,
      "how": "Use a connection pool with retry logic. In Python, use grpc.aio with automatic reconnection: channel = grpc.aio.insecure_channel('localhost:50051'); await channel.channel_ready()",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check firewall or load balancer settings for idle connection timeouts. Increase TCP keepalive settings on both client and server (e.g., net.ipv4.tcp_keepalive_time=600).",
      "success_rate": 0.7,
      "how": "Check firewall or load balancer settings for idle connection timeouts. Increase TCP keepalive settings on both client and server (e.g., net.ipv4.tcp_keepalive_time=600).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Configure the server to handle graceful shutdown and increase idle timeout. Example in Go: server := grpc.NewServer(grpc.KeepaliveParams(keepalive.ServerParameters{MaxConnectionIdle: 5 * time.Minute}))",
    "Use a connection pool with retry logic. In Python, use grpc.aio with automatic reconnection: channel = grpc.aio.insecure_channel('localhost:50051'); await channel.channel_ready()",
    "Check firewall or load balancer settings for idle connection timeouts. Increase TCP keepalive settings on both client and server (e.g., net.ipv4.tcp_keepalive_time=600)."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://grpc.io/docs/guides/error-handling/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.76,
  "resolvable": "true",
  "first_seen": "2023-09-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}