Skip to content

fix(doctor): warn about network-backed SQLite storage - #178672

Merged
steipete merged 1 commit into
mainfrom
upd/upd-l1733
Oct 20, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/upd-l1733

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Fixes #177286

What Problem This Solves

Doctor does not explain when SQLite state is on a confirmed network filesystem, even though the connection owner already applies a safer journaling policy.

User Impact

Doctor now warns about WAL corruption risk and explains the existing rollback-journal protection on supported network storage. It recommends backing up and moving state to local storage. The finding is advisory; journaling, migrations, and update continuation retain their existing behavior.

Why This Change Was Made

The existing filesystem owner supplies positive network classification to Doctor's existing database inventory. Confirmed NFS/SMB/SSHFS and Windows network paths are distinguished from unknown and cross-VM storage. Configured SQLite paths remain eligible when database inspection fails; known PostgreSQL stores are excluded. Mount metadata is read once per pass, and failed advisory probes remain unknown.

The change adds 61 net production lines, 149 test lines, and one docs line. The production growth supplies the batch classifier and warning without adding configuration, persistent state, or a competing journaling policy.

Evidence

  • Regression red on the base: expected two NFS warnings, received zero. Final regression green: one test, 36 ms test time / 2.10 s wrapper time. Covers positive network types, local/unknown/cross-VM negatives, unreadable paths, PostgreSQL exclusion, Windows UNC/mapped drives, and one mount lookup across stores.
  • All eight direct-import sibling files plus the WAL suite ran in original order: together with the new regression, 93 tests passed and 13 platform/environment cases were skipped across ten files. No individual committed test exceeded 30 s. Cold shared compiler preparation took 267.8 s; one sibling's 234 s wall time was 97% transform with 106 ms of tests.
  • Scoped production and test tsgo, focused core oxlint, oxfmt on all four files, MDX validation, git diff --check, and madge (zero cycles) passed. The full check:changed SQLite inventory was skipped under the campaign's local gate budget; PR CI supplies broad proof.
  • Independent Codex autoreview completed with no actionable P0–P2 findings; the simplification pass retained one filesystem owner and one Doctor inventory.
  • Real compiled CLI smoke used the repository's createBuiltRuntime / runBuiltRuntime process harness, a verified current generation, a private package, and fresh isolated HOME/state. doctor --lint --only core/doctor/database-engine --json exited 0, reported ok: true / checksRun: 1, inventoried the actual SQLite store, and emitted no network warning on local storage. Artifact/source verification passed before and after. The fixture was reduced from a full runtime copy (39.7 s test time) to copying only the plugin artifacts that require physical package containment (18.0 s test time; CLI 11.5 s).
  • Live gap: the positive NAS cases use filesystem-metadata fixtures; no real NAS mount was available. The ordinary source launcher refused runtime publication before Doctor because it could not verify an affected Gateway offline. That guard was honored; no existing Gateway was inspected, stopped, restarted, or modified. The private-package smoke above exercised Doctor without changing a serving runtime.

@clawsweeper

clawsweeper Bot commented Oct 20, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations size: M labels Oct 20, 2026
@steipete
steipete marked this pull request as ready for review October 20, 2026 18:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T18:58:40.738600Z d16d019 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR warns when Doctor finds SQLite paths on confirmed network storage and recommends backing up and moving them to local storage.

Example: SQLite state is stored at /mnt/nas/openclaw/state/openclaw.sqlite on NFS.

  • Before: Doctor inventories the database without explaining its network storage or automatic rollback-journal protection.
  • After: Doctor reports an advisory warning explaining the WAL risk, existing protection, and recommended move to local storage.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, useful implementation with no actionable defect found; positive network behavior has fixture-based evidence rather than a demonstrated shipped-CLI run.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the external-contributor proof gate; its reported compiled Doctor CLI smoke covers local storage, while confirmed-network warnings are supported by metadata-fixture regression coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Operators cannot see why network-backed SQLite storage receives special journaling treatment or what storage arrangement is recommended.
Reason: The maintainer-authored direction adds actionable explanation with bounded complexity and preserves existing storage safeguards.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR adds a useful Doctor diagnostic that current main lacks, and review found no actionable introduced defect.

