Skip to content

fix(update): stop warning about a package manager database that is not installed - #173118

Closed
wangmiao0668000666 wants to merge 1 commit into
openclaw:mainfrom
wangmiao0668000666:fix/update-package-owner-absent
Closed

wangmiao0668000666 wants to merge 1 commit into
openclaw:mainfrom
wangmiao0668000666:fix/update-package-owner-absent

Conversation

@wangmiao0668000666

@wangmiao0668000666 wangmiao0668000666 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #173084

What Problem This Solves

An update that cannot find the platform's package-manager executable tells the operator to restore that manager's database. On a Debian npm-global install (no pacman), the run prints:

pacman inspection failed during pacman query (ENOENT). pacman ownership could not be verified.
Restore access to the active pacman database and configuration, then retry.
Continuing without verified system-package ownership.

User Impact

Operators on distributions without the platform's package manager no longer receive Arch-specific database recovery instructions for a manager that is not installed. The inspection still warns and continues, and the warning now names the absent executable; confirmed package ownership still refuses replacement.

Why This Change Was Made

readPackageFiles reports every non-authoritative query outcome as an unavailable ownership database, so a launch ENOENT produced database-recovery guidance. The unavailable diagnostic is now split: a missing executable reports that the executable was not found and asks for manual ownership verification, while timeouts, non-zero exits, malformed inventories, and permission failures keep the existing database-restoration wording. Warn-and-continue and the pre-mutation refusal for confirmed ownership are unchanged; classification: behavior-preserving for every path except the misleading sentence.

This revision adopts the reviewer's recommendation and the recorded warn-and-continue policy from #169055: a launch ENOENT does not establish that no package database or owned files exist, so the inspection is not silenced — only its recovery guidance is corrected.

Impact surface:

Location Change
src/infra/update-system-package-ownership.ts:64 unavailable diagnostic split; launch ENOENT names the missing executable
src/infra/update-freebsd-pkg-ownership.test.ts:158 regression case for the absent package manager

Evidence

Shipped CLI, base 45f894640 → candidate a51912da7, same command on this host (command -v pacman → empty), isolated state directory, built dist from each revision:

BASE      node dist/index.js update --dry-run
[update] pacman inspection failed during pacman query (ENOENT). pacman ownership could not be verified.
         Restore access to the active pacman database and configuration, then retry.
         Continuing without verified system-package ownership.

CANDIDATE node dist/index.js update --dry-run
[update] pacman inspection failed during pacman query (ENOENT). The pacman executable was not found,
         so its package ownership could not be verified. Verify package ownership manually before
         replacing files. Continuing without verified system-package ownership.

Both runs printed the diagnostic for each inspection call site, produced the same dry-run plan (Update dry-run / No changes were applied / Install kind: git / …), and exited 0 without applying anything.

Regression, existing suite, red before / green after (the added case asserts the warning still fires, names the missing executable, and carries no database-restoration instruction):

pnpm test src/infra/update-freebsd-pkg-ownership.test.ts --maxWorkers=1
BASE + new case   1 failed | 11 passed   (warning says "Restore access to the active …")
CANDIDATE         12 passed              (97s)

Controls: the retained cases for timeout, denied and malformed manifests, budget exhaustion, alias and root-symlink ownership, and the positive pacman-owned-install refusal all still pass. tsc -p tsconfig.json --noEmit exits 0; oxlint reports 0 warnings and 0 errors on both files.

Not tested: an actual npm-global install upgrade (no install was performed); the shipped CLI was run in dry-run, which is the path that emits the warning. Only the unavailable-ownership message changes.

Merge Danger

Two-way door: reverting restores the previous diagnostic sentence and requires no migration. Warn-and-continue, the inspection budget, and the confirmed-ownership refusal are untouched.

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR names a missing package-manager executable instead of advising operators to restore its database.

Example: Run openclaw update --dry-run on Linux without pacman.

  • Before: The warning says to restore the active pacman database and retry.
  • After: The warning identifies the missing pacman executable, asks for manual ownership verification, and continues.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused correction with relevant shipped-CLI proof, a reported red/green regression, preserved owner policy, and no actionable finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The supplied base/head built-CLI update --dry-run output exercises the real ownership inspector with pacman absent and shows corrected guidance with unchanged successful continuation; a git installation suffices because this shared check runs before install-specific execution, and no upgrade behavior changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Debian npm operators receive instructions to restore a pacman database when pacman is absent.
Reason: The revision fixes misleading recovery text while preserving the existing owner's recorded decisions and defaults.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR corrects a real updater diagnostic without changing ownership protection or continuation behavior, and the revised CLI evidence resolves the earlier proof concern.

Priority: P2
Reviewed head: a51912da7a47ae2a9c4fde60c36da00847fed44f

Before merge

None.

Findings

None.

Agent review details

How this fits together

CLI and Gateway update paths use the shared system-package ownership inspector to check installation paths; it returns normally with warnings for unavailable inspection and refuses replacement for confirmed ownership.

flowchart TD
  A[Update request] --> B[Ownership inspector]
  B --> C[Native package query]
  C --> D[Missing executable]
  D --> E[Corrected warning and continuation]
  C --> F[Confirmed package ownership]
  F --> G[Replacement refused]
