Skip to content
Latchkey

gRPC "PROTOCOL_ERROR" over HTTP/2 in CI

gRPC runs over HTTP/2. A PROTOCOL_ERROR (RST_STREAM code 1) means the peer rejected the stream at the HTTP/2 layer: typically the target is not a real gRPC server, or a proxy/load balancer between them does not speak HTTP/2 end to end.

What this error means

A call fails with "14 UNAVAILABLE: ... Received RST_STREAM with code 1 (PROTOCOL_ERROR)" or "stream terminated by RST_STREAM with error code: PROTOCOL_ERROR", often through an ingress or proxy.

gRPC
Error: 14 UNAVAILABLE: Received RST_STREAM with code 1 (PROTOCOL_ERROR)
    at Object.callErrorFromStatus (.../call.js)

Diagnose it: produced, uploaded, or mapped?

Third-party integrations fail at one of three points, and the symptom is the same for all of them: the report was never produced, the upload was rejected, or the service could not map the paths back to your repository.

Terminal
ls -la <report-dir>/ && head -5 <report-file>
grep -c . <report-file> || echo "empty report"
# absolute paths in a report break server-side file mapping
grep -m3 -E "^(SF:|<file)" <report-file>

Common causes

The target is not a gRPC/HTTP/2 server

The client connected to an HTTP/1.1 endpoint or a wrong port, so the HTTP/2 frames the server returns are rejected as a protocol error.

A proxy that does not preserve HTTP/2

A load balancer or ingress terminates or downgrades HTTP/2, breaking the end-to-end protocol gRPC requires.

How to fix it

Point the client at a real gRPC endpoint

  1. Confirm the target port serves gRPC (HTTP/2), not an HTTP/1.1 app.
  2. If a proxy sits in between, configure it for end-to-end HTTP/2 (h2c or gRPC mode).
  3. Verify with grpcurl against the same address.
Terminal
grpcurl -plaintext localhost:50051 list   # confirms it speaks gRPC

Enable HTTP/2 through the proxy

Set the proxy/ingress backend protocol to gRPC or HTTP/2 so frames are not downgraded.

YAML
# nginx ingress: backend must speak gRPC end to end
nginx.ingress.kubernetes.io/backend-protocol: "GRPC"

How to prevent it

  • Connect only to ports that serve gRPC over HTTP/2.
  • Configure proxies and ingress for end-to-end HTTP/2.
  • Smoke-test the endpoint with grpcurl before the suite.

Frequently asked questions

What causes gRPC "PROTOCOL_ERROR" over HTTP/2 in CI?
There are 2 common causes: the target is not a grpc/http/2 server and a proxy that does not preserve http/2. The client connected to an HTTP/1.1 endpoint or a wrong port, so the HTTP/2 frames the server returns are rejected as a protocol error.
How do I fix gRPC "PROTOCOL_ERROR" over HTTP/2 in CI?
There are 2 fixes depending on which cause you have: point the client at a real grpc endpoint and enable http/2 through the proxy. Work through them in order, since the first is the most common.
What does gRPC "PROTOCOL_ERROR" over HTTP/2 in CI actually mean?
A call fails with "14 UNAVAILABLE: ...
How do I stop gRPC "PROTOCOL_ERROR" over HTTP/2 in CI happening again?
Connect only to ports that serve gRPC over HTTP/2. The prevention section lists 3 changes that keep it from recurring.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card