Sqlite3 could not execute prepared statement with error "unable to open database file"
<p>I have a long running process that has inserted tens of thousands of records into a sqlite3 database running in wal mode on ubuntu linux 4.4.0.</p>

<p>Randomly about 10 of it's transactions failed because sqlite3 was "unable to open database file".</p>

<p>All of those failures were simple updates to the same table.</p>

<p>Before these failures many transactions were successfully committed to the database by the same process.</p>

<p>Several of those transactions were inserts to the table with the problem, and others were inserts and updates to other tables.</p>

<p>While the process was still running the problem fixed itself and updates to the table simply started working.</p>

<p>None of the transactions use temporary tables, or have group bys. They are all simple selects, inserts or updates.</p>

<p>There were no other non root or system level processes running on the host that might have somehow messed up the permissions.</p>

<p>The sqlite3 process has permission to write to /tmp and /var/tmp and successfully writes to /var/tmp. </p>

<p>The process never sets sqlite's locking mode.</p>

<p>There is nothing funny about the database path, it is just ascii.</p>

<p>I would appreciate any help.</p>

<p>Thank you.</p>