# INTERNAL: grpc: failed to unpack Any type: type URL not found in registry

- **ID:** `grpc/protobuf-any-type-mismatch`
- **Domain:** grpc
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| protobuf 3.20+ | active | — | — |
| gRPC Go 1.50+ | active | — | — |
| gRPC Java 1.60+ | active | — | — |

## Workarounds

1. **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"** (90% success)
   ```
   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"
   ```
2. **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)** (85% success)
   ```
   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)
   ```

## Dead Ends

- **Manually parsing the type URL string** — The Any type requires proper protobuf reflection; manual parsing is error-prone and may break with future protobuf versions. (50% fail)
- **Adding all possible proto files to the binary** — Increases binary size and may cause symbol conflicts. (30% fail)
