Yes, the "Database is locked" error from SQLite can indeed be related to the 503 errors you're experiencing. This problem usually arises when multiple processes attempt to write to the SQLite database simultaneously, which can cause a lock since SQLite does not support high concurrency well.
Here are a few steps you can take to address this issue:
1.
Switch to PostgreSQL: For high orchestration volume and better concurrency support, it's recommended to use PostgreSQL instead of SQLite. SQLite is suitable for lightweight, single-server deployments but not for handling multiple concurrent write operations. You can find more information about setting up PostgreSQL in the
self-hosting documentation.
2.
Review Worker Configuration: Ensure that your workers are configured correctly and check the heartbeat settings. You can adjust the
PREFECT_WORKER_HEARTBEAT_SECONDS
setting if needed. More details on worker configuration can be found
here.
3.
Reduce Concurrency: If switching databases is not immediately feasible, you might try reducing the number of concurrent operations to see if it alleviates the locking issue.
By addressing these database constraints, you should see an improvement in your ability to manually trigger flows without encountering the 503 errors.