t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Updates fail on slow links: release download stalls are never retried and can't resume

Open indishere opened this issue 2 weeks ago • 1 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Follow-up to #18113, which fixed the total-time cap and asked for a new issue for the remaining resume part.

  1. Run T3 as the boot service (Linux x64, nightly) on a link where GitHub release assets download at about 0.5 MB/s and sometimes stall for more than 60 seconds. Other hosts on the same link (Cloudflare, npm) reach 1.5–2.6 MB/s.
  2. Click Update for that server from a connected client, or let the desktop app (Linux AppImage) download its update.
  3. Try again a few times.

Expected behavior

  • A stall during the release download counts as transient and is retried.
  • A retry continues from the bytes already received (a Range request against a staging file) instead of starting over.
  • The desktop updater retries or resumes the same way, so a slow link eventually finishes.

Actual behavior

From 0.1.10-nightly.20261114.4695 (pinned runtime install, cloud.pinned_runtime.fetch_release_asset):

  • fetchReleaseAsset applies PINNED_RUNTIME_DOWNLOAD_STALL_TIMEOUT (1 minute) to the response stream, but isTransientDownloadFailure returns false for TimeoutError. DOWNLOAD_RETRY therefore never retries a stall, and one stall fails the whole update.
  • The archive is collected in memory (runCollect), with no Range resume. Every attempt starts again from 0 bytes. With the 183 MB linux-x64 archive at about 0.5 MB/s, one stall anywhere in the roughly 6-minute download fails every attempt. A resumable curl -C - loop finished the same file after 3 stalls.
  • The desktop app's updater fails the same way: ElectronUpdaterDownloadUpdateError with net::ERR_TIMED_OUT / Request timed out, and it starts over on the next try.

Impact

Blocks work completely

Version or commit

0.1.10-nightly.20261114.4682 and 0.1.10-nightly.20261114.4695

Environment

Linux x64, boot service (systemd user unit) plus the Linux AppImage desktop app, nightly channel

Logs or stack traces

cloud.server_self_update.update  Failure (~140 s)
ServerSelfUpdateError: Server update failed: Could not prepare [email protected] while downloading the t3 release archive (timed out) (from github.com).
PinnedRuntimeInstallError: Pinned runtime install failed while downloading the t3 release archive (timed out).
    at cloud.pinned_runtime.fetch_release_asset

desktop.updates.handleDownloadFailure
Electron updater failed to download the update on channel nightly.
ElectronUpdaterDownloadUpdateError: Error: net::ERR_TIMED_OUT

Workaround

A local mirror that pre-downloads each release with resumable retries, with T3CODE_RELEASE_BASE_URL pointed at it for the server. For the desktop app, the verified AppImage plus a matching update-info.json go into electron-updater's pending cache folder.

indishere avatar Nov 14 '26 18:11 indishere

Filed with Opus 5.5 medium in T3 Code.*

indishere avatar Nov 14 '26 19:11 indishere