# rpc 错误：code = Unimplemented desc = 服务 pb.YourService 的未知方法 YourMethod

- **ID:** `go/grpc-unknown-method`
- **领域:** go
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

客户端调用了服务中未定义的方法，可能由于客户端和服务器 proto 定义不匹配。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   protoc --go_out=. --go-grpc_out=. your.proto
// Then redeploy both client and server.
   ```
2. **** (90% 成功率)
   ```
   // Check the .proto file for correct spelling and casing.
// service YourService { rpc YourMethod (Request) returns (Response); }
   ```

## 无效尝试

- **** — The server still doesn't implement the method, so the call will fail with the same error. (95% 失败率)
- **** — The service name must match exactly; using a different name will result in a different error. (90% 失败率)
