{
  "id": "go/proto-any-unmarshal-type-not-found",
  "signature": "proto: unable to resolve \"type.googleapis.com/pb.Payment\"",
  "signature_zh": "proto：无法解析 \"type.googleapis.com/pb.Payment\"",
  "regex": "proto:\\ unable\\ to\\ resolve\\ \"type\\.googleapis\\.com/pb\\.Payment\"",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "protojson or proto.Unmarshal encountered an Any message whose embedded type URL is not registered in the global type registry.",
  "root_cause_type": "generic",
  "root_cause_zh": "protojson 或 proto.Unmarshal 遇到 Any 消息，其内嵌 type URL 未在全局类型注册表中注册。",
  "versions": [
    {
      "version": "google.golang.org/protobuf v1.30+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Any.Value contains a serialized message with a type prefix; direct assignment yields garbage.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Works only if the caller knows the type; defeats the purpose of Any and breaks polymorphic dispatch.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.93,
      "how": "import _ \"example.com/project/pb\" // triggers init() registration\n// or explicit:\nprotoregistry.GlobalTypes.RegisterMessage(paymentpb.Payment{}.ProtoReflect().Type())",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "opts := protojson.UnmarshalOptions{\n    Resolver: protoregistry.GlobalTypes,\n}\nif err := opts.Unmarshal(data, msg); err != nil {\n    return err\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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-12-02",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}