{
  "id": "dotnet/grpc-client-max-message-size",
  "signature": "Grpc.Core.RpcException: Status(StatusCode=\"ResourceExhausted\", Detail=\"Received message larger than max (4194304 vs. 4194304)\")",
  "signature_zh": "Grpc.Core.RpcException: 状态(StatusCode=\"ResourceExhausted\", Detail=\"接收的消息大于最大值(4194304 vs. 4194304)\")",
  "regex": "Status\\(StatusCode=\"ResourceExhausted\".*Received message larger than max",
  "domain": "dotnet",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "The gRPC client or server has a default maximum message size of 4 MB, and the response payload exceeds this limit, causing the channel to reject it.",
  "root_cause_type": "generic",
  "root_cause_zh": "gRPC客户端或服务器默认最大消息大小为4 MB，响应负载超过此限制，导致通道拒绝。",
  "versions": [
    {
      "version": ".NET 6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": ".NET 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": ".NET 8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Grpc.Net.Client 2.49+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Grpc.AspNetCore 2.49+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increasing the client's MaxReceiveMessageSize without adjusting the server's MaxSendMessageSize",
      "why_fails": "Both client and server enforce limits; if only one side is increased, the other side still rejects the message.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disabling compression on the gRPC channel to reduce message size",
      "why_fails": "Compression reduces size but does not eliminate the hard limit; large payloads still exceed 4 MB.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase MaxReceiveMessageSize on the client and MaxSendMessageSize on the server to a larger value (e.g., 10 MB) in the gRPC channel and service options.",
      "success_rate": 0.95,
      "how": "Increase MaxReceiveMessageSize on the client and MaxSendMessageSize on the server to a larger value (e.g., 10 MB) in the gRPC channel and service options.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Stream the large payload using server-streaming gRPC instead of unary calls to avoid hitting the message size limit.",
      "success_rate": 0.85,
      "how": "Stream the large payload using server-streaming gRPC instead of unary calls to avoid hitting the message size limit.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase MaxReceiveMessageSize on the client and MaxSendMessageSize on the server to a larger value (e.g., 10 MB) in the gRPC channel and service options.",
    "Stream the large payload using server-streaming gRPC instead of unary calls to avoid hitting the message size limit."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://learn.microsoft.com/en-us/aspnet/core/grpc/configuration?view=aspnetcore-8.0#configure-maximum-message-size",
  "official_doc_section": null,
  "error_code": "ResourceExhausted",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-02-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}