How to fix Failed to connect to server: connection refused (HTTP/2) in Kubernetes
KubernetesINTERMEDIATEHIGHUpdated Jan 23, 2026ยท 120 views
gRPC or HTTP/2 services fail when pods refuse connections on the expected port. Network policies, service configuration, or application setup blocks HTTP/2 traffic.
Quick fix
Fixes Failed to connect to server: connection refused (HTTP/2)
- Step 1
- Step 2
- Step 3
- Step 4
- Step 5
kubernetes โ error
# Failed to connect to server: connection refused (HTTP/2)Failed to connect to server: connection refused (HTTP/2)
What this error means
gRPC or HTTP/2 services fail when pods refuse connections on the expected port. Network policies, service configuration, or application setup blocks HTTP/2 traffic. The pod either is not listening or is actively rejecting connections.
Typical symptoms
- gRPC client errors: "connection refused"
- HTTP/2 frame errors or connection resets
- Service shows unhealthy endpoints
- kubectl port-forward works but client connections fail
- Different behavior between HTTP and HTTP/2 traffic
- Intermittent connection refusal depending on load
- Application logs show socket binding errors
Common causes
- Pod not listening on expected port
- Port number mismatch in Service configuration
- Network policy blocking gRPC traffic
- Application using HTTP/1.1 but service expects HTTP/2
- Firewall blocking connection to pod port
- Service endpoint port misconfigured
- Load balancer protocol mismatch
How to fix "Failed to connect to server: connection refused (HTTP/2)"
1Step 1
First diagnostic step
2Step 2
Second diagnostic step
3Step 3
Third diagnostic step
4Step 4
Fourth diagnostic step
5Step 5
Fifth diagnostic step
Advanced notes
Additional notes and platform-specific considerations.
Frequently asked questions
- What does "Failed to connect to server: connection refused (HTTP/2)" mean?
- gRPC or HTTP/2 services fail when pods refuse connections on the expected port. Network policies, service configuration, or application setup blocks HTTP/2 traffic. The pod either is not listening or is actively rejecting connections.
- How do I fix "Failed to connect to server: connection refused (HTTP/2)"?
- gRPC or HTTP/2 services fail when pods refuse connections on the expected port. Network policies, service configuration, or application setup blocks HTTP/2 traffic.
- What causes "Failed to connect to server: connection refused (HTTP/2)"?
- Pod not listening on expected port Port number mismatch in Service configuration Network policy blocking gRPC traffic
- Is the "Failed to connect to server: connection refused (HTTP/2)" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- ๐Kubernetes Official Documentation
- ๐Kubernetes Docs: Services(Official Docs)
- ๐Kubernetes Docs: Debugging Services(Official Docs)
- ๐ฌStack Overflow: Kubernetes HTTP/2 issues(Stack Overflow)