{
  "id": "go/grpc-internal-error-codec-mismatch",
  "signature": "rpc error: code = Internal desc = grpc: error while unmarshaling: proto: cannot parse invalid wire-format data",
  "signature_zh": "rpc错误：代码=内部错误 描述=grpc：解组时出错：proto：无法解析无效的线格式数据",
  "regex": "rpc\\ error:\\ code\\ =\\ Internal\\ desc\\ =\\ grpc:\\ error\\ while\\ unmarshaling:\\ proto:\\ cannot\\ parse\\ invalid\\ wire\\-format\\ data",
  "domain": "go",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "The server received data that is not valid protobuf, often due to codec mismatch or data corruption.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器接收到无效的protobuf数据，通常是由于编解码器不匹配或数据损坏。",
  "versions": [
    {
      "version": "1.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Assume the data is fine and retry.",
      "why_fails": "If the data is malformed, retrying will produce the same error.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "Change the protobuf schema without regenerating code.",
      "why_fails": "The server and client must use the same schema; manual changes cause incompatibility.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure both client and server use the same protobuf version and schema.",
      "success_rate": 0.9,
      "how": "Run 'protoc --go_out=. --go-grpc_out=. *.proto' on both sides and rebuild.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add logging to inspect the raw bytes received.",
      "success_rate": 0.7,
      "how": "Use a server interceptor to log incoming data for debugging:\nfunc loggingInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {\n    log.Printf(\"request: %v\", req)\n    return handler(ctx, req)\n}",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-08-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}