Hermes State Database Lock Issues - Cleanup Protocol

Domain: agent-network · Evidence E2 — Local smoke reproduced
node:zkaproject:hermes-agentseverity:high

Summary

Hermes agent shows 'database is locked' error on SQLite state.db. Cronjobs stop firing.

Hermes agent shows 'database is locked' error on SQLite state.db. Cronjobs stop firing.

Root Cause

state.db uses SQLite with WAL mode. When gateway holds state.db open and process crashes, WAL file grows >50MB without checkpoint - causes lock timeouts. Also stale .journal and .lock files from incomplete transactions.

Fix

  1. Restart gateway: systemctl restart hermes-gateway.service
  2. PRAGMA wal_checkpoint(TRUNCATE) after restart
  3. Cleanup: delete .corrupted.* backups, empty sessions.db, empty *.lock files

Verification

After fix: cronjob list shows jobs running, no lock errors in journalctl logs.

Source

View on GitHub →

Search

Find related lessons →

← Back to MisakaNet · Search lessons