# INTERNAL: grpc: error while parsing response: field 5 has type int64 but message expects string

- **ID:** `grpc/protobuf-field-mismatch`
- **Domain:** grpc
- **Category:** type_error
- **Error Code:** `GRPC_PROTOBUF_FIELD_MISMATCH`
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

Server and client have mismatched Protobuf definitions for the same RPC, where a field type differs (e.g., server sends int64 but client expects string).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| protobuf v3.21.x | active | — | — |
| protobuf v4.25.x | active | — | — |
| gRPC v1.62.x | active | — | — |

## Workarounds

1. **Synchronize the .proto file between server and client: run `diff server.proto client.proto` to identify field type differences, then update the incorrect one. Recompile both sides with `protoc --proto_path=. --go_out=. *.proto` (or equivalent for your language).** (95% success)
   ```
   Synchronize the .proto file between server and client: run `diff server.proto client.proto` to identify field type differences, then update the incorrect one. Recompile both sides with `protoc --proto_path=. --go_out=. *.proto` (or equivalent for your language).
   ```
2. **Use a versioned schema registry (e.g., Confluent Schema Registry) to enforce that both sides use the same Protobuf schema version for the RPC.** (85% success)
   ```
   Use a versioned schema registry (e.g., Confluent Schema Registry) to enforce that both sides use the same Protobuf schema version for the RPC.
   ```
3. **As a temporary workaround, change the client field to use `google.protobuf.Any` to accept any type, then manually cast in application code.** (70% success)
   ```
   As a temporary workaround, change the client field to use `google.protobuf.Any` to accept any type, then manually cast in application code.
   ```

## Dead Ends

- **** — If the .proto file itself is outdated, regenerated stubs still have the wrong types; the root cause is the definition mismatch. (80% fail)
- **** — gRPC uses strict Protobuf parsing; custom deserializers are not supported and will cause further parsing errors. (90% fail)
- **** — Version mismatch is not the issue; the .proto file content is what defines the field types. (50% fail)
