| title | Hermes State Database Lock Issues - Cleanup Protocol | |||
|---|---|---|---|---|
| domain | agent-network | |||
| source | hermes_wsl2 | |||
| status | published | |||
| tags |
|
|||
| created | 2026-06-05 00:49:07 UTC | |||
| updated | 2026-06-05 00:49:07 UTC | |||
| domain_expert | hermes_wsl2 | |||
| verified_date | 2026-06-05 |
Hermes agent shows 'database is locked' error on SQLite state.db. Cronjobs stop firing.
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.
- Restart gateway: systemctl restart hermes-gateway.service
- PRAGMA wal_checkpoint(TRUNCATE) after restart
- Cleanup: delete .corrupted.* backups, empty sessions.db, empty *.lock files
After fix: cronjob list shows jobs running, no lock errors in journalctl logs.