Skip to content
Source
Sign inSign up
pingdotgg/t3code

`t3 update` ignores HTTPS_PROXY and fails with an unexplained ECONNRESET unless NODE_USE_ENV_PROXY=1 is set #21922

OpenTheAsda(GitHub profile, opens in a new tab) opened this issue 3 comments

What happened

On a machine that reaches GitHub through an HTTP proxy (HTTPS_PROXY set in the shell), t3 update failed while downloading the release checksums with read ECONNRESET. Nothing in the error points at the proxy. curl with the same environment downloads the same URL fine. Running NODE_USE_ENV_PROXY=1 t3 update worked.

Diagnosis

Node's built-in fetch ignores HTTP_PROXY/HTTPS_PROXY/NO_PROXY unless NODE_USE_ENV_PROXY=1 (or --use-env-proxy) is set. The pinned-runtime download in t3 update (cloud.pinned_runtime.fetch_release_asset → apps/server/src/cloud/pinnedRuntime.ts) therefore connects to GitHub directly. On this network, direct connections from Node are unreliable, while connections through the proxy are reliable.

apps/server/src/outboundHttp.ts (installHttp1FetchDispatcher) already keeps Node's EnvHttpProxyAgent when NODE_USE_ENV_PROXY is set. So proxy support works, but only if the user knows about a Node-level variable that most proxy setups (shell set_proxy helpers, corporate env scripts) don't export. Nothing in the docs mentions it.

The same applies to the background service. The systemd unit gets no proxy variables, and its outbound requests go direct. On this machine boot-service.log showed repeated Dropped telemetry batch after repeated send failures (TransportError: fetch failed).

Measured with plain Node on the affected machine, fetching the SHA256SUMS URL from the stack trace below:

PathResult
Node fetch, HTTPS_PROXY set, no NODE_USE_ENV_PROXY4 of 5 failed: read ECONNRESET after ~5 s
Node fetch with NODE_USE_ENV_PROXY=15 of 5 OK, ~150 ms
curl (uses HTTPS_PROXY)3 of 3 OK

Possible fixes:

  • Have the t3 entry point turn on env-proxy mode when HTTP(S)_PROXY is set and NODE_USE_ENV_PROXY isn't (for example, install an EnvHttpProxyAgent dispatcher from installHttp1FetchDispatcher/at startup, not only when Node already did).
  • At minimum, when a TransportError happens while HTTPS_PROXY is set but env-proxy mode is off, say so in the error and suggest NODE_USE_ENV_PROXY=1.
  • Document NODE_USE_ENV_PROXY for proxied networks, including for the background service (systemd drop-in / launchd env).

Steps to reproduce

  1. Use a network where GitHub is only reliably reachable through an HTTP proxy, and export HTTPS_PROXY=http://<proxy>:<port> in the shell. Leave NODE_USE_ENV_PROXY unset.
  2. Run t3 update on the nightly channel.
  3. The download fails with PinnedRuntimeInstallError: ... while downloading the t3 release checksums, caused by read ECONNRESET.
  4. Run NODE_USE_ENV_PROXY=1 t3 update and the update succeeds.

Version

0.1.1-nightly.20261017.3272 (the t3 that ran t3 update; target was 0.1.1-nightly.20261019.3373)

Environment

Linux x64 under WSL2 (kernel 6.18.54.1-microsoft-standard-WSL2), Node v26.8.2, t3 background service installed via systemd --user

Evidence

t3 update
  Updating T3 Code 0.1.1-nightly.20261017.3272 → 0.1.1-nightly.20261019.3373 (nightly)
✔ Restart the background service once the download is verified? … yes
  Downloading  0.0 MB
