install.sh upgrade does not install the new client build (same package version) #206
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage#206
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on the test client on 2026-11-15 (GRI-2051).
install.sh upgradeprinted "installed grimoirix-signage-client_0.1.0_amd64.deb" and left the old binary in/usr/bin(sha 29296aaf from 11-13; the freshly built one was ee490c48). Fixed by hand withdpkg -i.Cause.
install.sh:426runsapt-get install -y "$deb". The package version is0.1.0on every build, and apt skips a package whose version is already installed, with exit 0. The output goes to/dev/null, so nothing shows it.Fix options.
apt-get install --reinstall -y "$deb"(keeps dependency resolution, which plaindpkg -idoes not).0.1.0+git<date>.<sha>frompackage-client-deb.sh, so an upgrade is a real upgrade anddpkg -ltells which build runs.Recommended: both. (2) makes the installed build visible; (1) makes a rebuild of the same commit still apply.
Also: after installing, the script must restart the running player (or say plainly that a restart/log-in is needed). The player that was running kept the old binary until the device was restarted.
Acceptance. Running
install.sh upgradetwice on two different commits leaves the second build's binary in/usr/bin, and the script prints the installed version.Fix is in PR #217 (base
dev, commit7613c535). CI is queued: position 2, ETA about 1h50.Cause, reproduced. I ran the real apt-get and dpkg against a private dpkg database. A plain
apt-get install -yof a second build with the same version exits 0 and leaves the first build's binary on disk.--reinstallreplaces it. An older version also needs--allow-downgrades.What changes.
0.1.0+git<UTC commit time>.<sha>, sodpkg -l grimoirix-signage-clientshows which build runs.install.shrunsapt-get install --reinstall --allow-downgradeson the exact file the package script built. Then it checks that the dpkg version and the sha256 of/usr/bin/grimoirix-signage-clientmatch the.deb. On a mismatch it stops with an error instead of printing "installed". It prints the installed version and the binary's sha.scripts/tests/install-client-upgrade-test.sh(18 assertions, real apt and dpkg, no root). It runs inlocal-gates.shand as CI jobinstaller.Owed before this closes: the acceptance run on the test client from GRI-2051. I can't run it from the build host: there is no desktop session there, and I have no access to the device.
curl -fsSLo install.sh https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/raw/branch/fix/GRI-2081-client-upgrade-reinstall/install.shsudo SCRYGLASS_REF=fix/GRI-2081-client-upgrade-reinstall bash install.sh upgrade client --forcedpkg-query -W grimoirix-signage-client.sha256sum /usr/bin/grimoirix-signage-clientequals the printed sha. The player on screen came back by itself.dev(SCRYGLASS_REF=dev). The version and sha change to the new build.Why
install.sh client upgradewas red in CI ond281986a, and the fix (nowc523957).The job log shows 17 of 18 checks passing. The only failure was
the old player is gone. All install checks passed, and so did the player restart.Cause: the CI container's PID 1 does not reap orphans. The old player is started with
setsid -f, so its parent there is that PID 1. Once stopped, it stays a zombie, andkill -0succeeds on a zombie. On the build host, the run has a subreaper that reaps it, which is why the test passed 18/18 locally. Nothing about apt or dpkg differs between the two.It was in
install.shtoo, not only in the test.restart_playersusedkill -0to wait for the old player to stop. Under a parent that never reaps, it waited the full 10 s and then sent SIGKILL to a process that had already exited.Fix:
install.sh: a newpid_alivereadsState:from/proc/PID/statusand countsZas stopped.restart_playerswaits on it.Measured on the build host:
install.sh: red,the stop did not wait out its ten seconds on the zombie (13s).pre-push-test.shandrepo-boundary: 0.origin/dev is merged in. CI run #349 is going.
CI / cargo testred onc523957: a flake in dev's test code, not this branch. Measured 12:1x UTC.server --lib(run #349, job 4):pptx_video::tests::fallback_returns_pages_in_page_order, which panicked atcrates/server/src/pptx_video.rs:1326withFailed { tool: "soffice", detail: "Text file busy (os error 26)" }. The other 193 passed.agit diff --stat origin/dev...HEADlists 6 files:ci.yml,README.md,install.sh,local-gates.sh,package-client-deb.shand the new shell test. No Rust changed. The test and itsfake_programhelper came in with GRI-2014 (7e5a777and earlier).fake_programwrites a shell script and then the test executes it. If a parallel test thread forks between that write and its close, the forked child holds a write handle on the script until the child execs. Executing the script during that window fails with ETXTBSY. This is a known race in multithreaded test binaries. The same helper shape is incrates/server/src/pdf.rs:209andcrates/server/tests/pptx_video_acceptance_integration.rs:112, so the race can strike any PR, not only this one.canRerun: falseon run #349. I did not push an empty commit to re-trigger it, because that would cost a full run on the single runner and leave a meaningless commit in the PR.Asks for the chief of staff:
cargo teston run #349 (https://git.grimoirix.org/Grimoirix/grimoire-of-digital-signage/actions/runs/349).fake_programusers, or to write the script from a child process, so the test process never holds a write handle on a file it later executes.12:5x UTC:
cargo testonc523957(run #349) had not been re-run, and the branch was 7 commits behind dev. I merged origin/dev (GRI-2073, #214) and pushed2ee3f44, which starts a fresh CI run. The diff against dev is still the same 6 non-Rust files (install.sh, ci.yml, README, three scripts), so acargo testred here would again be dev's code, not this branch's.Next:
fj ci 217. 0 = ask the chief of staff to merge. 1 with the sameText file busyinpptx_video/pdftests = the GRI-2014fake_programflake again; I'll report it and leave the flake-issue decision with the chief of staff. 1 with anything else = I fix it.Waiting on #220 (the ETXTBSY test flake), per the chief of staff. #217 needs no change. When #220 is in
devI mergedevinto the branch once more and push. The chief of staff merges #217 on green.