Skip to content
MtrXTools

curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

The server reset an HTTP/2 stream

Seen in curl, libcurl (CURLE_HTTP2_STREAM), Git over HTTPS, PHP

The server or a proxy reset the HTTP/2 stream before the response completed; the code in brackets says why.

Common causes

  • The server or proxy sent a response HTTP/2 forbids, such as a connection-specific header like Upgrade or Connection (PROTOCOL_ERROR).
  • A proxy or load balancer cancelled a slow, large or streamed response because of a timeout or size limit (CANCEL or INTERNAL_ERROR).
  • A buggy intercepting proxy or middlebox between client and server.

How to fix it

  1. Retry with --http1.1; if that works, the problem is in the server or proxy HTTP/2 handling.
  2. Run curl -v and look at the response headers just before the error for an invalid header.
  3. Remove connection-specific headers in the proxy config, and raise body size and timeout limits for large transfers.
Inspect the response headers

Got a different message? Paste it into the error explainer.

Related errors

All 34 Command line & code errors