Repository navigation
fix: keep the existing install until the new archive has extracted - #201
Conversation
_deploy_unpacked_archive and _deploy_source_tarball wiped the target for CLEAN_INSTALL=1 before extracting into the workdir. Any failure after the wipe left an empty target: a truncated download, an archive that unpacks to nothing, or a disk that fills up while it unpacks. Update scripts such as ct/pulse.sh then have no binary left to restart. Extraction only writes into the workdir, so the wipe now waits until the payload has extracted and is non-empty, right before the copy. This was fixed in ProxmoxVE's misc/tools.func by community-scripts/ProxmoxVE#16312 the day after tools.func was split into this repo, so the split kept the old order. _deploy_source_tarball also refuses a tarball with no top-level directory: unpack_dir came back empty and the copy became cp -r "/"*.
Try this branchThe engine and the scripts resolve independently, so a production script can COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/rcourtman/core/fix/clean-install-after-extract \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/debian.sh)"Swap Run a script from a fork as wellcurl -fsSL https://raw.githubusercontent.com/rcourtman/core/fix/clean-install-after-extract/tools/run.sh |
bash -s -- https://raw.githubusercontent.com/YOU/DevScripts/your-branch ct/debian.sh \
https://raw.githubusercontent.com/rcourtman/core/fix/clean-install-after-extractNote that Useful flags while testing
|
|
Thanks, looks good. #16312 got lost in the split, and the guard against cp -r /* is a good catch. Could you merge main and keep both sides of the verify-split-files.yml conflict? It is only the test list. optional, but not blocking:
|
…er-extract # Conflicts: # .github/workflows/verify-split-files.yml
The function header already says what CLEAN_INSTALL does and when. The comment at the wipe only has to say why it sits after the extract.
|
Thanks. Main is merged with both sides of the test list kept, and the comment is now one line. On the follow-up: do you want a separate PR for the git clone path and |
|
both variants are fine for me. |
✍️ Description
With
CLEAN_INSTALL=1,_deploy_unpacked_archiveand_deploy_source_tarballemptied the target before extracting into the workdir. Any failure after that left an empty target: a truncated download, an archive that unpacks to nothing, or a disk that fills up while it unpacks. The last one is easy to hit. The Pulse linux tarball is ~287 MB in a 4 GB container, andct/pulse.shthen has no binary left to restart.Extraction only writes into the workdir, so the wipe now runs after the payload has extracted and is non-empty, right before the copy.
CLEAN_INSTALL_KEEP, return codes and messages are unchanged.This is community-scripts/ProxmoxVE#16312 again. It merged into
misc/tools.funcon 6 August, the day aftertools.funcwas split into this repo, so the split kept the old order._deploy_source_tarballnow also returns 251 for a tarball with no top-level directory. Before,unpack_dircame back empty and the copy ran ascp -r "/"*.tests/forge-clean-install.shcovers both helpers: truncated archive, empty payload, unsupported format, extraction failing partway (disk full), plus clean, merge andCLEAN_INSTALL_KEEPsuccess paths. 14/14 pass on Ubuntu 24.04 (GNU tar 1.35) and macOS (bsdtar 3.5). Against main, the five failure cases leave the target empty and every success case gives the same result.Tested on Proxmox VE 9.2 with a real
ct/pulse.shcontainer (Debian 13, defaults), built and updated withCOMMUNITY_SCRIPTS_CORE_URLpointed at this branch:/opt/pulseafter/tmptoo small to extract (500 MB tmpfs over the Debian 13 tmpfs), this branchmainactivating, API downOn
main,ct/pulse.shstill printed "Restarted the previously installed Pulse", becausesystemctl startsucceeds for aRestart=alwaysunit that has nothing left to run. Not tested on Incus (no Incus host here). Locally there are no ShellCheck errors and no new warnings, and the split-file checks and every script intests/pass.Written and tested with Claude Opus 5.5 (reasoning: high).
🔗 Related Issue
Related: community-scripts/ProxmoxVE#16312
✅ Prerequisites (X in brackets)
API.txtwas updated to match.🛠️ Type of Change (X in brackets)
README,docs/,CONTRIBUTING.md, or other docs.🤖 AI Assistance (X in brackets)