{
  "id": "grpc/protobuf-any-type-mismatch",
  "signature": "INTERNAL: grpc: failed to unpack Any type: type URL not found in registry",
  "signature_zh": "INTERNAL: grpc: 解包Any类型失败：类型URL未在注册表中找到",
  "regex": "INTERNAL: grpc: failed to unpack Any type: type URL not found in registry",
  "domain": "grpc",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "A protobuf Any field contains a type URL that is not registered in the server's or client's protobuf descriptor registry, often due to missing proto imports or mismatched versions.",
  "root_cause_type": "generic",
  "root_cause_zh": "protobuf Any字段包含的类型URL未在服务器或客户端的protobuf描述符注册表中注册，通常是由于缺少proto导入或版本不匹配。",
  "versions": [
    {
      "version": "protobuf 3.20+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC Go 1.50+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gRPC Java 1.60+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Manually parsing the type URL string",
      "why_fails": "The Any type requires proper protobuf reflection; manual parsing is error-prone and may break with future protobuf versions.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding all possible proto files to the binary",
      "why_fails": "Increases binary size and may cause symbol conflicts.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Register the missing type on server startup. In Go: import \"google.golang.org/protobuf/reflect/protoreflect\" and use proto.RegisterFile(descriptor) or ensure the proto file is imported in the main package. Example: _ \"path/to/missing/proto\"",
      "success_rate": 0.9,
      "how": "Register the missing type on server startup. In Go: import \"google.golang.org/protobuf/reflect/protoreflect\" and use proto.RegisterFile(descriptor) or ensure the proto file is imported in the main package. Example: _ \"path/to/missing/proto\"",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a custom Any unpacker that fetches descriptors dynamically. In Python: from google.protobuf import any_pb2; from google.protobuf import symbol_database; db = symbol_database.Default(); msg = db.GetSymbol(type_url); any.Unpack(msg)",
      "success_rate": 0.85,
      "how": "Use a custom Any unpacker that fetches descriptors dynamically. In Python: from google.protobuf import any_pb2; from google.protobuf import symbol_database; db = symbol_database.Default(); msg = db.GetSymbol(type_url); any.Unpack(msg)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Register the missing type on server startup. In Go: import \"google.golang.org/protobuf/reflect/protoreflect\" and use proto.RegisterFile(descriptor) or ensure the proto file is imported in the main package. Example: _ \"path/to/missing/proto\"",
    "Use a custom Any unpacker that fetches descriptors dynamically. In Python: from google.protobuf import any_pb2; from google.protobuf import symbol_database; db = symbol_database.Default(); msg = db.GetSymbol(type_url); any.Unpack(msg)"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://protobuf.dev/programming-guides/proto3/#any",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}