Jason
10/30/2024, 12:13 PM.venv/lib/python3.11/site-packages/alembic/script/base.py", line 286, in _catch_revision_errors
raise util.CommandError(resolution) from re
alembic.util.exc.CommandError: Can't locate revision identified by '4ad4658cbefe'
when running a cf.task, I sometimes see Controflow migrations attempting to be run, which is super super bizarre and very concerningJason
10/30/2024, 12:15 PMTraceback (most recent call last):
File ".venv/lib/python3.11/site-packages/starlette/routing.py", line 693, in lifespan
async with self.lifespan_context(app) as maybe_state:
File ".pyenv/versions/3.11.9/lib/python3.11/contextlib.py", line 210, in __aenter__
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/prefect/server/api/server.py", line 600, in lifespan
await run_migrations()
File ".venv/lib/python3.11/site-packages/prefect/server/api/server.py", line 509, in run_migrations
await db.create_db()
File ".venv/lib/python3.11/site-packages/prefect/server/database/interface.py", line 56, in create_db
await self.run_migrations_upgrade()
File ".venv/lib/python3.11/site-packages/prefect/server/database/interface.py", line 64, in run_migrations_upgrade
await run_sync_in_worker_thread(alembic_upgrade)
File ".venv/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 269, in run_sync_in_worker_thread
result = await anyio.to_thread.run_sync(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2441, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 943, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 279, in call_with_mark
return call()
^^^^^^
File ".venv/lib/python3.11/site-packages/prefect/server/database/alembic_commands.py", line 28, in wrapper
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/prefect/server/database/alembic_commands.py", line 64, in alembic_upgrade
alembic.command.upgrade(alembic_config(), revision, sql=dry_run)
File ".venv/lib/python3.11/site-packages/alembic/command.py", line 406, in upgrade
script.run_env()
File ".venv/lib/python3.11/site-packages/alembic/script/base.py", line 586, in run_env
util.load_python_file(self.dir, "env.py")
File ".venv/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
module = load_module_py(module_id, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
spec.loader.exec_module(module) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File ".venv/lib/python3.11/site-packages/prefect/server/database/migrations/env.py", line 179, in <module>
run_async_from_worker_thread(apply_migrations)
File ".venv/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 290, in run_async_from_worker_thread
return anyio.from_thread.run(call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/anyio/from_thread.py", line 59, in run
return async_backend.run_async_from_thread(func, args, token=token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2481, in run_async_from_thread
return f.result()
^^^^^^^^^^
File ".pyenv/versions/3.11.9/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File ".pyenv/versions/3.11.9/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File ".venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2468, in task_wrapper
return await func(*args)
^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/prefect/server/database/migrations/env.py", line 168, in apply_migrations
await connection.run_sync(do_run_migrations)
File ".venv/lib/python3.11/site-packages/sqlalchemy/ext/asyncio/engine.py", line 886, in run_sync
return await greenlet_spawn(
^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py", line 203, in greenlet_spawn
result = context.switch(value)
^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/prefect/server/database/migrations/env.py", line 137, in do_run_migrations
context.run_migrations()
File "<string>", line 8, in run_migrations
File ".venv/lib/python3.11/site-packages/alembic/runtime/environment.py", line 946, in run_migrations
self.get_context().run_migrations(**kw)
File ".venv/lib/python3.11/site-packages/alembic/runtime/migration.py", line 616, in run_migrations
for step in self._migrations_fn(heads, self):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/alembic/command.py", line 395, in upgrade
return script._upgrade_revs(revision, rev)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.11/site-packages/alembic/script/base.py", line 450, in _upgrade_revs
with self._catch_revision_errors(
File ".pyenv/versions/3.11.9/lib/python3.11/contextlib.py", line 158, in __exit__
self.gen.throw(typ, value, traceback)
File ".venv/lib/python3.11/site-packages/alembic/script/base.py", line 286, in _catch_revision_errors
raise util.CommandError(resolution) from re
alembic.util.exc.CommandError: Can't locate revision identified by '4ad4658cbefe'
Constantin Teo
10/30/2024, 12:22 PMJason
10/30/2024, 12:39 PMJason
10/30/2024, 12:40 PMConstantin Teo
10/30/2024, 12:40 PM➜ ~/.prefect ls -1
kube.conf
kube.conf.json
memo_store.toml
prefect.db
profiles.toml
profiles.toml.bak
server.pid
storage
Constantin Teo
10/30/2024, 12:41 PMConstantin Teo
10/30/2024, 12:43 PMpip
, did you perhaps install an editable local verison?Jason
10/30/2024, 1:01 PMConstantin Teo
10/30/2024, 1:02 PMJeremiah
Jeremiah
Jeremiah
Jason
10/30/2024, 2:09 PMJeremiah
Jason
10/30/2024, 2:10 PMJeremiah
Jeremiah
pip install controlflow -U
i wonder if it goes awayJeremiah
Jason
10/30/2024, 2:11 PMJason
10/30/2024, 2:11 PMJeremiah
Jeremiah
Jeremiah
Jason
10/30/2024, 2:12 PMJeremiah
Jeremiah
Constantin Teo
10/30/2024, 2:15 PM.db
is what had it solvedJeremiah
Constantin Teo
10/30/2024, 2:19 PMConstantin Teo
10/30/2024, 2:31 PMrye
for workspace management and had to completely repackage the fork I run, ditching setup.cfg
which is moving towards deprecation in favor of PEP 518. Been wondering the reason behind Prefect's adoption of legacy setuptools configuration - is it due to a particular requirement, or is migration already planned?Jeremiah
Constantin Teo
10/30/2024, 2:36 PM