Repository navigation
Conversation
The page fetch used Node's fetch, which ignores HTTPS_PROXY and NO_PROXY unless NODE_USE_ENV_PROXY is set when Node starts. The installer and update downloads use @actions/http-client, which follows these settings. So behind a proxy, the downloads worked, the page fetch failed, and the action installed SQL Server without the cumulative update. Fetch the page with @actions/http-client again. Its readBody() never settles when the connection closes before the end of the body, so read the response stream instead, which then fails, and limit the body to 30 seconds. Retry every failure. When a proxy applies, say so in the log, and say in the failure reason how to fetch the page directly with NO_PROXY. Name the proxy by its host only when its URL has no credentials. Microsoft has refused @actions/http-client requests for these pages before. It sent HTTP 403 for every request from GitHub runners, but it accepted Node's fetch from the same runners. So when the page request gets a 403 and no proxy applies, try the page once with Node's fetch in the same attempt. The README describes the proxy settings. Tests fetch a page through a real local proxy, also when the connection closes early, and a test checks that only the update pages use www.microsoft.com, as the README says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix: fetch the cumulative update page through the runner's proxy The page fetch used Node's fetch, which ignores HTTPS_PROXY and NO_PROXY unless NODE_USE_ENV_PROXY is set when Node starts. The installer and update downloads use @actions/http-client, which follows these settings. So behind a proxy, the downloads worked, the page fetch failed, and the action installed SQL Server without the cumulative update. When a proxy applies to the page, fetch the page with @actions/http-client, which then uses the proxy like the downloads. Otherwise keep Node's fetch. Microsoft has refused @actions/http-client requests for these pages from GitHub runners with HTTP 403, and accepted Node's fetch from the same runners. Through the proxy, follow redirects in the action and read each body as a stream with a 30 second limit, because the client's readBody() never settles when the connection closes early. When a proxy applies, say so in the log, and say in the failure reason how to fetch the page directly with NO_PROXY. Retry every failure. The README describes the proxy settings. Tests fetch pages through a real local proxy, and a test checks that only the update pages use www.microsoft.com, as the README says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The cumulative update page fetch used Node's
fetch, which ignoresHTTPS_PROXYandNO_PROXYunlessNODE_USE_ENV_PROXYis set when Node starts. The installer and update downloads use@actions/http-client, which follows these settings. On a self-hosted runner that reaches the internet only through an explicit proxy, the downloads worked, the page fetch failed, and the action installed SQL Server without the cumulative update, with only a warning. GitHub-hosted runners have no proxy settings, so they weren't affected.@actions/http-client, the same client as the downloads, so it uses the proxy. Otherwise it keeps Node'sfetch, exactly as before. The action says in the log when it uses a proxy, and it names the proxy host only when the proxy URL has no credentials. If the page still can't be fetched, the error says how to fetch it directly withNO_PROXY.@actions/http-clientfor every runner. The page fetch moved tofetchin fix: fetch cumulative update pages with native fetch to avoid 403s #258, because Microsoft refused every@actions/http-clientrequest for these pages from GitHub runners with a 403 for some days in July, while it acceptedfetch. It still happens: in an earlier revision of this PR, which used@actions/http-clienton every runner, 3 of the 6 CI requests to the SQL Server 2025 page got a 403. In the same run,fetchgot a 200 each time.HttpClientResponse.readBody()in@actions/http-client4.0.1 never settles when the connection closes or stalls before the end of the body, so the step would exit with code 0 without installing SQL Server. The action reads each response as a stream instead, which then fails, with a 30-second limit for each body. It also follows redirects itself, because http-client reads redirect bodies withreadBody()and can't follow a relativeLocation.NO_PROXY: www.microsoft.comon the setup-sqlserver step. Only the update pages use that host, so the downloads still go through the proxy, and a test checks that only the update pages use it.NO_PROXYvalues and proxy values without a scheme. A new test file fetches pages through a real CONNECT proxy on the loopback address, with no mocked HTTP. It covers a successful fetch, anhttps://page throughHTTPS_PROXY, a 407 from the proxy with itsNO_PROXYhint, a relative redirect, and connections that close before the end of a page or a redirect.I considered keeping
fetchand passing it the proxy dispatcher from@actions/http-client. That mixes undici 6 with the undici 7 that is built into Node 24, and it breaks on Node 26, which bundles undici 8.Part of #331. The cache key item follows in a separate PR.
🤖 Generated with Claude Code