Hello guys, I've installed prefect using poetry an...
# prefect-getting-started
r
Hello guys, I've installed prefect using poetry and tried to run it without any implementation on my code, just to see the server running and the empty dashboard. However as soon as I ran
poetry run prefect server start
I ended up with this error:
Copy code
/Users/rbs/.pyenv/versions/3.11.7/lib/python3.11/contextlib.py:144: SAWarning: Skipped unsupported reflection of expression-based index ix_flow_run__coalesce_start_time_expected_start_time_desc
  next(self.gen)
/Users/rbs/.pyenv/versions/3.11.7/lib/python3.11/contextlib.py:144: SAWarning: Skipped unsupported reflection of expression-based index ix_flow_run__coalesce_start_time_expected_start_time_asc
  next(self.gen)
12:19:29.895 | ERROR   | prefect.server.services.flowrunnotifications - Unexpected error in: OperationalError('(sqlite3.OperationalError) database is locked')
Traceback (most recent call last):
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1910, in _execute_context
    self.dialect.do_execute(
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
    cursor.execute(statement, parameters)
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 108, in execute
    self._adapt_connection._handle_exception(error)
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 236, in _handle_exception
    raise error
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 90, in execute
    self.await_(_cursor.execute(operation, parameters))
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 68, in await_only
    return current.driver.switch(awaitable)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 121, in greenlet_spawn
    value = await result
            ^^^^^^^^^^^^
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/aiosqlite/cursor.py", line 48, in execute
    await self._execute(self._cursor.execute, sql, parameters)
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/aiosqlite/cursor.py", line 40, in _execute
    return await self._conn._execute(fn, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/aiosqlite/core.py", line 133, in _execute
    return await future
           ^^^^^^^^^^^^
  File "/Users/rbs/Library/Caches/pypoetry/virtualenvs/stry-etl-sLTcv7W0-py3.11/lib/python3.11/site-packages/aiosqlite/core.py", line 106, in run
    result = function()
             ^^^^^^^^^^
sqlite3.OperationalError: database is locked
I'm using Python 3.11 and Prefect 2.14.16
1
j
If you run it again, does it work? That should be a rare temporary state.
r
I ran it again and it worked for some time, then the lock error appeared again ... only when I configured with a postgres database the error is gone
And I had to configure it with an async driver ... is there any option to work with sync drivers?
because I don't intend to use db asynchronously
j
Ah yes. Switching to Postgres is a good move. Definitely what you want for production. Prefect is using the db asynchronously for better performance. I don’t think there’s a way to easily change that or that you’d necessarily want to.
👍 1