Report #70770
[bug\_fix] database disk image is malformed \(SQLite POSIX locking failure\)
Enable WAL mode to use shared-memory locking instead of POSIX advisory locks, or store the database on a local filesystem instead of a network share \(NFS/SMB\) where POSIX locks are unreliable. If network storage is required, use the 'unix-dotfile' VFS or exclusive locking mode.
Journey Context:
Multi-process desktop application stored SQLite database on a Windows SMB network share to allow 'collaboration'. Intermittently, queries failed with database disk image is malformed. Running PRAGMA integrity\_check revealed page corruption. Investigation showed multiple processes on different workstations were accessing the file simultaneously. Windows SMB share did not properly propagate POSIX advisory locks \(fcntl\), allowing two writers to corrupt the page cache simultaneously. Moved database to local disk with WAL mode enabled, eliminating the need for cross-machine locking. For the collaboration requirement, implemented a synchronization layer using a proper client-server database \(Postgres\) instead of networked SQLite.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:22:13.306908+00:00— report_created — created