#368 Autoupdate silently fails when swamp is installed system-wide via the official install.sh
Opened by bixu · 5/18/2026· Shipped 5/18/2026
Summary
The official install.sh installer recommends sudo install.sh to install
swamp system-wide under /usr/local/bin, where the binary is owned by
root:wheel. The built-in autoupdate scheduler runs as the unprivileged user,
so it cannot write to that path and fails silently on every scheduled run.
After 10 days my CLI was still on the version I installed and there was no
interactive signal — the failures only surface in ~/.swamp/log/autoupdate.log
or via swamp update --setup-auto status (which shows Last check: ("error")
without saying what the error was).
End state: a freshly installed, autoupdate-enabled swamp installed by the documented path never auto-updates.
Environment
- Installed version:
20260509.235714.0-sha.7ace6b02(downloaded 2026-05-10) - Latest available:
20260516.045246.0-sha.e6eda98d(perswamp update --checkon 2026-05-18) - macOS arm64 (Darwin 25.4.0)
- Installed via
curl -fsSL https://swamp-club.com/install.sh | sudo sh - Binary path / owner:
-rwxr-xr-x@ 1 root wheel /usr/local/bin/swamp- Autoupdate state (
swamp update --setup-auto status):
Autoupdate: enabled
Cadence: "daily"
Scheduler installed: true
Last check: "2026-05-17T09:22:50.722Z" ("error")Steps to reproduce
curl -fsSL https://swamp-club.com/install.sh | sudo sh— the installer's own--helpexplicitly suggests this for the "Installs the latest release for all users under/usr/local/bin" case.swamp update --setup-autoand enable daily autoupdate.- Wait until a swamp release is published.
- Observe that the installed binary never advances.
cat ~/.swamp/log/autoupdate.log— 10 consecutive daily failures:
{"timestamp":"2026-05-08T09:22:47.432Z","versionBefore":"20260508.001043.0-sha.3d787176","versionAfter":null,"outcome":"error","error":"Cannot update /usr/local/bin/swamp: permission denied. Re-run with: sudo swamp update"}
...
{"timestamp":"2026-05-17T09:22:50.722Z","versionBefore":"20260509.235714.0-sha.7ace6b02","versionAfter":null,"outcome":"error","error":"Cannot update /usr/local/bin/swamp: permission denied. Re-run with: sudo swamp update"}Expected
The documented install path and the built-in autoupdate feature should compose. Possible fixes (any combination):
swamp update --setup-autodetects the mismatch at setup time and either declines to enable, or installs a privileged scheduler with explicit consent. An actionable message that names the conflict ("binary at/usr/local/bin/swampis owned byrootbut the scheduler runs as$USER; reinstall under$HOME/.local/binor schedulesudo swamp updateinstead") would already be a big win.install.shdefaults to a user-writable location even when invoked withsudo, and only writes/usr/local/binas a symlink — the script already does this for the$HOME/.swamp/bincase, so the pattern exists.- Repeated autoupdate failures surface in normal CLI output — e.g. a
one-line warning on
swampinvocation when the scheduler has failed N consecutive times, orswamp doctorflagging the writability mismatch. Right now the only signal is hidden in~/.swamp/log/autoupdate.log.
Actual
install.shwith sudo leaves a root-owned binary at/usr/local/bin/swamp.swamp update --setup-autoaccepts the enable with no warning about writability.- The scheduled update fails daily with
permission denied, logs to~/.swamp/log/autoupdate.log, and is invisible to interactive use. swamp doctordoes not flag the mismatch.- The error message says "Re-run with: sudo swamp update", which is the right interactive fix but a no-op for the unattended scheduler.
Notes
The sudo guidance is in the installer's own --help (from install.sh):
# Installs the latest release for all users under `/usr/local/bin`
sudo $programSo users who follow the script's most-obvious "system-wide install" advice end up with autoupdate permanently broken.
Shipped
Click a lifecycle step above to view its details.
stack72 commented 5/18/2026, 9:48:40 PM
Hey @bixu — thanks for the detailed report! We went with a simpler approach than the LaunchDaemon route for now:
swamp update --setup-autonow blocks when running as root (POSIX). Since the scheduler runs as your normal user, enabling it viasudowould just set up a permanently broken autoupdate. The error message now tells you to re-run without sudo.New
swamp doctor installsubcommand — reports your installation health at a glance: binary path, owner, writability, version, autoupdate status, and last update outcome. If something's wrong it exits withUNHEALTHYand tells you what to fix. Works from anywhere (no repo needed).The inline permission warning now references
swamp doctor installso you have a clear next step when the background updater fails.
bixu commented 5/20/2026, 4:19:07 PM
So now I get
Installation Health Check
Binary path: /usr/local/bin/swamp
Version: 20260520.085517.0-sha.a85f376a
Binary owner: root (uid 0)
Writable: ✗ Binary is root-owned and not writable by current user
Autoupdate
Enabled: yes
Cadence: daily
Scheduler: installed
Last check: 2026-05-20T09:22:51.544Z (error)
Last error: Cannot update /usr/local/bin/swamp: permission denied. Re-run with: sudo swamp update
⚠ Autoupdate is enabled but the binary is not writable.
The background scheduler cannot replace /usr/local/bin/swamp.
Run `sudo swamp update` to update manually, or disable with:
`swamp update --setup-auto disable`
UNHEALTHYBut this means that I have to make the binary user-writable, which is what I was trying to avoid for security reasons. I'd rather give only a specific LaunchDaemon access to this to limit my local attack surface (GitHub themselves just got pwned by a laptop-scoped attack, this is a real threat).
Sign in to post a ripple.