From c85d7c301a94a37212b41b7c856b1be192c2a673 Mon Sep 17 00:00:00 2001 From: Val Date: Mon, 21 Aug 2023 17:21:51 +0200 Subject: [PATCH] tool: force HTTP/1.1 in curl to prevent hang behind load balancer When running in our github CI environment, curl sometimes hangs while closing the download from the nodejs.org server and fails with INTERNAL_ERROR. This is likely caused by CI running behind some kind of load balancer or proxy that handles HTTP/2 incorrectly in some minor way, so force curl to use HTTP 1.1. Updates #8988 Signed-off-by: Val --- tool/node | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tool/node b/tool/node index 11bb6c232..310140ae5 100755 --- a/tool/node +++ b/tool/node @@ -49,7 +49,12 @@ fi ARCH="arm64" fi mkdir -p "$cachedir" - curl -f -L -o "$tarball" "https://nodejs.org/dist/v${want_rev}/node-v${want_rev}-${OS}-${ARCH}.tar.gz" + # When running on GitHub in CI, the below curl sometimes fails with + # INTERNAL_ERROR after finishing the download. The most common cause + # of INTERNAL_ERROR is glitches in intermediate hosts handling of + # HTTP/2 forwarding, so forcing HTTP 1.1 often fixes the issue. See + # https://github.com/tailscale/tailscale/issues/8988 + curl -f -L --http1.1 -o "$tarball" "https://nodejs.org/dist/v${want_rev}/node-v${want_rev}-${OS}-${ARCH}.tar.gz" (cd "$cachedir" && tar --strip-components=1 -xf "$tarball") rm -f "$tarball" fi