Post

Homebrew, Curl & HTTP/2 Stream Error

I recently had a problem installing a homebrew package on my MacBook, that was related to the version of CURL on the device.

Problem

Attempting to install the Azure CLI via homebrew using the usual command below resulted in the error below.

brew install azure-cli

curl: (18) HTTP/2 stream 1 was reset Error: azure-cli: Failed to download resource “azure-cli” Download Failed

It seems that the target HTTP server was not handling the HTTP/2 request in the way that Curl was expecting. It turns out that this is not a problem with curl as such but this issue was resolved in a more recent version of than I had installed (or could install) which was version 8.1.2. To find your local curl version run this command:

curl –version
version 8.1.2

Homebrew actually comes with a bundled version of curl, and running this command I could see if was newer than my system default one (but just not being used by homebrew).

brew info curl version 8.2.1

FIX: So resolve the problem I needed to get homebrew to use its own installation of curl instead of the MacBook’s system version by running the below command to set an environment variable…

1
export HOMEBREW_FORCE_BREWED_CURL=1

From that point I was able to run brew install azure-cli successfully.

This post is licensed under CC BY 4.0 by the author.