{
  "id": "go/grpc-resource-exhausted-max-message-size",
  "signature": "rpc error: code = ResourceExhausted desc = grpc: received message larger than max (5242881 vs. 4194304)",
  "signature_zh": "rpc 错误：code = ResourceExhausted desc = grpc: 接收到的消息超过最大值（5242881 vs. 4194304）",
  "regex": "rpc\\ error:\\ code\\ =\\ ResourceExhausted\\ desc\\ =\\ grpc:\\ received\\ message\\ larger\\ than\\ max\\ \\(5242881\\ vs\\.\\ 4194304\\)",
  "domain": "go",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The serialized message exceeds the default 4 MiB receive limit. gRPC enforces MaxRecvMsgSize on both client and server.",
  "root_cause_type": "generic",
  "root_cause_zh": "序列化后的消息超过了默认 4 MiB 的接收限制。gRPC 在客户端和服务端都强制 MaxRecvMsgSize。",
  "versions": [
    {
      "version": "1.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Compression reduces wire size but the decompressed message is still checked against MaxRecvMsgSize, so large payloads still fail.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The server also enforces the limit when receiving the request/response, so the error moves to the server side.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Raise the limit on both sides: grpc.NewServer(grpc.MaxRecvMsgSize(16*1024*1024)) and grpc.Dial(addr, grpc.WithDefaultCallOptions(grpc.MaxRecvMsgSize(16*1024*1024))).",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Switch large payloads to gRPC streaming (client-streaming or server-streaming) so each message stays small, or store blobs out-of-band and pass a reference.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}