agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

macOS auto-update fails: ditto errors during ShipIt install (daemon/ao + AppleDouble files missing)

Open OrcInc opened this issue 4 months ago • 3 comments

Bug Report: macOS nightly auto-update fails with ditto errors

Reported by: @prateek (Discord #bug-triage) Affected version: v0.10.4-nightly.202607221413 (updating TO this nightly on macOS) Platform: macOS (username itrytoohard)

Error

When updating to the latest nightly via in-app auto-update, the update downloads but fails during the Squirrel.Mac ShipIt installation step. The UI shows:

ditto: ~/Library/Caches/dev.agent-orchestrator.desktop.ShipIt/update.SdDd11x/Agent Orchestrator.app/Contents/Resources/daemon/ao: No such file or directory
ditto: ~/Library/Caches/dev.agent-orchestrator.desktop.ShipIt/update.SdDd11x/Agent Orchestrator.app/Contents/Resources/._icon.png__: No such file or directory
ditto: ~/Library/Caches/dev.agent-orchestrator.desktop.ShipIt/update.SdDd11x/Agent Orchestrator.app/Contents/Resources/._electron.icns__: No such file or directory
ditto: ~/Library/Caches/dev.agent-orchestrator.desktop.ShipIt/update.SdDd11x/Agent Orchestrator.app/Contents/Resources/._app.asar__: No such file or directory
ditto: ~/Library/Caches/dev.agent-orchestrator.desktop.ShipIt/update.SdDd11x/Agent Orchestrator.app/Contents/Resources/._icon.ico__: No such file or directory

Analysis

The published nightly zip is correct. I downloaded both darwin-arm64 and darwin-x64 zips from the v0.10.4-nightly.202607221413 release and verified:

  • ✅ Contents/Resources/daemon/ao is present (22.9 MB arm64 / 24.5 MB x64)
  • ✅ Contents/Resources/icon.png, icon.ico, app.asar, electron.icns all present
  • ✅ app-update.yml present
  • ✅ Squirrel.framework with ShipIt binary bundled

The problem is in the update extraction/installation step, not the published artifact. The ditto errors originate from Squirrel.Mac's ShipIt process trying to copy from the extracted update cache (update.SdDd11x/), where files that ARE in the published zip are reported as missing.

Root cause hypothesis

The zip is created by @electron-forge/maker-zip (Node.js zip library) rather than electron-builder (which uses macOS native ditto). Two issues stem from this:

  1. No AppleDouble (._*) metadata files in the zip. macOS files carry extended attributes (resource forks). electron-builder's zip includes ._* companion entries via ditto; electron-forge/maker-zip omits them entirely (verified: 0 ._ prefixed entries in the published zip). When Squirrel.Mac extracts and runs ditto to install, it looks for these ._* companion files and fails.

  2. Blockmap incompatibility. The .blockmap is generated by app-builder-lib/out/targets/blockmap (from scripts/blockmap.mjs), which is designed for electron-builder's zip format. If electron-updater performs a differential download using this blockmap against an electron-forge zip, the reconstructed zip may be corrupted — explaining why daemon/ao (a real, non-AppleDouble file) is also missing from the extracted update.

Impact

  • All macOS auto-updates may be affected, not just this specific nightly — the ._* AppleDouble issue would recur on every update.
  • Users on the nightly channel cannot auto-update; they must manually download and reinstall.

Workaround for affected users

Clear the corrupted ShipIt cache and trigger a fresh full download:

rm -rf ~/Library/Caches/dev.agent-orchestrator.desktop.ShipIt

Then restart the app and check for updates again. If the update still fails, download the latest nightly zip directly from GitHub Releases and replace the app manually.

Suggested fixes

Short-term (unblock users):

  • Stop publishing .blockmap sidecar files for darwin zips in scripts/feed.mjs — this disables differential downloads and forces full zip downloads, which may avoid the corruption.
  • OR: Add blockMapSize: 0 to the mac feed entries to signal "no differential."

Long-term (proper fix):

  • Create macOS zips using macOS ditto (matching electron-builder's format) in a custom forge maker or post-package hook, ensuring AppleDouble metadata and extended attributes are preserved.
  • Alternatively, investigate whether electron-updater can be configured to skip ._* file expectations on macOS.

Key files

  • frontend/forge.config.ts — maker-zip config for darwin + extraResource (includes daemon/)
  • frontend/scripts/blockmap.mjs — blockmap generation via app-builder-lib
  • frontend/scripts/feed.mjs — feed YAML generation (omits blockMapSize to force sidecar differential)
  • frontend/src/main/auto-updater.ts — electron-updater integration

OrcInc avatar Jul 23 '26 16:07 OrcInc

Thanks for contributing to Agent Orchestrator.

This issue is being picked up by the current external contributor on-call pair:

  • @illegalcall
  • @pulkit7070

If someone is already working on this, please continue as usual. The on-call pair is added for visibility, tracking, and support, not to take over the work. If you need help with review, direction, reproduction, or next steps, please tag @illegalcall and @pulkit7070 here.

For faster context or live questions, you can also join the AO Discord.

Join the session here: https://discord.gg/H6ZDcUXmq

Come by if you want to see what is being built, ask questions, or just hang around with the community.

somewherelostt avatar Jul 24 '26 15:07 somewherelostt

I'm staarting this one

anmol0b avatar Jul 27 '26 01:07 anmol0b

Closing this: the macOS auto-update path is now verified working end to end against real published releases.

1. The differential path is off on macOS

PR #3151 (fix(release): skip blockmap sidecar for macOS zips, merged 2026-07-29) stops emitting the .blockmap sidecar for darwin zips, so electron-updater has nothing to drive a differential download with and always fetches the full zip. That removes the reconstruction step this issue's root-cause hypothesis pointed at.

2. The already-published sidecars are gone

Re-verified just now across the 60 most recent releases: 0 mac/darwin .blockmap assets remain. The 90 sidecars still live are all platforms where the differential path is intended (45 .AppImage.blockmap, 45 .exe.blockmap). So no client can pick up a stale mac sidecar from an older release either.

3. A real end-to-end update run passes

Ran the macOS update e2e (run 30758538690) on a real macos-latest Apple silicon host against the real published feed, not a fixture:

  • baseline: v0.11.2-nightly.202607301613 installed into /Applications, verified codesigned, notarized and stapled
  • target: 0.11.2-nightly.202608021445 resolved through the live nightly-mac.yml
  • result: PASS: 0.11.2-nightly.202607301613 updated to 0.11.2-nightly.202608021445, relaunched, daemon alive

That covers the exact step that failed here: the update downloaded, Squirrel staged it, ShipIt performed the ditto swap on quit, and the relaunched bundle both reported the new version from its Info.plist and answered on the daemon's loopback /healthz. The post-update codesign --verify --deep --strict / spctl / stapler validate trio also passed on what ShipIt actually left on disk, so the seal survives the swap. No ditto: No such file or directory errors.

Wall clock: 1m 19s measured by the job's own instrumentation (79s), 90s for the whole job including checkout and setup.

Both baseline and target were published after #3151, so neither carries a mac blockmap and the run exercised the full-download path users are on today.

One caveat worth stating plainly: this proves the current published path works, it does not retroactively prove the blockmap was the original cause. If a ditto-during-ShipIt failure is seen again on a build published after #3151, reopen and we chase the AppleDouble hypothesis in this issue's analysis section instead.

harshitsinghbhandari avatar Aug 02 '26 17:08 harshitsinghbhandari