ERROR (#1): PinnedRuntimeInstallError: Pinned runtime install failed while downloading the t3 release checksums.
    at cloud.pinned_runtime.fetch_release_asset (~/.t3/runtime/versions/0.1.1-nightly.20261017.3272/t3:58584:67)
    at cloud.pinned_runtime.install_archive (~/.t3/runtime/versions/0.1.1-nightly.20261017.3272/t3:58665:11)
    at cloud.pinned_runtime.ensure_installed (~/.t3/runtime/versions/0.1.1-nightly.20261017.3272/t3:58685:80)
    at cli.update.run (~/.t3/runtime/versions/0.1.1-nightly.20261017.3272/t3:397268:17) {
  [cause]: HttpClientError: Transport error (GET https://github.com/pingdotgg/t3code/releases/download/v0.1.1-nightly.20261019.3373/SHA256SUMS)
    [cause]: TypeError: fetch failed {
      [cause]: Error: read ECONNRESET
          at TLSWrap.onStreamRead (node:internal/stream_base_commons:216:20)

#2709 (macOS system proxy settings not inherited by provider subprocesses) and #16703 / #16435 (TLS-inspecting proxies) are about other proxy setups and code paths. No existing issue covers t3 update or the service ignoring HTTPS_PROXY.

Fix applied or workaround

Ran NODE_USE_ENV_PROXY=1 t3 update (succeeded; CLI and service now on 0.1.1-nightly.20261019.3373). Added export NODE_USE_ENV_PROXY=1 to the user's shell proxy helper so future CLI runs pick up the proxy.

Filed by

Claude Code (claude-opus-5-5) via t3 triage

  1. Note

    Grok responding on behalf of Julius.

    Thanks for the side by side timings. Current main matches your reading.

    Node's built in fetch only honors HTTPS_PROXY when NODE_USE_ENV_PROXY=1 or --use-env-proxy is set. On Node 26 the server also replaces Node's fetch dispatcher at startup, and it keeps proxy support only when Node already turned it on (apps/server/src/outboundHttp.ts:17-44). The release download in t3 update goes through that same fetch (apps/server/src/cloud/pinnedRuntime.ts:116-125), so with only HTTPS_PROXY set it connects directly. The background service has the same behavior.

    That is Node's default, but t3 ignoring the proxy variables that curl and most tools honor is easy to hit and hard to diagnose. Accepting this as a bug.

    For now, setting NODE_USE_ENV_PROXY=1 alongside HTTPS_PROXY works, as you found. For the background service it has to be in the service's own environment too.

  2. juliusmarminge added labelsaccepted

  3. juliusmarminge added labelsbug

  4. juliusmarminge added labelsvia-triage

  5. Reproduced the proxy bypass on current main 70e5e384da, Linux x64, with both Node 24.21.0 and 26.8.2. Ran the real CLI update command against the reported nightly release using an isolated data directory and a local recording HTTP proxy. With only HTTPS_PROXY set, the release downloaded directly and the proxy saw no requests. Adding NODE_USE_ENV_PROXY=1 sent CONNECT github.com:443 through the proxy. Direct access works on this VM, so the ECONNRESET itself did not occur here.

  6. +1 with a measured data point from a real 0.1.9 → 0.1.10 update on Linux x64.

    • Setup: systemd user service, HTTPS_PROXY=http://127.0.0.1:7890, NODE_USE_ENV_PROXY unset (as in the report above).
    • Update started at 09:48:26 local. t3 serve opened a direct TCP connection to 185.199.109.133:443 (objects.githubusercontent.com) and held it for the whole download of t3-0.1.10-linux-x64.tar.gz (182,240,288 bytes).
    • Throughput on that socket: ~100–180 KB/s (ss -ti: rtt 148 ms, rcv_ooopack 17k, delivery_rate ~140 kbps). Total update time 19.5 min, ~19 min of it the archive download.
    • Same URL, same environment, via curl (honors HTTPS_PROXY): 5.1 MB/s, ~35× faster.
    • Extra observation: during the download ~/.t3/runtime/versions/.staging-* stays 0 bytes — pinnedRuntime.ts buffers the archive in memory and only writes it after the SHA256 check — so there is no on-disk or UI progress, and the update looks hung. PINNED_RUNTIME_DOWNLOAD_STALL_TIMEOUT (1 min) is the only guard, so a slow-but-alive download can run indefinitely.

    Is #35370 still the intended fix, or has the approach changed since the triage comment? Happy to test a build with a recording proxy.

Sign in to join this conversation.