Priority: P3
Reviewed head: d16d01946e1c1e71c705874444b75573483dc103

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The positive network warning is exercised with mocked filesystem metadata; the supplied shipped-CLI smoke demonstrates only the local-storage negative case.
Agent review details

How this fits together

Doctor inventories physical database stores, passes eligible SQLite paths to the existing filesystem owner, and renders confirmed network-storage findings in text and JSON.

flowchart TD
  A[Doctor CLI] --> B[Database store inventory]
  B --> C[Eligible SQLite paths]
  C --> D[Filesystem classification]
  D --> E[Advisory findings]
  E --> F[Text and JSON output]
Loading

Technical review

Best possible solution:

Use the existing filesystem owner to explain confirmed network storage through Doctor’s existing inventory while preserving connection policy.

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

Current-main source establishes the missing Doctor explanation, and the PR reports a matching base-failing regression; no live NAS reproduction was supplied or run during this read-only review.

Is this the best way to solve the issue?

The implementation is appropriately scoped: it separates positive network classification from conservative rollback policy and reuses the existing Doctor inventory without introducing another journaling owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1c4b27072712.

Provenance checked

  • Filesystem classification and journaling keeps the original intent (fix(sqlite): disable WAL on network filesystems #93454: Centralize connection policy and disable WAL on detected network storage without claiming arbitrary network storage is safe.)
  • Shared mount-policy implementation keeps the original intent (d264306: Share equivalent infrastructure implementations while preserving policy, validation ordering, and public behavior.)
  • Doctor physical-store inventory keeps the original intent (6cf7c47: Report physical per-store observations truthfully, retaining unknown evidence and recovery guidance.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +61, Tests +149, Docs +1. Total +211 across 4 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 2 71 10 +61
Tests 1 149 0 +149
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 221 10 +211

Review metrics

Metric Value Why it matters
Production versus regression growth Production +61 net lines; tests +149 lines The growth supplies batched advisory classification and distinct storage/platform regression cases without adding configuration or persistent state.

Labels

Label changes:

  • add P3: This improves diagnostics for advanced network-storage deployments; existing runtime journaling protection remains intact.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This improves diagnostics for advanced network-storage deployments; existing runtime journaling protection remains intact.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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.

Reviewed October 20, 2026, 3:14 PM ET / 19:14 UTC.

@steipete
steipete merged commit 4c8d4c4 into main Oct 20, 2026
246 of 251 checks passed
@steipete
steipete deleted the upd/upd-l1733 branch October 20, 2026 20:03
steipete added a commit that referenced this pull request Oct 20, 2026
Fixes the mock-exports ratchet failure introduced by #178672.
steipete added a commit that referenced this pull request Oct 20, 2026
Fixes #177288. Docker and Kubernetes docs now explain that OpenClaw state must live on a local volume (not NFS/SMB; Doctor warns, #178672), that a single replica with stop-first rollouts is required, and how upgrade/Doctor ownership works, including Kubernetes entrypoint bypass. Supersedes #177367, thanks @akshitkhokhani.

Co-authored-by: Akshit Khokhani <[email protected]>
steipete added a commit that referenced this pull request Oct 20, 2026
Fixes the mock-exports ratchet failure introduced by #178672.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…aw#178672)

Fixes openclaw#177286. Doctor now emits an advisory warning when the state directory's SQLite databases are on confirmed network-backed storage (NFS/SMB/NAS), explaining the WAL risk and the existing rollback-journal protection. Warning-only: never blocks Doctor or updates; detection failure stays silent.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
Fixes the mock-exports ratchet failure introduced by openclaw#178672.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…aw#178794)

Fixes openclaw#177288. Docker and Kubernetes docs now explain that OpenClaw state must live on a local volume (not NFS/SMB; Doctor warns, openclaw#178672), that a single replica with stop-first rollouts is required, and how upgrade/Doctor ownership works, including Kubernetes entrypoint bypass. Supersedes openclaw#177367, thanks @akshitkhokhani.

Co-authored-by: Akshit Khokhani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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.

[Feature]: openclaw doctor checks state on NAS/network storage for SQLite WAL risk

1 participant