Repository navigation
fix(update): skip absent package-manager probes instead of reporting a broken database - #173155
xiaopan-xydt wants to merge 1 commit into
Conversation
…a broken database On a Linux host without pacman (Debian, Fedora, ...), the ownership probe could not be launched and the launch error was reported as a database failure, so update told the operator to restore the active pacman database and configuration. A manager that is not installed cannot own files: its inventory is empty, there is no database to restore, and no recovery guidance applies. Treat the absent executable as an empty inventory and keep warning-and-continue for genuine launch or query failures. Closes openclaw#173084
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close this PR as superseded by #173118, which fixes the same misleading guidance, preserves the documented warning policy, and has relevant CLI proof and passing exact-head CI. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Consolidate on the proven diagnostic-only replacement while preserving warnings for unavailable ownership inspection. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Consolidate on the proven diagnostic-only replacement while preserving warnings for unavailable ownership inspection. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically turns Linux probe ENOENT into database-restoration guidance, matching the reporter's Debian transcript; this review executed no target code. Is this the best way to solve the issue? Correcting the diagnostic in the existing inspector solves the reported problem while preserving its documented policy; suppressing the warning is an unnecessary behavioral change. Security review: Security review cleared: The patch changes diagnostic handling without adding execution sources, permissions, credential access, or cross-principal authority. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning medium; reviewed against 439366bce1be. |
|
ClawSweeper recorded closeout evidence for this proposed close.
|
Closes #173084
What Problem This Solves
On a Linux host that has never installed pacman,
openclaw updatetells the operator to repair a pacman database that does not exist. The updater now recognises that an absent package-manager executable is not a failed database query, so it stops printing Arch-specific recovery advice on hosts such as Debian.src/infra/update-system-package-ownership.tsmaps every Linux ownership probe to pacman. When thepacmanexecutable is missing, the launch failure (ENOENT) is reported aspacman-ownership-unavailable, whose message reads "Restore access to the active pacman database and configuration, then retry."ENOENT), treat it as "this optional manager is not installed here" and return an empty inventory before the query validation runs. A manager that is not installed cannot own files, so there is no database to restore and no inventory to compare.src/infra/update-system-package-ownership.ts(+13/-1); regressions added tosrc/infra/update-freebsd-pkg-ownership.test.tsandsrc/cli/update-cli/update-command-freebsd-pkg.test.ts.pacman-owned-install/pkg-owned-install; a real query failure (timeout, non-zero exit, unreadable output) still warns and continues; no distribution detection and no new package-manager subsystem.Why This Change Was Made
A launch error and a query error were funnelled into one diagnostic, so an optional manager that is simply not installed was reported like a broken database. Separating them at the launch site preserves the existing admission contract: the update continues either way, and only a confirmed ownership match still skips replacement.
command -v pacman(an extra process per inspection) or adding dpkg/rpm support. Rejected: absence is already observable from the failed launch, and per-distribution managers are a separate feature.PATHhides an installed manager now proceeds without a warning; that needs aPATHwithout/usr/bin, where the manager still cannot own the inspected files. FreeBSD/usr/sbin/pkgshares the same code path.User Impact
Debian (and other non-Arch) npm-global operators no longer see pacman database guidance during an update that has nothing to do with pacman. On hosts where the manager is genuinely installed, behaviour is unchanged, including the refusals that protect package-owned files.
Evidence
command -v pacmanprints nothing on this Debian host, matching the reported environment.Before the fix — real
openclaw updateentry point, two ownership inspections (target + admission):After the fix — identical command on the same host; zero pacman/ownership lines remain:
Both transcripts counted for
pacman|ownership: before = 2 lines, after = 0 lines.Regression matrix,
pnpm test src/infra/update-freebsd-pkg-ownership.test.ts src/cli/update-cli/update-command-freebsd-pkg.test.ts --maxWorkers=1:/usr/sbin/pkgabsent (ENOENT)*-owned-installFinal run of those two files:
Tests 14 passed (14)(infra shard) andTests 12 passed (12)(cli shard),[test] passed 2 Vitest shards.Not tested: no host with a real pacman database was available here, so the confirmed-pacman-owner path is covered by the existing mocked regressions only.
pnpm check:changedwas run as well:oxfmt --checkandgit diff --checkare clean; the command still exits non-zero on a pre-existing staleconfig/max-lines-baseline.txtentry forsrc/channels/plugins/bundled.shape-guard.test.ts, which exists onorigin/mainand is untouched by this PR.AI Assistance 🤖
This PR is AI-assisted. Used
grep,git diff, andnode --import tsxto trace the reported warning from the issue transcript tosrc/infra/update-system-package-ownership.ts, andvitestto reproduce it before and after the fix. The implementer understands the code: a spawn ENOENT means the optional manager is not installed, so its inventory is empty and no database-restore guidance applies. All evidence above is from real local runtime execution.