{
  "id": "communication/grpc-max-message-size-exceeded",
  "signature": "grpc::RPC_STATUS_RESOURCE_EXCEEDED: Received message larger than max (N vs. M)",
  "signature_zh": "grpc::RPC_STATUS_RESOURCE_EXCEEDED：接收到的消息大于最大值（N vs. M）",
  "regex": "Received message larger than max \\(\\d+ vs\\. \\d+\\)",
  "domain": "communication",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "gRPC message size exceeds the configured maximum (default 4 MB), causing server to reject the payload.",
  "root_cause_type": "generic",
  "root_cause_zh": "gRPC消息大小超过配置的最大值（默认4 MB），导致服务器拒绝该负载。",
  "versions": [
    {
      "version": "gRPC Go v1.62.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC Python v1.60.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC Java v1.61.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Compress the message with gzip at application level only",
      "why_fails": "gRPC already supports compression; double compression can cause overhead without fixing the size limit if the uncompressed size is checked.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase server memory or swap",
      "why_fails": "The error is a hard limit on message size, not a memory shortage; increasing memory does not change the limit.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase max message size on both client and server. In Go: server := grpc.NewServer(grpc.MaxRecvMsgSize(50*1024*1024)); conn, _ := grpc.Dial(address, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(50*1024*1024)))",
      "success_rate": 0.95,
      "how": "Increase max message size on both client and server. In Go: server := grpc.NewServer(grpc.MaxRecvMsgSize(50*1024*1024)); conn, _ := grpc.Dial(address, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(50*1024*1024)))",
      "condition": "",
      "sources": []
    },
    {
      "action": "Split large payloads into multiple smaller gRPC messages or use streaming (e.g., server-streaming RPC) to send chunks.",
      "success_rate": 0.9,
      "how": "Split large payloads into multiple smaller gRPC messages or use streaming (e.g., server-streaming RPC) to send chunks.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase max message size on both client and server. In Go: server := grpc.NewServer(grpc.MaxRecvMsgSize(50*1024*1024)); conn, _ := grpc.Dial(address, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(50*1024*1024)))",
    "Split large payloads into multiple smaller gRPC messages or use streaming (e.g., server-streaming RPC) to send chunks."
  ],
  "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": "8",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-08-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}