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)

  1. Step 1
  2. Step 2
  3. Step 3
  4. Step 4
  5. 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

  1. Pod not listening on expected port
  2. Port number mismatch in Service configuration
  3. Network policy blocking gRPC traffic
  4. Application using HTTP/1.1 but service expects HTTP/2
  5. Firewall blocking connection to pod port
  6. Service endpoint port misconfigured
  7. 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