Environment
- OS: WSL2 (Windows 11), Ubuntu
- hermes-agent: v0.14.0 (latest main branch)
- SQLite: 3.37.2
- Filesystem: ext4 on WSL2 virtual disk (VHDX)
Problem
kanban.db gets corrupted when multiple gateway processes run simultaneously.
Error messages:
sqlite3.DatabaseError: database disk image is malformed
sqlite3.OperationalError: disk I/O error
ERROR kanban dispatcher: board default database is not a valid SQLite database
Root Cause
- Multiple gateway processes (12+) open the same
~/.hermes/kanban.db file simultaneously
- Each process holds 2-6 file descriptors to the database file
- WAL mode's
-shm (shared memory) file has synchronization issues on WSL2's 9p filesystem
- Even with flock-based serialization in write_txn(), corruption still occurs
- Corruption happens at the filesystem level, not SQLite protocol level
Attempted Fixes
- Added flock (LOCK_EX/LOCK_UN) in write_txn() — works in isolated tests but corruption still in production
- Added PRAGMA busy_timeout=5000 — reduces but doesn't eliminate corruption
- Tried tmpfs for kanban.db — works but data lost on WSL shutdown
- Current workaround: watchdog script auto-rebuilds database on corruption
Reproduction
- Start 12+ gateway processes (multiple profiles)
- Dispatch 5+ concurrent kanban tasks
- Within minutes, database corruption occurs
Request
Is there a recommended configuration or fix for running multiple gateway processes with a shared kanban.db on WSL2?
Related: microsoft/WSL#2395 (sqlite write locks aren't respected in WSL)
Environment
Problem
kanban.db gets corrupted when multiple gateway processes run simultaneously.
Error messages:
sqlite3.DatabaseError: database disk image is malformedsqlite3.OperationalError: disk I/O errorERROR kanban dispatcher: board default database is not a valid SQLite databaseRoot Cause
~/.hermes/kanban.dbfile simultaneously-shm(shared memory) file has synchronization issues on WSL2's 9p filesystemAttempted Fixes
Reproduction
Request
Is there a recommended configuration or fix for running multiple gateway processes with a shared kanban.db on WSL2?
Related: microsoft/WSL#2395 (sqlite write locks aren't respected in WSL)