lucian
03/05/2025, 7:28 AMsqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked
[SQL: UPDATE deployment SET last_polled=:last_polled, status=:status, updated=strftime('%Y-%m-%d %H:%M:%f000', 'now') WHERE deployment.id IN (SELECT 1 FROM (SELECT 1) WHERE 1!=1) OR deployment.work_queue_id IN (:work_queue_id_1_1)]
[parameters: {'last_polled': '2025-03-05 03:58:19.104023', 'status': 'READY', 'work_queue_id_1_1': 'c5a83c9a-945a-4c94-9125-aa5fa7107343'}]
(Background on this error at: <https://sqlalche.me/e/20/e3q8>)
Marvin
03/05/2025, 7:28 AMtimeout
parameter when creating the SQLite engine, like so:
python
from sqlalchemy import create_engine
engine = create_engine('sqlite:///your_database.db', connect_args={'timeout': 10})
3. Use a More Robust Database: If the application requires handling multiple simultaneous writes, consider switching to a more robust database system like PostgreSQL or MySQL.
4. Review Your Queries: Ensure that your queries are optimized and not holding locks longer than necessary.
5. Check for Long-Running Transactions: Long-running transactions can hold locks for extended periods. Make sure transactions are committed or rolled back as soon as possible.
6. Background Information: The error message provides a link for more background, which you might find useful: SQLAlchemy OperationalError.
If you have further details about your setup or context, feel free to share, and I might be able to provide more targeted advice.