{
  "id": "go/proto-unmarshal-invalid-wire-type",
  "signature": "proto: cannot parse invalid wire-format data",
  "signature_zh": "proto: 无法解析无效的 wire-format 数据",
  "regex": "proto:\\ cannot\\ parse\\ invalid\\ wire\\-format\\ data",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The bytes handed to proto.Unmarshal do not conform to the protobuf wire format. Usually caused by passing JSON, plain text, or a truncated/concatenated buffer to a binary proto unmarshaler.",
  "root_cause_type": "generic",
  "root_cause_zh": "传给 proto.Unmarshal 的字节不符合 protobuf wire 格式。通常是因为把 JSON、纯文本或截断/拼接的缓冲区交给了二进制 proto 反序列化器。",
  "versions": [
    {
      "version": "google.golang.org/protobuf v1.28+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The buffer is deterministic; malformed bytes never become valid on retry. The error is not transient.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "On wire-format errors the message is left in an undefined/partial state; downstream logic reads zero or garbage fields.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "if err := proto.Unmarshal(data, msg); err != nil {\n    // if data is JSON, use:\n    err = protojson.Unmarshal(data, msg)\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "log.Printf(\"len=%d head=%x\", len(data), data[:min(16,len(data))])",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}