go
data_error
ai_generated
true
rpc 错误:代码 = Unknown 描述 = 状态格式错误:无状态详情
rpc error: code = Unknown desc = malformed status: no status details
ID: go/grpc-status-details-missing
80%修复率
85%置信度
0证据数
2024-01-15首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 1.0 | active | — | — | — |
根因分析
服务器返回的状态没有详情,但客户端期望 google.rpc.Status 详情,导致 proto 反序列化失败。
English
Server returns a status with no details, but client expects google.rpc.Status details, causing proto unmarshal failure.
解决方案
-
90% 成功率
if s, ok := status.FromError(err); ok { for _, d := range s.Details() { /* handle */ } } -
80% 成功率
st := status.New(codes.Unknown, "error"); st, _ = st.WithDetails(&errdetails.ErrorInfo{}); return st.Err()
无效尝试
常见但无效的做法:
-
70% 失败
Server logs show no error because the status is intentionally empty; issue is in client-side parsing.
-
90% 失败
Credentials are not the issue; the problem is in the status detail parsing logic.