Repository navigation
On Postgres the daemon anchors the audit chain but every reader reports the anchor unsupported and exits 2 #558
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingmediumDifficulty: needs familiarity with one subsystemDifficulty: needs familiarity with one subsystemtwir-listedListed in a This Week in Rust CfP. Do not offer to anyone until that issue publishes.Listed in a This Week in Rust CfP. Do not offer to anyone until that issue publishes.
Description
With a Postgres audit store and SYSKNIFE_CHECKPOINT_DB set, the daemon anchors the chain every 15 minutes, and every reader reports the anchor as unsupported and exits 2. Tail truncation on Postgres is never detected.
What happens
start_checkpoint_anchoringhandsstate.audit(anArc<dyn AuditStore>, which can be the Postgres store) tospawn_periodic_anchor, which readsfetch_chain_rows()through the trait. Postgres chains are anchored.verify_configured_anchor(apps/sysknife-cli/src/runner.rs:1483-1506) short-circuits every Postgres config withCannotVerify { reason: "checkpoint anchoring is implemented for the sqlite backend only ..." }. The daemon's own behaviour contradicts that reason.sysknife audit checkpointignores[storage]and opens a SQLite store only. Since fix(audit): resolve checkpoint and MCP stores consistently #636 it picks the file withsysknife_core::resolve_audit_store()(runner.rs:1371-1402), which chooses between SQLite paths and never reads the backend.
A correctly configured Postgres deployment therefore gets a permanent exit 2, which teaches the operator to ignore 2.
Docs, same area
SECURITY.md:563-584tells operators to setSYSKNIFE_CHECKPOINT_DBwithsystemctl edit sysknife-daemon.verify_configured_anchorreads it from the calling shell (runner.rs:1491), andsudo sysknife audit verify, the form the docs recommend for system stores, resets the environment. That run prints the "no anchor configured" caveat while the daemon is anchoring.docs/configuration.md:115describes the variable as used byaudit checkpointonly.docs/the-audit-chain.md:499says "Three checks run". The code runs a fourth check, the status cross-check, which can exit 1. (The "out of scope by design" line this item also quoted is gone: fix(audit): chain SQLite status transitions and expose verdicts #571 rewrote that part of the page to describestatus_check, at 309-335.)
Fix
- In
verify_configured_anchor, read rows through the Postgres store when the backend is Postgres and callverify_against_anchor. Makerun_audit_checkpointhonour[storage]too. - Fix the three docs points. For the environment one, either document
sudo -E/ setting it in the verifying shell, or read the anchor URL fromconfig.tomlso daemon and CLI share one source. I lean toconfig.toml.
Done when
A Postgres contract test (the suite already runs in CI) anchors, truncates the tail, and expects Truncated from audit verify.
Nearest existing: #221 (closed), an inconclusive anchor masking a broken chain.
Getting started
CONTRIBUTING.md has the build and test commands. No CLA and no copyright waiver. The project is MIT; sign off each commit with git commit -s (the required dco check enforces it since #732).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingmediumDifficulty: needs familiarity with one subsystemDifficulty: needs familiarity with one subsystemtwir-listedListed in a This Week in Rust CfP. Do not offer to anyone until that issue publishes.Listed in a This Week in Rust CfP. Do not offer to anyone until that issue publishes.
Activity
vladimirrott commentedon Oct 1, 2026
@Georgefifth You've worked inside the chain columns and the signed approval events, so the Postgres anchor read is close to code you know. I'm holding it for you if you want it.
vladimirrott commentedon Oct 13, 2026
@Georgefifth I held this for you on 1 October and I'm putting it back in the pool so someone else can pick it up. Say so here if you want it later and it's yours again.
vladimirrott commentedon Oct 21, 2026
Updated
SECURITY.md:469-490to:475-496in the body; #609 added six lines above the anchoring section and the block is otherwise identical. Also added a Getting started section. Ated7c59dathe defect stands:verify_configured_anchorstill returnsCannotVerifyfor a Postgres backend (apps/sysknife-cli/src/runner.rs:1474-1484).vladimirrott commentedon Oct 26, 2026
Line numbers moved after #626 merged today. I updated the anchors in the body; the code they point at is unchanged:
runner.rs:1462-1485→:1473-1496runner.rs:1355-1382→:1366-1393runner.rs:1470→:1481