fix(pulse): keep the container recoverable when an update fails - #16311
Open
rcourtman wants to merge 1 commit into
Open
fix(pulse): keep the container recoverable when an update fails#16311rcourtman wants to merge 1 commit into
rcourtman wants to merge 1 commit into
Conversation
- Do not delete /opt/pulse/pulse before the download. CLEAN_INSTALL=1 already wipes the target, so the rm only widened the failure window and destroyed the v5 binary when the fetch failed. - Guard fetch_and_deploy_gh_release and restart the running installation when it fails, instead of exiting through the error handler with Pulse stopped. - Re-enable the unit after the pulse-backend to pulse rename, but only if it was enabled before, so a deliberately disabled service stays that way.
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✍️ Description
Three related fixes to
update_script()inct/pulse.sh. All are about the same thing: a failed or migrating update currently leaves the container in a state the operator cannot recover from.1. The pre-fetch
rm -f /opt/pulse/pulseis a vestige and is actively harmful.On a v5-layout container that file is the Pulse binary, and
pulse-backend.servicepointsExecStartat it. It is deleted after the service is stopped and before anything is downloaded, so a failed download leaves the container with no binary at all.It is also redundant. It was added back when the fetch call had no
CLEAN_INSTALL=1(226a5bc, 2025-09-09), so it was the only thing clearing the old binary.CLEAN_INSTALL=1was added later and_deploy_unpacked_archivenow wipes the target anyway.2. A failed fetch leaves Pulse stopped.
catch_errorssetsset -Eewith an ERR trap, so a 403 rate limit, DNS failure or truncated download exits through the error handler and never reachessystemctl start. The fetch is now guarded and the previously installed Pulse is restarted, reporting honestly whether that restart worked. Exit code 250 matcheserror_handler.func's "App: Download failed or version not determined", consistent withct/ollama.sh.3. The
pulse-backend.servicetopulse.servicerename drops boot enablement.The installer created and enabled
pulse-backend.serviceup to a403da9 (2025-08-14) and switched topulse.serviceat 226a5bc. Containers built in that window have a wants symlink pointing at the old name; themvleaves it dangling and nothing enables the new name, so Pulse stops starting at boot. The unit is now re-enabled after the rename, but only when it was enabled beforehand, so an operator who deliberately disabled autostart keeps that.Testing
Throwaway unprivileged LXC on PVE 9.2.5, Debian 13, systemd 257. Each behaviour checked unpatched and patched.
pulsereportsdisabled, wants symlink dangling, no boot startenabled, symlink correctdisabled/opt/pulseholds onlyVERSION, binary gonepulse.serviceactive + enabled, old unit gone,Pulse v6.1.2, listening on 7655The download failures were produced by blackholing the release asset hosts while leaving
api.github.comreachable, so the update check succeeds and the failure lands on the download, which is the window at issue.No
create_backup/restore_backupis needed here: Pulse keeps its state in/etc/pulse, outside the app dir, which is the designAGENTS.mdsays to prefer.I maintain Pulse and am a co-author of this script.
AI assistance: written with Claude Opus 5 (
claude-opus-5) in an interactive Claude Code session with extended reasoning. Every claim in this PR was reproduced on real hardware before submitting, and I have reviewed the diff.🔗 Related Issue
N/A
✅ Prerequisites (X in brackets)
🤖 AI Assistance (X in brackets)
AGENTS.mdand.github/agents/pve-script-creator.agent.mdas guidance, and the output has been reviewed and corrected to match those guidelines.🛠️ Type of Change (X in brackets)
README,AppName.md,CONTRIBUTING.md, or other docs.