SQLite Forum

random DB locks
Login
Bingo.

Virtual servers have a poor reputation for supporting file locking.  Yours might be simulating full XFS support, but the XFS disk is not a real disk, it's part of the simulated hardware.  And the communication between the virtual computer and the virtual storage may not provide full support for locking.  Consequently you may be running into

<https://www.sqlite.org/howtocorrupt.html#_filesystems_with_broken_or_missing_lock_implementations>

In your case, you don't have two competing processes causing corruption.  But you're getting lock failure anyway.

I am guessing that identical software to yours won't have this problem if it is run on a real computer with a real XFS drive inside it.  But I have no way to prove it, and it's possible you have a different problem none of us have thought of.  Do you have any way to test this ?