SQLite: database is locked
Another connection holds a lock that SQLite needs to complete your operation.
database is lockedDatabase is locked by another processWhat the error means
Section titled “What the error means”SQLite uses locks to coordinate connections to the same file. The connection holding the lock can belong to TableAI, another database client or an application using that database.
Common causes include:
- A write transaction that has not committed or rolled back.
- An active operation that keeps a transaction open.
- Several applications or containers writing to the same database file.
Resolve database is locked locally
Section titled “Resolve database is locked locally”- Allow an active database operation to finish.
- Check other open connections to the same file.
- Inspect unfinished transactions in the application that owns them.
- Commit or roll back a transaction you own after reviewing its work.
- Check the failed operation’s outcome before retrying it.
For a database shared with Docker, identify which applications or containers use the volume. Check their logs and transaction controls.
Review unfinished work before stopping its process. Use the application’s normal transaction controls to avoid interrupting a write.
Resolve a lock on an SSH host
Section titled “Resolve a lock on an SSH host”Check the applications using the database on the remote host. Closing a local application does not release a transaction owned by a remote service. Ask the service owner to finish or roll back its transaction.
On a company host, send the administrator the error text, failure time and operation that failed. Include the SSH host and user when applicable; omit passwords and database contents.
How TableAI shows the error
Section titled “How TableAI shows the error”For a local failure, TableAI can show Database is locked by another process.
A remote failure can show the database is locked message from sqlite3.
Read the operation’s error details before running the SQL again.
If the message concerns file access instead, use the file access guide.