Khuyen Tran
12/07/2022, 4:30 PMAdam Roderick
12/07/2022, 5:08 PMfor doc in query:
, but it appears to load the entire resultset into memory before enumerating the rows.
The better practice is to use
doc = query.fetchone()
while doc:
doc = query.fetchone()
However, this hangs immediately when run from within a task.
Has anyone else seen this behavior? Any idea why it might be behaving this way?David Anderson
12/07/2022, 5:09 PMTask 'AirbyteConnectionTask': Exception encountered during task execution!
Traceback (most recent call last):
File "/home/ec2-user/.local/lib/python3.7/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.7/site-packages/simplejson/__init__.py", line 488, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.7/site-packages/simplejson/decoder.py", line 374, in decode
obj, end = self.raw_decode(s)
File "/usr/lib64/python3.7/site-packages/simplejson/decoder.py", line 393, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/.local/lib/python3.7/site-packages/prefect/tasks/airbyte/airbyte.py", line 67, in _check_health_status
self.logger.debug("Health check response: %s", response.json())
File "/home/ec2-user/.local/lib/python3.7/site-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ec2-user/.local/lib/python3.7/site-packages/prefect/engine/task_runner.py", line 884, in get_task_run_state
logger=self.logger,
File "/home/ec2-user/.local/lib/python3.7/site-packages/prefect/utilities/executors.py", line 468, in run_task_with_timeout
return task.run(*args, **kwargs) # type: ignore
File "/home/ec2-user/.local/lib/python3.7/site-packages/prefect/utilities/tasks.py", line 456, in method
return run_method(self, *args, **kwargs)
File "/home/ec2-user/.local/lib/python3.7/site-packages/prefect/tasks/airbyte/airbyte.py", line 333, in run
session = airbyte._establish_session()
File "/home/ec2-user/.local/lib/python3.7/site-packages/prefect/tasks/airbyte/airbyte.py", line 60, in _establish_session
if self._check_health_status(session):
File "/home/ec2-user/.local/lib/python3.7/site-packages/prefect/tasks/airbyte/airbyte.py", line 76, in _check_health_status
raise AirbyteServerNotHealthyException(e)
prefect.tasks.airbyte.airbyte.AirbyteServerNotHealthyException: Expecting value: line 1 column 1 (char 0)
Jarvis Stubblefield
12/07/2022, 6:01 PMunhealthy
β¦ I went back and ensured that my starting of the agent in production was using the correct queue. It appears to be spelled correctly and everything. However, the unhealthy
bit has never gone away and it doesnβt have a last polled date
.Yoanis Gil
12/07/2022, 6:05 PMJared Robbins
12/07/2022, 6:14 PMSlackbot
12/07/2022, 6:26 PMSamuel Kohlleffel
12/07/2022, 6:29 PMTomas Moreno
12/07/2022, 6:34 PMBraun Reyes
12/07/2022, 7:04 PMBradley Hurley
12/07/2022, 7:16 PMStorageSchema
. Is there a recommended approach to ensuring my custom StorageSchema is globally accessible in the StorageSchema.type_schemas
? As a workaround we are calling StorageSchema.type_schemas["MyCustomStorageSchema"] = MyCustomStorageSchema
in our CLI wrapper before creating agents so that the custom schema is accessible, but when we create child flows via Dask workers the custom storage is not set and the flow fails.Scott Chamberlain
12/07/2022, 7:27 PMIlya Galperin
12/07/2022, 8:19 PMZachary Loertscher
12/07/2022, 9:17 PMsql_server
extra and pyodbc
package). We are running Prefect 1.2.0.
Deployment is successful, and the flow is successfully registered (the imports in my .py
script run successfully), but Prefect Cloud can't find the package:
Failed to load and execute flow run: ImportError('Using prefect.tasks.sql_server requires Prefect to be installed with the "sql_server" extra.')
Is there a way to re-sync prefect-cloud with my docker container? Just seems like Prefect cloud isn't finding the packages I have installed on my containerMichael Cody
12/07/2022, 10:02 PMprefect config set PREFECT_LOGGING_FORMATTERS_SIMPLE_DATEFMT="%Y-%m-%d %H:%M:%S"
which return "Unknown setting name 'PREFECT_LOGGING_FORMATTERS_SIMPLE_DATEFMT'"
.
If I try prefect config set PREFECT_LOGGING_HANDLERS_CONSOLE_FORMATTER=json
from this this message from a month ago, I get the same error. This should be simple but I think I'm missing something. Editing the logging config works, but I'd rather have it in the profile instead of copying the logging.yml file.
Thanks.
https://prefect-community.slack.com/archives/CL09KU1K7/p1666798948425739?thread_ts=1666794116.134359&cid=CL09KU1K7Paige Gulley
12/07/2022, 10:39 PMMike Grabbe
12/07/2022, 11:31 PM[
]
aren't being logged correctly. Has anyone else noticed this? Details in π§΅wonsun
12/08/2022, 4:51 AMMahesh
12/08/2022, 6:22 AMprefect get
command to get logs.OlivΓ©r Atanaszov
12/08/2022, 11:27 AMon_handle
argument of Flow
)?Sunjay
12/08/2022, 2:17 PMKelvin DeCosta
12/08/2022, 2:28 PMflake8
(or any other linter) plugin to check for prefect
specific code issues.
The main issue I find myself making is calling a task
from another one.
I don't think a static type checker can detect this type of issue.
There are probably more issues that are waiting to be discovered and I think it would benefit the community if there was a linting tool that accounted for prefect
Nathan R
12/08/2022, 2:37 PMBabak
12/08/2022, 5:20 PMAshley Felber
12/08/2022, 5:25 PMChris Gunderson
12/08/2022, 5:51 PMKyle McChesney
12/08/2022, 5:59 PMNone
.Slackbot
12/08/2022, 6:22 PMmerlin
12/08/2022, 6:22 PMSean Conroy
12/08/2022, 7:44 PMrun_migrations
error using Prefect 2.7.0...full traceback in the reply. Anyone familiar with this?Sean Conroy
12/08/2022, 7:44 PMrun_migrations
error using Prefect 2.7.0...full traceback in the reply. Anyone familiar with this?Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions)(**req.view_args)
File "/main.py", line 99, in default_route_main
location_state = location_flow(atcore_event, ou_event, 'location', version_dict, account_id, return_state=True)
File "/usr/local/lib/python3.8/dist-packages/prefect/flows.py", line 442, in __call__
return enter_flow_run_engine_from_flow_call(
File "/usr/local/lib/python3.8/dist-packages/prefect/engine.py", line 157, in enter_flow_run_engine_from_flow_call
return anyio.run(begin_run)
File "/usr/local/lib/python3.8/dist-packages/anyio/_core/_eventloop.py", line 70, in run
return asynclib.run(func, *args, **backend_options)
File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 292, in run
return native_run(wrapper(), debug=debug)
File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
return await func(*args)
File "/usr/local/lib/python3.8/dist-packages/prefect/client/utilities.py", line 45, in with_injected_client
async with client_context as new_client:
File "/usr/local/lib/python3.8/dist-packages/prefect/client/orion.py", line 1868, in __aenter__
self._ephemeral_lifespan = await self._exit_stack.enter_async_context(
File "/usr/lib/python3.8/contextlib.py", line 568, in enter_async_context
result = await _cm_type.__aenter__(cm)
File "/usr/lib/python3.8/contextlib.py", line 171, in __aenter__
return await self.gen.__anext__()
File "/usr/local/lib/python3.8/dist-packages/prefect/client/base.py", line 85, in app_lifespan_context
await context.__aenter__()
File "/usr/local/lib/python3.8/dist-packages/asgi_lifespan/_manager.py", line 92, in __aenter__
await self._exit_stack.aclose()
File "/usr/lib/python3.8/contextlib.py", line 621, in aclose
await self.__aexit__(None, None, None)
File "/usr/lib/python3.8/contextlib.py", line 679, in __aexit__
raise exc_details[1]
File "/usr/lib/python3.8/contextlib.py", line 662, in __aexit__
cb_suppress = await cb(*exc_details)
File "/usr/local/lib/python3.8/dist-packages/asgi_lifespan/_concurrency/asyncio.py", line 80, in __aexit__
await self.task
File "/usr/local/lib/python3.8/dist-packages/asgi_lifespan/_manager.py", line 90, in __aenter__
await self.startup()
File "/usr/local/lib/python3.8/dist-packages/asgi_lifespan/_manager.py", line 36, in startup
raise self._app_exception
File "/usr/local/lib/python3.8/dist-packages/asgi_lifespan/_concurrency/asyncio.py", line 63, in run_and_silence_cancelled
await self.coroutine()
File "/usr/local/lib/python3.8/dist-packages/asgi_lifespan/_manager.py", line 64, in run_app
await <http://self.app|self.app>(scope, self.receive, self.send)
File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 270, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 124, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 149, in __call__
await <http://self.app|self.app>(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/cors.py", line 76, in __call__
await <http://self.app|self.app>(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/exceptions.py", line 55, in __call__
await <http://self.app|self.app>(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
raise e
File "/usr/local/lib/python3.8/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await <http://self.app|self.app>(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 695, in __call__
await self.lifespan(scope, receive, send)
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 671, in lifespan
async with self.lifespan_context(app):
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 566, in __aenter__
await self._router.startup()
File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 648, in startup
await handler()
File "/usr/local/lib/python3.8/dist-packages/prefect/orion/api/server.py", line 345, in run_migrations
await db.create_db()
File "/usr/local/lib/python3.8/dist-packages/prefect/orion/database/interface.py", line 55, in create_db
await self.run_migrations_upgrade()
File "/usr/local/lib/python3.8/dist-packages/prefect/orion/database/interface.py", line 63, in run_migrations_upgrade
await run_sync_in_worker_thread(alembic_upgrade)
File "/usr/local/lib/python3.8/dist-packages/prefect/utilities/asyncutils.py", line 68, in run_sync_in_worker_thread
return await anyio.to_thread.run_sync(call, cancellable=True)
File "/usr/local/lib/python3.8/dist-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.8/dist-packages/prefect/orion/database/alembic_commands.py", line 29, in alembic_upgrade
alembic.command.upgrade(alembic_config(), revision, sql=dry_run)
File "/usr/local/lib/python3.8/dist-packages/alembic/command.py", line 322, in upgrade
script.run_env()
File "/usr/local/lib/python3.8/dist-packages/alembic/script/base.py", line 569, in run_env
util.load_python_file(self.dir, "env.py")
File "/usr/local/lib/python3.8/dist-packages/alembic/util/pyfiles.py", line 94, in load_python_file
module = load_module_py(module_id, path)
File "/usr/local/lib/python3.8/dist-packages/alembic/util/pyfiles.py", line 110, in load_module_py
spec.loader.exec_module(module) # type: ignore
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3.8/dist-packages/prefect/orion/database/migrations/env.py", line 147, in <module>
apply_migrations()
File "/usr/local/lib/python3.8/dist-packages/prefect/utilities/asyncutils.py", line 197, in coroutine_wrapper
return run_async_from_worker_thread(async_fn, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/prefect/utilities/asyncutils.py", line 148, in run_async_from_worker_thread
return anyio.from_thread.run(call)
File "/usr/local/lib/python3.8/dist-packages/anyio/from_thread.py", line 49, in run
return asynclib.run_async_from_thread(func, *args)
File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 970, in run_async_from_thread
return f.result()
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 444, in result
return self.__get_result()
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "/usr/local/lib/python3.8/dist-packages/prefect/orion/database/migrations/env.py", line 141, in apply_migrations
await connection.run_sync(do_run_migrations)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/ext/asyncio/engine.py", line 548, in run_sync
return await greenlet_spawn(fn, conn, *arg, **kw)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/util/_concurrency_py3k.py", line 128, in greenlet_spawn
result = context.switch(value)
File "/usr/local/lib/python3.8/dist-packages/prefect/orion/database/migrations/env.py", line 129, in do_run_migrations
context.run_migrations()
File "<string>", line 8, in run_migrations
File "/usr/local/lib/python3.8/dist-packages/alembic/runtime/environment.py", line 853, in run_migrations
Michael Adkins
12/08/2022, 7:49 PMSean Conroy
12/08/2022, 8:12 PMTraceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/default.py", line 736, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 108, in execute
self._adapt_connection._handle_exception(error)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 236, in _handle_exception
raise error
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 90, in execute
self.await_(_cursor.execute(operation, parameters))
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/util/_concurrency_py3k.py", line 68, in await_only
return current.driver.switch(awaitable)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/util/_concurrency_py3k.py", line 121, in greenlet_spawn
value = await result
File "/usr/local/lib/python3.8/dist-packages/aiosqlite/cursor.py", line 37, in execute
await self._execute(self._cursor.execute, sql, parameters)
File "/usr/local/lib/python3.8/dist-packages/aiosqlite/cursor.py", line 31, in _execute
return await self._conn._execute(fn, *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/aiosqlite/core.py", line 129, in _execute
return await future
File "/usr/local/lib/python3.8/dist-packages/aiosqlite/core.py", line 102, in run
result = function()
sqlite3.OperationalError: table block_type already exists
Michael Adkins
12/08/2022, 8:17 PMSean Conroy
12/08/2022, 8:19 PMgit+<https://github.com/PrefectHQ/prefect@main>
to install Prefect, and I built the docker image this morning, so it looks like it's still an issue....Michael Adkins
12/08/2022, 8:33 PMJohn-Craig Borman
12/09/2022, 6:31 PMblock_type
already exists------------------------------------------------------------------------------------------------------------- Captured stderr call -------------------------------------------------------------------------------------------------------------
ERROR: Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/default.py", line 736, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 108, in execute
self._adapt_connection._handle_exception(error)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 236, in _handle_exception
raise error
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 90, in execute
self.await_(_cursor.execute(operation, parameters))
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/util/_concurrency_py3k.py", line 68, in await_only
return current.driver.switch(awaitable)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/util/_concurrency_py3k.py", line 121, in greenlet_spawn
value = await result
File "/usr/local/lib/python3.10/dist-packages/aiosqlite/cursor.py", line 37, in execute
await self._execute(self._cursor.execute, sql, parameters)
File "/usr/local/lib/python3.10/dist-packages/aiosqlite/cursor.py", line 31, in _execute
return await self._conn._execute(fn, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/aiosqlite/core.py", line 129, in _execute
return await future
File "/usr/local/lib/python3.10/dist-packages/aiosqlite/core.py", line 102, in run
result = function()
sqlite3.OperationalError: table block_type already exists
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 671, in lifespan
async with self.lifespan_context(app):
File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 566, in __aenter__
await self._router.startup()
File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 648, in startup
await handler()
File "/usr/local/lib/python3.10/dist-packages/prefect/orion/api/server.py", line 345, in run_migrations
await db.create_db()
File "/usr/local/lib/python3.10/dist-packages/prefect/orion/database/interface.py", line 55, in create_db
await self.run_migrations_upgrade()
File "/usr/local/lib/python3.10/dist-packages/prefect/orion/database/interface.py", line 63, in run_migrations_upgrade
await run_sync_in_worker_thread(alembic_upgrade)
File "/usr/local/lib/python3.10/dist-packages/prefect/utilities/asyncutils.py", line 69, in run_sync_in_worker_thread
return await anyio.to_thread.run_sync(call, cancellable=True)
File "/usr/local/lib/python3.10/dist-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.10/dist-packages/prefect/orion/database/alembic_commands.py", line 24, in wrapper
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/prefect/orion/database/alembic_commands.py", line 53, in alembic_upgrade
alembic.command.upgrade(alembic_config(), revision, sql=dry_run)
File "/usr/local/lib/python3.10/dist-packages/alembic/command.py", line 322, in upgrade
script.run_env()
File "/usr/local/lib/python3.10/dist-packages/alembic/script/base.py", line 569, in run_env
util.load_python_file(self.dir, "env.py")
File "/usr/local/lib/python3.10/dist-packages/alembic/util/pyfiles.py", line 94, in load_python_file
module = load_module_py(module_id, path)
File "/usr/local/lib/python3.10/dist-packages/alembic/util/pyfiles.py", line 110, in load_module_py
spec.loader.exec_module(module) # type: ignore
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/local/lib/python3.10/dist-packages/prefect/orion/database/migrations/env.py", line 147, in <module>
apply_migrations()
File "/usr/local/lib/python3.10/dist-packages/prefect/utilities/asyncutils.py", line 201, in coroutine_wrapper
return run_async_from_worker_thread(async_fn, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/prefect/utilities/asyncutils.py", line 152, in run_async_from_worker_thread
return anyio.from_thread.run(call)
File "/usr/local/lib/python3.10/dist-packages/anyio/from_thread.py", line 49, in run
return asynclib.run_async_from_thread(func, *args)
File "/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 970, in run_async_from_thread
return f.result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 458, in result
return self.__get_result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/usr/local/lib/python3.10/dist-packages/prefect/orion/database/migrations/env.py", line 141, in apply_migrations
await connection.run_sync(do_run_migrations)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/ext/asyncio/engine.py", line 548, in run_sync
return await greenlet_spawn(fn, conn, *arg, **kw)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/util/_concurrency_py3k.py", line 128, in greenlet_spawn
result = context.switch(value)
File "/usr/local/lib/python3.10/dist-packages/prefect/orion/database/migrations/env.py", line 129, in do_run_migrations
context.run_migrations()
File "<string>", line 8, in run_migrations
File "/usr/local/lib/python3.10/dist-packages/alembic/runtime/environment.py", line 853, in run_migrations
self.get_context().run_migrations(**kw)
File "/usr/local/lib/python3.10/dist-packages/alembic/runtime/migration.py", line 623, in run_migrations
step.migration_fn(**kw)
File "/usr/local/lib/python3.10/dist-packages/prefect/orion/database/migrations/versions/sqlite/2022_04_25_135207_b75d279ba985_replace_version_with_checksum.py", line 24, in upgrade
op.create_table(
File "<string>", line 8, in create_table
File "<string>", line 3, in create_table
File "/usr/local/lib/python3.10/dist-packages/alembic/operations/ops.py", line 1254, in create_table
return operations.invoke(op)
File "/usr/local/lib/python3.10/dist-packages/alembic/operations/base.py", line 399, in invoke
return fn(self, operation)
File "/usr/local/lib/python3.10/dist-packages/alembic/operations/toimpl.py", line 114, in create_table
operations.impl.create_table(table)
File "/usr/local/lib/python3.10/dist-packages/alembic/ddl/impl.py", line 354, in create_table
self._exec(schema.CreateTable(table))
File "/usr/local/lib/python3.10/dist-packages/alembic/ddl/impl.py", line 195, in _exec
return conn.execute(construct, multiparams)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/future/engine.py", line 280, in execute
return self._execute_20(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20
return meth(self, args_10style, kwargs_10style, execution_options)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/ddl.py", line 80, in _execute_on_connection
return connection._execute_ddl(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1472, in _execute_ddl
ret = self._execute_context(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapi_exception
util.raise_(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/util/compat.py", line 210, in raise_
raise exception
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/engine/default.py", line 736, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 108, in execute
self._adapt_connection._handle_exception(error)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 236, in _handle_exception
raise error
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 90, in execute
self.await_(_cursor.execute(operation, parameters))
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/util/_concurrency_py3k.py", line 68, in await_only
return current.driver.switch(awaitable)
File "/usr/local/lib/python3.10/dist-packages/sqlalchemy/util/_concurrency_py3k.py", line 121, in greenlet_spawn
value = await result
File "/usr/local/lib/python3.10/dist-packages/aiosqlite/cursor.py", line 37, in execute
await self._execute(self._cursor.execute, sql, parameters)
File "/usr/local/lib/python3.10/dist-packages/aiosqlite/cursor.py", line 31, in _execute
return await self._conn._execute(fn, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/aiosqlite/core.py", line 129, in _execute
return await future
File "/usr/local/lib/python3.10/dist-packages/aiosqlite/core.py", line 102, in run
result = function()
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table block_type already exists
[SQL:
CREATE TABLE block_type (
id CHAR(36) DEFAULT (
(
lower(hex(randomblob(4)))
|| '-'
|| lower(hex(randomblob(2)))
|| '-4'
|| substr(lower(hex(randomblob(2))),2)
|| '-'
|| substr('89ab',abs(random()) % 4 + 1, 1)
|| substr(lower(hex(randomblob(2))),2)
|| '-'
|| lower(hex(randomblob(6)))
)
) NOT NULL,
created DATETIME DEFAULT (strftime('%Y-%m-%d %H:%M:%f000', 'now')) NOT NULL,
updated DATETIME DEFAULT (strftime('%Y-%m-%d %H:%M:%f000', 'now')) NOT NULL,
name VARCHAR NOT NULL,
logo_url VARCHAR,
documentation_url VARCHAR,
CONSTRAINT pk_block_type PRIMARY KEY (id)
)
]
(Background on this error at: <https://sqlalche.me/e/14/e3q8>)
ERROR: Application startup failed. Exiting.
Michael Adkins
12/09/2022, 6:43 PM