Loading

Technical review

Best possible solution:

Land the focused diagnostic correction in the existing inspector while retaining warning-and-continue and confirmed-owner refusal.

Do we have a high-confidence way to reproduce the issue?

Current-main source deterministically produces the reported warning for Linux launch ENOENT, matching the reporter's Debian update transcript; this review executed no target code.

Is this the best way to solve the issue?

Correcting the existing diagnostic is proportionate and preserves the documented ownership policy without distribution detection, new options, or competing inspection paths.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9e3514ae247c.

Provenance checked

  • System-package ownership diagnostics and continuation keeps the original intent (5d9a5ff: Share native ownership protection between pacman and FreeBSD pkg, refuse confirmed ownership, and warn while continuing on unavailable inspection.)
  • Safe native inspection diagnostics keeps the original intent (6c51352: Expose the failing operation and recognized errno without leaking native messages, paths, or causes.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 5d9a5ff adds src/infra/update-system-package-ownership.ts:46 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5d9a5ff1b44c; files: src/infra/update-system-package-ownership.ts)
  • Vincent Koc: Raw commit dfaec13 adds src/infra/update-freebsd-pkg-ownership.test.ts:97 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dfaec136991a; files: src/infra/update-freebsd-pkg-ownership.test.ts)

PR surface

Source +7, Tests +24. Total +31 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 10 3 +7
Tests 1 24 0 +24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 34 3 +31

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #173084
Summary: The canonical issue and competing patches concern the same missing-pacman diagnostic in the shared ownership inspector.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Incorrect recovery guidance causes unnecessary troubleshooting, while the update continues successfully.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-15T12:34:47.253Z sha b8a82914ed4582d1d30ca187bb69e4a7318cfebb :: needs real behavior proof before merge. :: none

Reviewed October 15, 2026, 9:16 AM ET / 13:16 UTC (Revision 2).

@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Revision a51912d adopts the recommended diagnostic policy (warn-and-continue preserved, missing executable named) and adds shipped-CLI dry-run proof for both revisions; the PR body is updated.

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 15, 2026
steipete added a commit that referenced this pull request Oct 15, 2026
…abase-restore advice (#173293)

A Debian npm update told the operator to restore the pacman database: when a system package manager's executable is absent (ENOENT), the ownership inspector reused its database-restoration advice. It now says the executable was not found and that ownership could not be verified; confirmed-owner refusal and continuation are unchanged. Supersedes #173118, #173122, #173144, thanks @wangmiao0668000666, @sunlit-deng, @DonnieFi.

Fixes #173084

Co-authored-by: wangmiao0668000666 <[email protected]>
Co-authored-by: sunlit-deng <[email protected]>
Co-authored-by: Donnie Fiander <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

Thanks for this! We landed the fix in #173293 (92280e2), which supersedes this PR and credits you as co-author. A missing package-manager executable now says the executable was not found instead of advising a database restore.

@steipete steipete closed this Oct 15, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…abase-restore advice (openclaw#173293)

A Debian npm update told the operator to restore the pacman database: when a system package manager's executable is absent (ENOENT), the ownership inspector reused its database-restoration advice. It now says the executable was not found and that ownership could not be verified; confirmed-owner refusal and continuation are unchanged. Supersedes openclaw#173118, openclaw#173122, openclaw#173144, thanks @wangmiao0668000666, @sunlit-deng, @DonnieFi.

Fixes openclaw#173084

Co-authored-by: wangmiao0668000666 <[email protected]>
Co-authored-by: sunlit-deng <[email protected]>
Co-authored-by: Donnie Fiander <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 22, 2026
…abase-restore advice (#173293)

A Debian npm update told the operator to restore the pacman database: when a system package manager's executable is absent (ENOENT), the ownership inspector reused its database-restoration advice. It now says the executable was not found and that ownership could not be verified; confirmed-owner refusal and continuation are unchanged. Supersedes #173118, #173122, #173144, thanks @wangmiao0668000666, @sunlit-deng, @DonnieFi.

Fixes #173084

Co-authored-by: wangmiao0668000666 <[email protected]>
Co-authored-by: sunlit-deng <[email protected]>
Co-authored-by: Donnie Fiander <[email protected]>
(cherry picked from commit 92280e2)
Co-authored-by: RomneyDa <[email protected]>
RomneyDa pushed a commit that referenced this pull request Oct 27, 2026
…abase-restore advice (#173293)

A Debian npm update told the operator to restore the pacman database: when a system package manager's executable is absent (ENOENT), the ownership inspector reused its database-restoration advice. It now says the executable was not found and that ownership could not be verified; confirmed-owner refusal and continuation are unchanged. Supersedes #173118, #173122, #173144, thanks @wangmiao0668000666, @sunlit-deng, @DonnieFi.

Fixes #173084

Co-authored-by: wangmiao0668000666 <[email protected]>
Co-authored-by: sunlit-deng <[email protected]>
Co-authored-by: Donnie Fiander <[email protected]>
(cherry picked from commit 92280e2)
@wangmiao0668000666
wangmiao0668000666 deleted the fix/update-package-owner-absent branch October 28, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Debian npm update tells the operator to restore the pacman database

2 participants