Skip to content

macOS desktop update started remotely via "update all" fails to install with "The network connection was lost." and retries fail until the app is relaunched #40605

Closed as not planned

Description

@loganprit

What happened

On a Mac mini running the nightly desktop app, installing a downloaded update failed three times in a row, two minutes apart. Each time the app stopped its backends, called quitAndInstall, and about 7 s later the updater reported Error: The network connection was lost. The app then rolled back (recoverFailedInstall) and stayed on the old build. ShipIt never got an install request for any of the three attempts.

The user started it from their MacBook with the "update all machines/providers" flow, pointed at the Mac mini. That remote flow triggered the download (0.1.12-nightly.20261121.5064, 16 minutes before the first install attempt) and the first two installs. The third install was a local click in the app.

The user then went to the Mac mini, force-quit the app, relaunched it, and reinstalled the update. It downloaded the same build again and installed it about 8 s later. That install went through on the first try. The earlier 5051 install that morning also followed its download by only a few seconds, and it also worked.

Diagnosis

With autoInstallOnAppQuit = false (DesktopUpdates.ts, configure), electron-updater 6.8.9's MacUpdater opens its localhost proxy server when the download finishes. Squirrel.Mac only fetches the 234 MB zip from that proxy later, at quitAndInstall (squirrelDownloadedUpdate is still false, so it calls nativeUpdater.checkForUpdates() and waits for update-downloaded). The network connection was lost. is NSURLErrorNetworkConnectionLost, which means Squirrel's transfer from that proxy was cut off partway through.

The failures share two traits: a proxy server that had been open for 16+ minutes, and a desktop process that had been running for about 5 hours. The installs that worked started a few seconds after their download. Which mechanism closes the connection is not confirmed. electron-updater's logger isn't wired into the desktop trace, so the proxy's … requested by Squirrel.Mac, pipe … and Proxy server … is closed lines are lost. Two candidates fit:

  • something calling closeServerIfExists() or replacing the proxy between the download and the install;
  • Squirrel's request being torn down while backends and tunnels stop just before quitAndInstall.

Also worth noting: every retry in the same process failed the same way. Only a relaunch, which made a fresh download and a fresh proxy, recovered.

Likely fix directions:

  • On macOS, re-serve the cached download (a fresh updateDownloaded/proxy) right before quitAndInstall when the download is old.
  • Or make recoverFailedInstall do that before allowing a retry.
  • Either way, route autoUpdater.logger into the desktop trace so the proxy and Squirrel lines are kept.

Steps to reproduce

  1. On macOS (arm64), run the nightly desktop app with an older nightly installed.
  2. From another linked desktop, run "update all machines/providers" so the target downloads an update. (A local download that isn't installed right away likely hits this too.)
  3. Wait about 15+ minutes with the app still running.
  4. Let the remote flow send the install (or click Restart to update on the target).
  5. About 7 s after quitAndInstall, the install fails with "The network connection was lost." The app restarts its backends on the old build. Retrying fails the same way.
  6. On the target, force-quit and relaunch the app. It downloads again, and installing right away works.

Not yet tried as a controlled repro. The timeline comes from one machine's trace.

Version

Failed on 0.1.12-nightly.20261121.5051 (installing 0.1.12-nightly.20261121.5064). The machine is now on 5064.

Environment

  • Mac mini, Apple Silicon, macOS 27.2.1 (26B131), /Applications/T3 Code (Nightly).app on the internal disk (25 GB free)
  • Desktop app with local backend; update channel nightly; electron 44.10.1, electron-updater 6.8.9
  • No system HTTP proxy configured; no sleep during the window
  • Remote update requests came from a linked MacBook desktop client through the "update all machines/providers" flow

Evidence

~/.t3/userdata/logs/desktop.trace.ndjson{,.1} (times are local, UTC-6):

11:20:16  bootstrap start runId=52978ae352b2   (running 5051)
16:19:44  desktop.updates.applyUpdateDownloaded version=0.1.12-nightly.20261121.5064   (via DesktopRemoteUpdates)
16:35:27  DesktopRemoteUpdates.step "remote update prepared"
16:35:30  desktop.updates.install -> checkForUpdates(reason=install) -> installDownloadedUpdate
16:35:36  ElectronUpdater.quitAndInstall
16:35:43  desktop.updates.handleUpdaterError  errorTag=DesktopUpdaterReportedError operation=install cause="Error: The network connection was lost."
16:35:43  desktop.updates.recoverFailedInstall
16:39:55  ElectronUpdater.quitAndInstall      (remote request again)
16:40:01  handleUpdaterError  "The network connection was lost."  -> recoverFailedInstall
16:40:24  ElectronUpdater.quitAndInstall      (local desktop.ipc.updates.install)
16:40:30  handleUpdaterError  "The network connection was lost."  -> recoverFailedInstall
16:41:01  bootstrap start runId=f26c29122dd1  (still 5051; 5064 offered at 16:41:16)
16:42:05  applyUpdateDownloaded 5064
16:42:13  ElectronUpdater.quitAndInstall
16:42:21  bootstrap start runId=406037684d4f  (now 5064)

~/Library/Caches/com.t3tools.t3code.ShipIt/ShipIt_stderr.log has install requests at 11:20:11 and 16:42:17, both Installation completed successfully, and none between 16:35 and 16:41. The failure happens before ShipIt is launched, while Squirrel is still fetching from the proxy.

Related issues

Fix applied or workaround

On the target Mac itself: force-quit the app, relaunch it, then reinstall the update right after the fresh download. This worked here, and the Mac mini is now on 0.1.12-nightly.20261121.5064. The remote "update all" flow can't recover on its own, because each retry reuses the stale download in the same process.

Filed by

Claude Code (Claude Opus 5.5) via T3 Code triage.

Activity

  1. added
    via-triage
    on Nov 21, 2026
  2. juliusmarminge commented on Nov 23, 2026

    @juliusmarminge
    Member

    I tried to reproduce this on the current build and could not.

    Commit 0356d68 (origin/main), real signed nightly builds on a pool Mac (macOS 26.6.2, Apple silicon). 1) Downloaded the public T3-Code-0.1.12-nightly.20261122.5111-arm64.zip (Developer ID signed) into a scratch directory and launched it with its own T3CODE_HOME and --remote-debugging-port, driving it over CDP through window.desktopBridge. 2) getUpdateState showed 0.1.12-nightly.20261123.5124 available; at 05:37:58 UTC called desktopBridge.downloadUpdate() and got status downloaded, downloadedVersion 5124; lsof showed electron-updater's Squirrel proxy listening on 127.0.0.1:50464. 3) Waited 17 minutes with the app running and idle. At 05:54:57 the proxy was still listening and the state was 'downloaded 5124'. 4) Called desktopBridge.installUpdate('0.1.12-nightly.20261123.5124'): ShipIt logged 'Successfully launched application' at 05:54:59, the bundle's version became 0.1.12-nightly.20261123.5124 and the app relaunched; the trace had no 'network connection was lost' error. Conditions not met: the reporter's process had been running about 5 hours (mine about 17 minutes), their install came through the remote 'update all' flow from a second linked desktop (mine was a local bridge call), and they were on macOS 27.2.1. Code reading: nothing in apps/desktop/src/updates/DesktopUpdates.ts or in electron-updater 6.8.9's AppUpdater closes or replaces the MacUpdater proxy between updateDownloaded and quitAndInstall; the checkForUpdates('install') before installDownloadedUpdate does not touch it.

    Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions