go
data_error
ai_generated
true
rpc error: code = InvalidArgument desc = invalid enum value: 99 for field `status`
ID: go/grpc-invalid-argument-enum
80%Fix Rate
85%Confidence
0Evidence
2024-04-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.x | active | — | — | — |
Root Cause
The client sent an integer value for a protobuf enum field that is not defined in the enum. This often happens when the client and server have different versions of the .proto definition.
generic中文
客户端为 protobuf 枚举字段发送了一个未在枚举中定义的整数值。这通常是因为客户端和服务器使用了不同版本的 .proto 定义。
Workarounds
-
90% success
Run protoc with the updated status enum definition.
-
80% success
if status < 0 || status > 3 { return fmt.Errorf("invalid status") }
Dead Ends
Common approaches that don't work:
-
80% fail
The value 99 is not a valid enum constant, so casting will not help.
-
70% fail
Protobuf enums are strict by default; you would need to use a wrapper type.