Repository navigation
fix(update): fall back to a byte copy when the file-clone ioctl is denied - #165257
Conversation
…nied Retry unavailable native file clones through guarded byte copying for retained runtimes, plugin snapshots, and SQLite copies. Preserve source identity, publication, space admission, and genuine I/O error checks. The installed 2026.9.7 driver retains its own code before candidate execution; affected first hops still need a manual npm install of a fixed release. Later update hops use the repaired copier. Refs #164113. Thanks @MrJanvar and @rybing7 for the independent reports.
|
🦞👀 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. |
|
Codex review: needs changes before merge. Reviewed October 4, 2026, 9:54 PM ET / October 5, 2026, 01:54 UTC. ClawSweeper reviewWhat this changesThe PR adds a shared guarded byte-copy fallback for update runtime retention, candidate plugin snapshots, and SQLite file copies when native cloning is unavailable. Merge readiness⛔ Needs changes before merge - 1 item remains This fix remains necessary: current main still propagates the reported clone denial, and independent container reports support the failure. No introduced correctness defect was found. Priority: P0 Review scores
Verification
How this fits togetherThe updater copies installed runtime files, plugin trees, and database snapshots before replacing packages. Guarded filesystem copying preserves source identity and controls destination publication so validation and recovery can use those copies safely. flowchart TD
A[Installed runtime and plugin files] --> C[Guarded file copy]
B[SQLite snapshot files] --> C
C --> D{Clone available?}
D -->|Yes| F[Verified destination]
D -->|Capability refused| E[Admit guarded byte copy]
E --> F
F --> G[Update validation and recovery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +54, Tests +141, Docs +12, Other +1. Total +208 across 9 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep clone recovery inside the existing guarded copy owner and provide visible guided recovery for installations whose older updater cannot use the fix. Do we have a high-confidence way to reproduce the issue? Yes, from source and independent container reports: retention requests clone:auto and pinned fs-safe propagates FICLONE EPERM. No current-main runtime reproduction was executed in this read-only review. Is this the best way to solve the issue? Yes. Retrying through Root.copyIn preserves the existing safeguards and is narrower than disabling native filesystem support or changing container security policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 12785be2ff02. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…nied (openclaw#165257) Closes openclaw#164113 Reported by @MrJanvar and @rybing7.
Close the remaining XFS/ZFS copyTree capability gap after #829 by sharing the exclusive-target FICLONE errno classifier. Keep native cloning strict and preserve raw operational errors; TypeScript selects byte copying only after native workers settle and partial output is removed. Add isolated seccomp regressions for the file job and worker pool, plus auto/always partial-progress and residue-rejection coverage. Update copying docs and the Unreleased changelog. Validated with Rust workspace tests and Clippy on Linux/macOS, builds, focused tests, pnpm check (17,170 passing tests), all OS CI lanes, CodeQL, and clean P0-P2 Codex review. Refs: openclaw/openclaw#165257
What Problem This Solves
Fixes
openclaw updateaborting atupdater-runtime-retentionin unprivileged containers whose seccomp policy denies the FICLONE ioctl.Closes #164113. Thanks @MrJanvar and @rybing7 for the independent reports and syscall evidence.
User Impact
Updaters carrying this fix continue with a guarded byte copy and one warning per copy operation when cloning is unavailable. Native safeguards, file modes, source identity checks, snapshot verification, and SQLite byte-copy space admission remain active. Genuine EIO and unrelated EPERM failures still stop the copy.
The first hop from 2026.9.7 in an affected container still requires a manual npm install of a release containing this fix; later update hops use the repaired copier. Globally disabling native filesystem support is not the fix because Doctor migrations require those safeguards.
Why This Change Was Made
One copy adapter owns capability fallback for retained runtime files, candidate plugin snapshots, and SQLite copies. It retries through the same
Root.copyInowner withclone: "never", preserves the caller's guards, and refuses to retry after destination publication. Concurrent copies share one warning and stop requesting clones after the first refusal.The package-swap copier already defaults to
clone: "never"; its earlier EXDEV fix handles directory renames. The dependency's exclusive snapshot publisher already handles clone capability refusals and verifies copied bytes. No dependency bump, configuration option, or schema change is included.Evidence
@openclaw/[email protected]boundary atnode_modules/@openclaw/fs-safe/dist/copy-file-input.js:51only falls back for ENOTSUP and lacks the FICLONE EPERM fallback. This adapter supplies it without a dependency bump, matching the direct native syscall cause while preserving EIO and cleanup failures.c074824a27c96d3983043f9eeb33823cd1772d8c,src/cli/update-cli/update-command.ts:539and its installed retention owner). A candidate cannot change that already-running driver. The FIRST hop from 9.7 inside such a container still needs the manual npm install; later hops work.pnpm test <file> --maxWorkers=1measurements: retention tree 20 tests / 9.88 s; candidate plugin tree 21 tests / 11.18 s; SQLite file copy 7 tests / 11.42 s.eager-import-closure.test.ts(package and PR inventory closures) andpr-wrapper-source-closure.test.ts(3 entrypoints), 5 selected checks in 17.67 s.OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs --staged --timedcompleted locally: all 35 checks passed, including production/test typechecks, lint, dead exports, and import cycles.git diff --checkpassed. No gate was skipped or substituted.