# rpc error: code = Unimplemented desc = 从服务端收到意外的 HTTP 状态码：404（未找到）；传输：收到意外的 content-type "text/plain"

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

## 根因

客户端到达了一个非 gRPC 的 HTTP 服务端（例如普通 HTTP 反向代理、配置错误的 Ingress，或未配置 gRPC 的 Envoy 路由）。服务端返回了 text/plain 的 404，而非 gRPC 帧。

## 版本兼容性

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

## 解决方案

1. **** (90% 成功率)
   ```
   // Kubernetes ingress-nginx:
// annotations:
//   nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
//   nginx.ingress.kubernetes.io/ssl-redirect: "true"
   ```
2. **** (92% 成功率)
   ```
   // Use the gRPC service port (often 50051) rather than 8080/9090
conn, _ := grpc.Dial("svc:50051", grpc.WithTransportCredentials(insecure.NewCredentials()))
   ```

## 无效尝试

- **** — The routing is misconfigured; retries always hit the same HTTP endpoint (95% 失败率)
- **** — The problem is HTTP/gRPC protocol mismatch, not TLS (90% 失败率)
