{
  "id": "communication/grpc-message-size-exceeded",
  "signature": "grpc::RpcError: message too large (exceeds 4 MB limit)",
  "signature_zh": "gRPC 错误：消息过大（超过 4 MB 限制）",
  "regex": "message too large|exceeds.*4 MB|grpc::RpcError.*message size",
  "domain": "communication",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "gRPC default maximum message size is 4 MB for both send and receive; any message exceeding this limit causes a RpcError.",
  "root_cause_type": "generic",
  "root_cause_zh": "gRPC 默认的最大消息大小为 4 MB（发送和接收均适用），任何超过此限制的消息都会导致 RpcError。",
  "versions": [
    {
      "version": "gRPC 1.48.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC 1.50.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC 1.54.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Server still enforces default limit, so server-side deserialization fails",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "gRPC compression reduces wire size but server still checks uncompressed size",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Streaming works but requires protocol change and breaks existing clients; not a direct fix",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase max message size on both client and server: server: server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.max_send_message_length', 10 * 1024 * 1024), ('grpc.max_receive_message_length', 10 * 1024 * 1024)]) client: channel = grpc.insecure_channel('localhost:50051', options=[('grpc.max_send_message_length', 10 * 1024 * 1024), ('grpc.max_receive_message_length', 10 * 1024 * 1024)])",
      "success_rate": 0.95,
      "how": "Increase max message size on both client and server: server: server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.max_send_message_length', 10 * 1024 * 1024), ('grpc.max_receive_message_length', 10 * 1024 * 1024)]) client: channel = grpc.insecure_channel('localhost:50051', options=[('grpc.max_send_message_length', 10 * 1024 * 1024), ('grpc.max_receive_message_length', 10 * 1024 * 1024)])",
      "condition": "",
      "sources": []
    },
    {
      "action": "Split the large payload into multiple smaller messages using client-side chunking, then reassemble on server",
      "success_rate": 0.85,
      "how": "Split the large payload into multiple smaller messages using client-side chunking, then reassemble on server",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use gRPC streaming (server-side or bidirectional) to send data in chunks without changing limits",
      "success_rate": 0.9,
      "how": "Use gRPC streaming (server-side or bidirectional) to send data in chunks without changing limits",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase max message size on both client and server: server: server = grpc.server(futures.ThreadPoolExecutor(max_workers=10), options=[('grpc.max_send_message_length', 10 * 1024 * 1024), ('grpc.max_receive_message_length', 10 * 1024 * 1024)]) client: channel = grpc.insecure_channel('localhost:50051', options=[('grpc.max_send_message_length', 10 * 1024 * 1024), ('grpc.max_receive_message_length', 10 * 1024 * 1024)])",
    "Split the large payload into multiple smaller messages using client-side chunking, then reassemble on server",
    "Use gRPC streaming (server-side or bidirectional) to send data in chunks without changing limits"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://grpc.io/docs/guides/performance/#message-size",
  "official_doc_section": null,
  "error_code": "RESOURCE_EXHAUSTED",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-04-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}