err:rpc error: code = Internal desc = grpc: error unmarshalling request: string field contains inval

created at 05-29-2022 views: 11

error

grpc client call rpc received:

err:rpc error: code = Internal desc = grpc: error unmarshalling request: string field contains inval

The RPC callback of the grpc server is not called.

In general, if the string field contains Chinese characters, the client will return grpc: error marshalling request: string field contains inval. It is suggested that the failure of unmarshal is probably due to the misplacement of the client and server fields, and the server treats the client's bytes type as string. But this problem should not exist in the targeted environment.

conclusion

The version of grpc is different, the client uses v1.26, but the server uses v1.45. Both ends are modified to v1.26can solve the problem. The specific modification needs to analyze the difference of grpc packets between the two.

created at:05-29-2022
edited at: 05-29-2022: