GeezerVison is showing github.com — pm-stack databases (Kaneo Postgres, Grist, Pad) have no backup routine — docker volumes are the only copy · Issue #1514 · developing-today/code
pm-stack databases (Kaneo Postgres, Grist, Pad) have no backup routine — docker volumes are the only copy #1514DescriptionGap (backup audit, 2026-10-27): pm-stack application databases have no backup routine at all
The dashboard's state files got a backup system today (#1459, closed), but the pm-stack application databases were not part of it:
- Containers
pm-stack-postgres-1 / pm-stack-kaneo-1, grist-grist-1, pad-pad-1 are running on the laptop (up 32h at audit time). Their data lives only in docker volumes: pm-stack_postgres_data, grist_grist_data, pad_pad_data.
- Verified by grep on 2026-10-27: no
pg_dump (or any dump/snapshot step) exists in any laptop tool script, systemd unit (user or system), or pm-stack script. No timer or cron covers these volumes.
- If the laptop disk or the docker volumes are lost, Kaneo's boards, Grist's documents, and Pad's data are gone — there is no second copy anywhere.
This is the implementation gap under the durability design in #1258 (stack state in backed-up durable storage): the aggregator state leg landed via #1459; the database leg never did.
Acceptance
- A nightly routine dumps the Kaneo Postgres database (and snapshots/exports Grist + Pad data) into an existing backed-up location (the dashboard-backup set or the restic repo-archive pattern), with an off-machine leg (R2 and/or Google Drive).
- One restore is actually performed and evidenced (restore the Kaneo dump into a scratch container and open it).
- The routine's freshness is visible somewhere the fleet already looks (watchdog or dashboard health), so a silent stop gets named.
Acceptance criteria
Activitydeveloping-today commented on Oct 27, 2026 dezren39 commented on Oct 27, 2026 Manual backup run — done and verified (2026-10-27)
Gap #1 handled by hand today per Drew's order. The pm-stack databases are no longer single-copy.
What was backed up, and how
- Kaneo — PostgreSQL (
kaneo DB in pm-stack-postgres-1): pg_dump -Fc + pg_dumpall --globals-only, credentials expanded inside the container only (no values printed or written anywhere).
- Grist —
home.sqlite3, grist-sessions.db, and docs/czYHYKgG9SHcm9CPwiKEq1.grist: online backups via the sqlite backup API inside the running container (a raw copy of a live DB is not a backup).
- Pad —
pad.db via the sqlite backup API from a one-off tool container (the pad image ships no sqlite tooling), plus encryption.key, config.toml, .pad.toml, and attachments/. The encryption key is required to restore pad.db (data is encrypted at rest), so it travels with the backup into the same private stores as the database itself.
Bundle (dashboard-backup convention): ~/backups/pm-stack/2026-10-27/pm-stack-2026-10-27.tar.zst — 3,340,257 bytes, sha256 a1ad3034ef06bdb86af3b3ff2c7e40579b7f98b75acea88215b622154b50e037, manifest.json covering 9 files, verified against the manifest at write time.
Offsite copies, both verified
- Google Drive, "Muse Backups" folder: file id
1IN6uOWsim2Ifn-VSk2JOBZUfgyemLd5l — size and md5 (faa798b680ccd90399f079367bc2f71f) match the bundle.
- Cloudflare R2, bucket
supabase-backups, key pm-stack/2026-10-27/pm-stack-2026-10-27.tar.zst — HEAD-verified (size + stored sha256 metadata), and a GET back was byte-identical.
Restore sanity, performed from the R2 copy
- Manifest re-verified 9/9 after extraction.
- sqlite
integrity_check = ok on all four stores (grist home 26 tables, sessions 1, doc 33, pad 87).
- Kaneo: full
pg_restore of the offsite dump into a scratch database succeeded — 92 TOC table entries, 9,439 live rows after analyze; scratch DB dropped.
Routine (scheduling handoff, no snowflake timer created): the dump+package step is a single idempotent script, ~/tools/pm-stack-backup.sh on the laptop (dated bundle per day, 30-day prune of its own day dirs). The NixOS flake backup service (#1516 / dezren39/darwin-nix#976) should call/fold this script for the daily schedule. Two gotchas are documented in the script: the grist image entrypoint swallows docker run <img> python3, and a stdin-fed program over the laptop access path proved unreliable — the Pad step uses docker create + docker cp instead. dezren39 commented on Oct 28, 2026 Intake review
Fleet-monitor intake pass (2026-10-28): verified still live — filed today from the backup audit with no labels at all; no merged PR or routine covers the pm-stack application databases (the dashboard state-file leg landed separately). Labels applied: kind/infrastructure, source/human, priority/high, effort/m, status/needs-triage, app/pm-stack.
dezren39 commented on Nov 2, 2026 dezren39 commented on Nov 8, 2026 🤖 Agent note · closed (verified completed)
- Agent: queue worker (repo-worker-code), OpenChamber scheduled lane
aea12c82-c5af-4e5a-9b66-f8e360f87177
- Session / ID: task 11948 (triage)
- Found via: queue claim on
repo-health-code-pilot
Verdict: CLOSED — all acceptance criteria verified fully satisfied on current main & laptop host.
- Verification evidence:
- The daily pm-stack dump routine runs from
pm-dashboard-backup.service and produces Kaneo PostgreSQL (custom dump + globals), Grist SQLite, and Pad SQLite/attachments/keys in ~/backups/pm-stack/<date>/.
- Today's (2026-11-08) run executed successfully: pm-stack archive 13.8MB; dashboard archive 15.1MB; local, R2, and Drive legs verified, service exit 0/SUCCESS.
pm-dashboard-backup run ledger shows db-dump, local-archive, r2-upload, drive-upload all ok; watchdog reported healthy within 26h.
- Restore was previously performed and documented on 2026-10-27: Kaneo scratch restore (92 TOC entries, 9,439 rows) and SQLite integrity checks passed for Grist/Pad stores.
- The directory mismatch was fixed by merged PR fix(pm-dashboard-backup): point DUMP_DIR at pm-stack-backup.sh output dir #4651; the backup artifacts and completed daily run verify integration.
developing-today commented on Nov 8, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 8, 2026 agent-note:v1 — task 11948 DONE (already_done) (lane code-l). Fresh verification 2026-11-08 (x2): this issue is CLOSED, stateReason=COMPLETED, closedAt 2026-11-08T15:46:46Z, so the triage remainder in task 11948 is moot. Task 11948 completed via the queue with outcome already_done (the runbook sec.2 path for an already-closed issue) instead of another opencode handoff cycle; in-flight labels (status/parked, queue/parked, work/assigned) removed. The queue spawned follow-on task 13897 at completion. developing-today commented on Nov 9, 2026 🤖 Agent note · done (already_done)
- Agent: repo queue worker, lane code-g (repo-worker-code)
- Session / ID: cron repo-queue-worker-shift-g run 2026-11-08 19:03 CST; task 13897
- Found via: claimed task 13897 this shift (revived follow-on of task 6593 via triage task 11948); execution-lane assignment returned opencode (lane row 5278), but revalidation made the handoff moot — see below.
- Task: Task 13897 (small_fix) asked for a triage verdict on the remainder of issue pm-stack databases (Kaneo Postgres, Grist, Pad) have no backup routine — docker volumes are the only copy #1514. Fresh verification this shift (x2): issue pm-stack databases (Kaneo Postgres, Grist, Pad) have no backup routine — docker volumes are the only copy #1514 is CLOSED, stateReason=COMPLETED, closedAt 2026-11-08T15:46:46Z, and carries no in-flight queue/status/work labels. Task 11948 already completed this exact remainder on 2026-11-08 with outcome already_done (lane code-l, note on this issue), so task 13897's acceptance is already satisfied: the verdict is recorded, no actionable remainder exists, and the issue stands closed on landed evidence (PR docs: design PM-stack durability and failover (#1258) #3993, PR feat(pm-dashboard-backup): per-step run ledger in .last-run.json (#1854 rule 2) #4058 per the packet). Task 13897 completed directly with outcome already_done rather than another opencode handoff cycle — the same call task 11948's holder made.
- Expectation: nothing remains on pm-stack databases (Kaneo Postgres, Grist, Pad) have no backup routine — docker volumes are the only copy #1514; no follow-on task enqueued.
- Links: task 13897 · task 11948 · issue pm-stack databases (Kaneo Postgres, Grist, Pad) have no backup routine — docker volumes are the only copy #1514
dezren39 commented on Nov 14, 2026 Kaneo (pm-stack) backup — verified healthy, 2026-11-14
Full audit + restore-verify performed today (2026-11-14, ~11:20–11:40 CST) at Drew's order. The routine is healthy; this issue stays closed. No fix was needed.
Routine as it actually runs today
- Scheduler:
pm-dashboard-backup.timer (04:30 local, NixOS flake service, code#1516) → runs ~/tools/pm-stack-db-backup.sh (bridge) → ~/tools/pm-stack-backup.sh as its DB-dump step, then files the bundle inside the dashboard archive to all three destinations.
- Script references match the live deployment exactly (verified against
docker ps): pm-stack-postgres-1 (DB kaneo), pm-grist, pm-pad, volume pad_pad_data — all up/healthy.
- Today's run: started 2026-11-14 04:30:58 CST, run record
~/backups/dashboard/.last-run.json = complete, all steps ok (validate-date, credentials, db-dump, local-archive, r2-upload, drive-upload). Watchdog (laptop-backups-watchdog, code#1841) 06:33 CST: OK, fresh within 26h.
- Local history: a pm-stack bundle for every day 2026-11-01 → 2026-11-14, sizes growing monotonically (8.5 MB → 19.9 MB). The only empty day-dirs are 2026-10-30/31 — the known pm-stack backups silently produced empty day-dirs for 3 days (stale container names; no alarm) #3869 incident, fixed 2026-11-01. The silent-failure class has not recurred.
Today's backup (2026-11-14)
| Copy |
Identifier |
Size |
sha256 |
| Laptop local pm-stack bundle |
~/backups/pm-stack/2026-11-14/pm-stack-2026-11-14.tar.zst |
19,856,143 B |
d5526abd607a05dccc6103d2786ea1fd220f6d281e7959e8b6ddecc1b5ea4184 |
| Carrying dashboard archive (local) |
~/backups/dashboard/2026-11-14/dashboard-2026-11-14.tar.zst |
22,723,341 B |
8d2bd70582082346c3e533bfb0c313d68320e2eb37f187f680018630cd83ec15 |
| R2 |
supabase-backups/dashboard/2026-11-14/dashboard-2026-11-14.tar.zst (bundle inside as db-dumps/) |
22,723,341 B |
downloaded and hashed today: identical 8d2bd705… |
| Drive |
Cloud/cold-store/db-backups/pm-aggregator/2026-11-14/dashboard-2026-11-14.tar.zst |
22,723,341 B |
MD5 405c9b3b79c4305dd956da350c15e405, matches local MD5 |
Bundle contents (manifest-verified 9/9 files): kaneo/kaneo.dump (19,265,842 B) + globals.sql, Grist home.sqlite3 + grist-sessions.db + 1 doc, Pad pad.db + encryption.key + configs.
Note on destinations: the standalone copies filed at this issue's 2026-10-27 completion (pm-stack-2026-10-27.tar.zst, 3,340,257 B, in Drive "Muse Backups" and R2 supabase-backups/pm-stack/2026-10-27/) were a one-off; the durable routine's offsite path is the dashboard archive above. Both 2026-10-27 copies are still present.
Restore-verify — from the R2 copy (not the local file)
Downloaded the R2 dashboard archive, hashed it (match above), extracted the inner pm-stack bundle (sha256 matches local d5526abd…), verified its manifest 9/9, then:
pg_restore into scratch DB kaneo_restore_verify (rc 0, dropped afterwards):
- task: 4,273 restored vs live production 4,564 — reconciled exactly: live tasks created after the dump snapshot (2026-11-14T10:31:33Z) = 291; live tasks created ≤ snapshot = 4,273; restored tasks after snapshot = 0 (restored max
created_at 10:29:44Z).
- Total rows (45 public tables): 70,653 restored vs 72,719 live — the 2,066 gap is post-snapshot fleet activity (291 tasks + 587 labels created since 04:31, plus relations; label count also reflects ~184 label deletions in the interval, per created_at reconciliation).
- Spot counts restored vs live: project 5/5, workspace 2/2, user 2/2, column 20/20, comment 0/0.
- Grist + Pad from the same R2 bundle:
PRAGMA integrity_check = ok, 0 FK violations on all four stores (grist home 26 tables, sessions 1, doc 33, pad 87); Pad encryption.key (64 B) and config.toml present in the bundle.
Live production counts were taken 2026-11-14 ~11:24 CST via psql against pm-stack-postgres-1/kaneo (task count also re-derived from the created_at reconciliation above — two independent routes agree at 4,564). dezren39 commented on Nov 23, 2026 agent-note:v1
event: pointer — restore-side evidence for this routine's backups (2026-11-23 cold-restore drill, #10300)
by: agent felix (kind muse, Muse sandbox seat), lane under Felix
at: 2026-11-23
The 2026-11-22 generation this routine produced was restored end-to-end from its off-machine copies (R2 + Drive) in the #10300 drill: both legs present and byte-identical (Drive verified by stored MD5), inner manifest 9/9 sha256-verified, all stores integrity-clean and smoke-passed; measured RTO 145 s. Record: PR #13025 / doc/pm-stack/restore-drills/2026-11.md. One restore-side finding for this routine's record: the Drive leg's download throughput measured ~8 KB/s during the drill — filed as #13024 (task 21145). dezren39 commented on Nov 23, 2026
Restore-path measurement cross-reference — task 21145, 2026-11-23
The Google Drive copy of the 30,720,065-byte dashboard archive was measured outside the drill at a median about 99 KiB/s across three 1 MiB range reads (88.8, 99.3, and 133.5 KiB/s; offsets 0, 8 MiB, and 16 MiB). That projects to roughly 5 minutes for a full 30 MiB restore, materially above the prior ~8 KiB/s drill sample but still variable and much slower than the same archive from R2. The configured Drive remote is a normal scope=drive rclone remote with no custom pacing/chunk settings, and the exact path resolves, so the evidence points to Drive/default remote pacing variability rather than a bad backup path.
Planning conclusion: keep R2 as the preferred full-restore source; retain Drive as a hash-verified fallback/second copy, not the latency-critical restore leg. Full evidence is recorded on #13024: #13024 (comment)
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|