state.db page-0 corruption during graceful shutdown

NousResearch/hermes-agent · cluster 102198

Data as of

Nothing open on GitHub. Fix merged in #106587. Check it covers your case.

The short answer

0open issues
0open PRs
5items grouped
Known?
Yes. 5 related items grouped here, 1 issue already closed.
Fix event
A fix was merged to main in PR #106587. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this unresolved. That is separate from the fix event.
Still open
Nothing open on GitHub.

A bug where cron or deferred workers write to state.db after SIGTERM can corrupt its first page, causing 'file is not a database' on next start. Related work addresses quiescing background workers before DB close and quarantining already-corrupted databases instead of opening them destructively.

Open issues0

No open issues.

Open PRs0

No open pull requests.

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #106587 A state.db with a clobbered first page is quarantined with its WAL instead of opened destructively (refs #102198, salvage #102212)

    merged to main

    files: hermes_state.py, hermes_state_dbfile.py, tests/test_zeroed_state_db.py

  • #116296 Gateway shutdown no longer closes state.db under a live cron or API-server writer (#102198, salvage #102219)

    merged to main

    files: gateway/run_shutdown.py, tests/gateway/test_shutdown_executor_quiesce.py

2 PRs closed without merging

From the close comments: merged via another change 1 · superseded by another PR 1

  • #102212 fix(state): quarantine invalid state db header · superseded by another PR → d15c61b, #106587, #102198
  • #102219 run: quiesce cron/deferred workers before DB close to prevent page-0 corruption · merged via another change → #116296, #102198
Closed issues · 1
  • Closed#102198[Bug] state.db page 0 clobbered by a write ~0.9s after SIGTERM during graceful shutdown → "file is not a database" on next start
How this cluster was grouped
  • Link evidence (structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
  • Pairwise link density 0.40: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. 1.00 means every pair is linked.

Pick up a Lab task

Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.

Open the Lab

At a glance

Merged PRs
#106587, #116296
Closed issues
1
Attempts
2 PRs closed without merging
Fix link checked
19 Sep 2026

For your agent

The same facts, typed.