# rpc 错误：code = Unimplemented desc = 未知服务 pb.UserService

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

## 根因

客户端调用了服务端未注册的服务。通常是生成的客户端代码过旧、服务全限定名拼写错误，或服务端忘记调用 RegisterUserServiceServer。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.45+ | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   s := grpc.NewServer()
pb.RegisterUserServiceServer(s, &userServer{})
reflection.Register(s) // enables grpcurl discovery
log.Fatal(s.Serve(lis))
   ```
2. **** (90% 成功率)
   ```
   // protoc --go_out=. --go-grpc_out=. user.proto
// then confirm: grpcurl -plaintext localhost:50051 list
   ```

## 无效尝试

- **** — Unimplemented is a routing error on the server, not a TLS issue; disabling TLS does nothing for service lookup. (95% 失败率)
- **** — The server will never learn the service; retries return Unimplemented deterministically. (90% 失败率)
