# rpc错误：代码=未实现 描述=方法SayHello未实现

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

## 根因

gRPC服务器未注册调用的RPC方法的处理程序，可能是由于缺少注册或服务名称错误。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.21 | active | — | — |
| 1.22 | active | — | — |

## 解决方案

1. **Ensure the server registers the service with the correct generated code.** (95% 成功率)
   ```
   grpcServer := grpc.NewServer()
pb.RegisterGreeterServer(grpcServer, &myGreeterServer{})
   ```
2. **Verify the proto file and regenerate stubs if method was added recently.** (90% 成功率)
   ```
   protoc --go_out=. --go-grpc_out=. *.proto
   ```

## 无效尝试

- **Restarting the server without changing code.** — The handler is still missing; restart doesn't add it. (100% 失败率)
- **Checking client method name only, ignoring server registration.** — The server must register the method; client alone can't fix it. (90% 失败率)
