doinst.sh stale-component cleanup may select previous -upgraded- package manifest
Environment
- Unraid OS 7.3.2
- Upgrade:
dynamix.unraid.net-4.37.4-x86_64-5 → 4.37.5-x86_64-2
- 4.37.5 installed automatically through Plugin Auto Update
Reproduction
After the upgrade, pkgtools contained both:
/var/lib/pkgtools/packages/dynamix.unraid.net-4.37.4-x86_64-5-upgraded-2026-10-01,05:30:14
/var/lib/pkgtools/packages/dynamix.unraid.net-4.37.5-x86_64-2
The cleanup added in #2063 uses:
for candidate in var/lib/pkgtools/packages/dynamix.unraid.net-* var/log/packages/dynamix.unraid.net-*; do
if [ -f "$candidate" ]; then
package_db="$candidate"
break
fi
done
Because the glob returns the previous 4.37.4-...-upgraded-... entry before 4.37.5, package_db points to the previous package manifest, not the newly installed one.
The cleanup then treats new 4.37.5 components as stale and deletes them.
Observed examples:
HeaderVersion-D0NK2O8v.js
BaseLogViewer-CdKyG-uI.js
ServerStatus-C-vSmgEE.js
SingleLogViewer-C7GZ7DTf.js
notification.subscription-B2qxOKMN.js
This caused missing WebGUI elements. Re-running installpkg reproduced the deletions (Removing stale component file: ...).
Extracting unraid-components directly from the same valid 4.37.5 TXZ, without running doinst.sh, restored the files and immediately restored the WebGUI.
Root cause
The cleanup assumes that the first dynamix.unraid.net-* package database entry is the current package.
That assumption is not valid during/after an upgradepkg operation when the previous -upgraded-... manifest and the new manifest coexist.
Suggested fix
Select the manifest corresponding explicitly to the package currently being installed instead of selecting the first wildcard match.
At minimum, *-upgraded-* entries should not be eligible when identifying the current package manifest.
A regression test should cover:
/var/lib/pkgtools/packages/
dynamix.unraid.net-4.37.4-x86_64-5-upgraded-...
dynamix.unraid.net-4.37.5-x86_64-2
and verify that the 4.37.5 manifest is selected and current 4.37.5 components are preserved.
Related: #2063 — fix(plugin): clean stale web components from TXZ installs
doinst.shstale-component cleanup may select previous-upgraded-package manifestEnvironment
dynamix.unraid.net-4.37.4-x86_64-5→4.37.5-x86_64-2Reproduction
After the upgrade, pkgtools contained both:
The cleanup added in #2063 uses:
Because the glob returns the previous
4.37.4-...-upgraded-...entry before4.37.5,package_dbpoints to the previous package manifest, not the newly installed one.The cleanup then treats new 4.37.5 components as stale and deletes them.
Observed examples:
This caused missing WebGUI elements. Re-running
installpkgreproduced the deletions (Removing stale component file: ...).Extracting
unraid-componentsdirectly from the same valid 4.37.5 TXZ, without runningdoinst.sh, restored the files and immediately restored the WebGUI.Root cause
The cleanup assumes that the first
dynamix.unraid.net-*package database entry is the current package.That assumption is not valid during/after an
upgradepkgoperation when the previous-upgraded-...manifest and the new manifest coexist.Suggested fix
Select the manifest corresponding explicitly to the package currently being installed instead of selecting the first wildcard match.
At minimum,
*-upgraded-*entries should not be eligible when identifying the current package manifest.A regression test should cover:
and verify that the 4.37.5 manifest is selected and current 4.37.5 components are preserved.
Related: #2063 —
fix(plugin): clean stale web components from TXZ installs