Nicholas Andonakis
02/26/2024, 12:49 AMJeff Hale
02/26/2024, 1:37 AMJeff Hale
02/26/2024, 1:40 AMNicholas Andonakis
02/26/2024, 3:27 AMJeff Hale
02/26/2024, 1:45 PM…When using SQLite the database is locked on occasion to ensure correct concurrent access. This log is sever and part of a loop service, it is not dangerous as the loop service will try again but we should probably more explicitly look for this error and suppress the exception so it doesn’t look as alarmingUsing Postgres instead of SQLite should avoid the issue.
Ryan Peden
02/27/2024, 12:24 AMPREFECT_API_URL
, either via running prefect config set PREFECT_API_URL=<http://127.0.0.1:4200/api>
or setting it as an environment variable?
If not, the flow will run standalone and access the database itself instead of going thorough the API server you started. You can verify this by shutting down your Prefect and and then running your flow serve script. It will still work and you can still run deployments via the Prefect CLI.
But in your case you might have two processes using the Prefect database at the same time. This will work most of the time because IIRC, SQLite doesn't care if multiple processes are using the database file except if they're both trying to write to it.
Once in a blue moon you'll get unlucky and have a conflict, and the flow run notification service is one of the most likely victims since it runs 15 times a minute.
I'd try setting the API URL if you haven't yet. Also, if it works for your use case, consider adding the schedule to your flow.serve call. If you try to serve a flow with an interval or schedule and there's no API URL set, Prefect will give you a friendly warning that you need to set a server URL to serve a scheduled flow.Charles Leung
04/30/2024, 4:54 PM