hermes - 💡(How to fix) Fix [Bug]: Hermes backup stages SQLite DB snapshots in /tmp, causing incomplete backups when state.db is large [2 pull requests]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

Code Example

text
    Attempted hermes backup service:
    state.db: absent
    kanban.db: absent
    response_store.db: absent
    skills/autonomous-ai-agents/hermes-agent/SKILL.md: absent

---
RAW_BUFFERClick to expand / collapse

Bug Description

The native hermes backup routine can silently produce an incomplete backup when the Hermes state database is large.

The backup output path can be on a large persistent filesystem, but Hermes currently stages SQLite database snapshots through Python’s default tempfile location. On my system that resolves to /tmp, which is a small tmpfs. When state.db is larger than available /tmp space, SQLite safe-copy fails, the raw-copy fallback also fails, and the final backup zip is still produced without critical root database files.

The backup command finishes and prints Backup complete, but the archive is missing:

- state.db
- kanban.db
- response_store.db

It also only reports these omissions as warnings, which makes the resulting zip look more trustworthy than it is.

There is a related exclusion bug: the backup excludes every directory component named hermes-agent. That correctly excludes the root code checkout, but also accidentally excludes the Hermes Agent skill directory:

- skills/autonomous-ai-agents/hermes-agen

Steps to Reproduce

So the backup is currently missing both critical database continuity and at least one expected skill tree.

Steps to Reproduce:
1. Use a Hermes install with a large ~/.hermes/state.db.
2. Ensure /tmp is a small tmpfs or otherwise smaller than the largest DB snapshot.
3. Run native backup to a large persistent output path:

bash
hermes backup -o /home/owner/hermes-workspace/data/hermes-native-backup-rerun/hermes-backup-full.zip


4. Observe that the command completes and creates a zip.
5. Inspect the backup output and zip contents:

bash
unzip -Z1 /home/owner/hermes-workspace/data/hermes-native-backup-rerun/hermes-backup-full.zip | grep -E '^(state|kanban|response_store)\.db$'
unzip -Z1 /home/owner/hermes-workspace/data/hermes-native-backup-rerun/hermes-backup-full.zip | grep '^skills/autonomous-ai-agents/hermes-agent/'


6. The critical DB files and the skills/autonomous-ai-agents/hermes-agent/ skill tree are absent.

Expected Behavior

hermes backup should create a faithful restorable backup of Hermes state when the requested output path has enough persistent disk space.

Specifically:

- Large SQLite database snapshots should not be staged in /tmp by default.
- DB snapshot staging should happen on persistent disk, ideally near the requested backup output path or under a dedicated Hermes temp directory such as ~/.hermes/tmp/backup-staging/.
- If critical root DB files cannot be copied, the backup should fail loudly or be clearly marked incomplete/reduced-state.
- A command that prints Backup complete should not omit state.db, kanban.db, or response_store.db unless the user explicitly requested a reduced backup.
- The root code checkout ~/.hermes/hermes-agent/ may be excluded, but unrelated skill directories named hermes-agent should still be included.

Actual Behavior

The backup command completes and produces a zip, but omits critical DBs and the Hermes Agent skill tree.

Example output:

text
Backup complete: /home/owner/hermes-workspace/data/hermes-native-backup-rerun-20260530T132323Z/hermes-backup-full.zip
  Files:       15764
  Original:    1.6 GB
  Compressed:  504.1 MB
  Time:        132.2s

  Excluded directories:
    hermes-agent/
    skills/autonomous-ai-agents/hermes-agent/
    profiles/abaddon/skills/autonomous-ai-agents/hermes-agent/
    profiles/asmodeus/skills/autonomous-ai-agents/hermes-agent/
    profiles/base-pneuma/skills/autonomous-ai-agents/hermes-agent/
    profiles/ornias/skills/autonomous-ai-agents/hermes-agent/
    profiles/triage/skills/autonomous-ai-agents/hermes-agent/

  Warnings (11 files skipped):
  state.db: SQLite safe copy failed
  kanban.db: SQLite safe copy failed
  response_store.db: SQLite safe copy failed
  state-snapshots/20260527-113606-pre-update/state.db: SQLite safe copy failed
  state-snapshots/20260511-204151-pre-update/state.db: SQLite safe copy failed
  state-snapshots/20260509-141611-pre-update/state.db: SQLite safe copy failed
  state-snapshots/20260521-112857-pre-update/state.db: SQLite safe copy failed
  state-snapshots/20260515-183802-pre-update/state.db: SQLite safe copy failed
  state-snapshots/20260527-014909-pre-update/state.db: SQLite safe copy failed
  state-snapshots/20260520-030453-pre-update/state.db: SQLite safe copy failed
  ... and 1 more

Restore with: hermes import hermes-backup-full.zip

Affected Component

Setup / Installation

Messaging Platform (if gateway-related)

No response

Debug Report

text
    Attempted hermes backup service:
    state.db: absent
    kanban.db: absent
    response_store.db: absent
    skills/autonomous-ai-agents/hermes-agent/SKILL.md: absent

Operating System

Debian 13

Python Version

3.11.2

Hermes Version

0.14.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: Hermes backup stages SQLite DB snapshots in /tmp, causing incomplete backups when state.db is large [2 pull requests]