{
  "id": "grpc/grpc-invalid-message-encoding",
  "signature": "INTERNAL: grpc: invalid message encoding \"custom-enc\"",
  "signature_zh": "内部错误：gRPC：无效的消息编码 \"custom-enc\"",
  "regex": "invalid message encoding \"[^\"]+\"",
  "domain": "grpc",
  "category": "encoding_error",
  "subcategory": null,
  "root_cause": "Client or server sends a message with a custom Content-Encoding or Message-Encoding that the peer does not support.",
  "root_cause_type": "generic",
  "root_cause_zh": "客户端或服务器发送了带有对端不支持的 Content-Encoding 或 Message-Encoding 的消息。",
  "versions": [
    {
      "version": "gRPC v1.63.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC v1.60.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC v1.57.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Go gRPC v1.62.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding the encoding to server's supported list without implementing the codec",
      "why_fails": "The server will accept the encoding but fail to decompress, causing DATA_LOSS.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disabling all compression on the client",
      "why_fails": "The error is about unrecognized encoding, not compression being enabled.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Register a custom codec on both client and server using the same name, e.g., via `grpc.RegisterCompressor` or `WithDefaultCallOptions(grpc.UseCompressor('custom-enc'))`.",
      "success_rate": 0.9,
      "how": "Register a custom codec on both client and server using the same name, e.g., via `grpc.RegisterCompressor` or `WithDefaultCallOptions(grpc.UseCompressor('custom-enc'))`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Fall back to standard gRPC compression (gzip) by removing the custom encoding from the client's call options.",
      "success_rate": 0.8,
      "how": "Fall back to standard gRPC compression (gzip) by removing the custom encoding from the client's call options.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在客户端和服务器上使用相同名称注册自定义编解码器，例如通过 `grpc.RegisterCompressor` 或 `WithDefaultCallOptions(grpc.UseCompressor('custom-enc'))`。",
    "通过从客户端调用选项中移除自定义编码，回退到标准 gRPC 压缩（gzip）。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://grpc.io/docs/guides/compression/#custom-compression",
  "official_doc_section": null,
  "error_code": "EENC",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}