{
  "id": "grpc/metadata-too-large",
  "signature": "INTERNAL: grpc: received metadata size exceeds limit",
  "signature_zh": "INTERNAL: grpc: 接收到的元数据大小超过限制",
  "regex": "INTERNAL: grpc: received metadata size exceeds limit",
  "domain": "grpc",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The gRPC metadata (headers/trailers) sent with an RPC exceeds the default size limit (usually 8 KB), often due to large authentication tokens or custom headers.",
  "root_cause_type": "generic",
  "root_cause_zh": "gRPC元数据（头部/尾部）的大小超过了默认限制（通常为8 KB），通常是由于大型身份验证令牌或自定义头部导致。",
  "versions": [
    {
      "version": "gRPC C++ 1.55+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC Java 1.55+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC .NET 2.50+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increasing max metadata size on client only",
      "why_fails": "Server still enforces its own limit; the error may persist if server limit is not also increased.",
      "fail_rate": 0.45,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing all custom headers",
      "why_fails": "May break authentication or routing logic that depends on headers.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase max metadata size on both client and server. In C++ server: builder.AddChannelArgument(GRPC_ARG_MAX_METADATA_SIZE, 16384); On client: grpc.InsecureChannelCredentials().SetMaxMetadataSize(16384)",
      "success_rate": 0.9,
      "how": "Increase max metadata size on both client and server. In C++ server: builder.AddChannelArgument(GRPC_ARG_MAX_METADATA_SIZE, 16384); On client: grpc.InsecureChannelCredentials().SetMaxMetadataSize(16384)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Move large data (e.g., tokens) to the message body instead of metadata. In Go: send token as first field in protobuf message and extract on server side.",
      "success_rate": 0.85,
      "how": "Move large data (e.g., tokens) to the message body instead of metadata. In Go: send token as first field in protobuf message and extract on server side.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase max metadata size on both client and server. In C++ server: builder.AddChannelArgument(GRPC_ARG_MAX_METADATA_SIZE, 16384); On client: grpc.InsecureChannelCredentials().SetMaxMetadataSize(16384)",
    "Move large data (e.g., tokens) to the message body instead of metadata. In Go: send token as first field in protobuf message and extract on server side."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://grpc.io/docs/guides/performance/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2024-03-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}