{
  "id": "go/grpc-protobuf-unmarshal-field-mismatch",
  "signature": "error: proto: cannot parse invalid wire-format data",
  "signature_zh": "错误：proto：无法解析无效的线格式数据",
  "regex": "error:\\ proto:\\ cannot\\ parse\\ invalid\\ wire\\-format\\ data",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The protobuf message received over gRPC has a field with an unexpected wire type, often due to schema mismatch between client and server.",
  "root_cause_type": "generic",
  "root_cause_zh": "通过gRPC接收的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": "Restart both client and server without checking proto files.",
      "why_fails": "The issue is structural mismatch, not transient state.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Update only the client binary without regenerating proto code.",
      "why_fails": "Stale generated code still has old field definitions.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Regenerate Go protobuf code from the same .proto file on both sides.",
      "success_rate": 0.95,
      "how": "protoc --go_out=. --go-grpc_out=. *.proto",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use protojson format for debugging to identify field type mismatches.",
      "success_rate": 0.8,
      "how": "import \"google.golang.org/protobuf/encoding/protojson\"\nb, _ := protojson.Marshal(msg)\nlog.Printf(\"%s\", b)",
      "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": "2024-03-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}