复现步骤:
- 新增角色:客户
- 给角色“客户”增加自定义权限:智慧大屏
- 新增一个用户,角色选择:客户
- 登录,出现异常。
INFO: 127.0.0.1:50757 - "GET /vadmin/auth/users?page=1&limit=10 HTTP/1.1" 200 OK
请求地址 http://127.0.0.1:9000/auth/getMenuList
捕捉到全局异常:all_exception_handler
(sqlalchemy.exc.MissingGreenlet) greenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place?
[SQL: SELECT vadmin_auth_dept.name AS vadmin_auth_dept_name, vadmin_auth_dept.dept_key AS vadmin_auth_dept_dept_key, vadmin_auth_dept.disabled AS vadmin_auth_dept_disabled, vadmin_auth_dept.order
AS vadmin_auth_dept_order, vadmin_auth_dept.desc
AS vadmin_auth_dept_desc, vadmin_auth_dept.owner AS vadmin_auth_dept_owner, vadmin_auth_dept.phone AS vadmin_auth_dept_phone, vadmin_auth_dept.email AS vadmin_auth_dept_email, vadmin_auth_dept.parent_id AS vadmin_auth_dept_parent_id, vadmin_auth_dept.id AS vadmin_auth_dept_id, vadmin_auth_dept.create_datetime AS vadmin_auth_dept_create_datetime, vadmin_auth_dept.update_datetime AS vadmin_auth_dept_update_datetime, vadmin_auth_dept.delete_datetime AS vadmin_auth_dept_delete_datetime, vadmin_auth_dept.is_delete AS vadmin_auth_dept_is_delete
FROM vadmin_auth_dept, vadmin_auth_role_depts
WHERE %s = vadmin_auth_role_depts.role_id AND vadmin_auth_dept.id = vadmin_auth_role_depts.dept_id]
[parameters: [{'%(2519007426688 param)s': 2}]]
(Background on this error at: https://sqlalche.me/e/20/xd2s)
INFO: 127.0.0.1:50780 - "GET /auth/getMenuList HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 1814, in _execute_context
context = constructor(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1399, in _init_compiled
self.cursor = self.create_cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1723, in create_cursor
return self.create_default_cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1729, in create_default_cursor
return self._dbapi_connection.cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\pool\base.py", line 1491, in cursor
return self.dbapi_connection.cursor(*args, **kwargs)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\dialects\mysql\asyncmy.py", line 216, in cursor
return AsyncAdapt_asyncmy_cursor(self)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\dialects\mysql\asyncmy.py", line 58, in init
self.cursor = self.await(cursor.aenter())
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\util_concurrency_py3k.py", line 121, in await_only
raise exc.MissingGreenlet(
sqlalchemy.exc.MissingGreenlet: greenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place? (Background on this error at: https://sqlalche.me/e/20/xd2s)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Python\VEN\ctms-api\lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 426, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "D:\Python\VEN\ctms-api\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\fastapi\applications.py", line 1054, in call
await super().call(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\applications.py", line 116, in call
await self.middleware_stack(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\errors.py", line 186, in call
raise exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\errors.py", line 164, in call
await self.app(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\cors.py", line 83, in call
await self.app(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 191, in call
response = await self.dispatch_func(request, call_next)
File "F:\Space\CTMS\ctms-api\core\middleware.py", line 146, in jwt_refresh_middleware
response = await call_next(request)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 165, in call_next
raise app_exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 151, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 191, in call
response = await self.dispatch_func(request, call_next)
File "F:\Space\CTMS\ctms-api\core\middleware.py", line 64, in operation_record_middleware
response = await call_next(request)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 165, in call_next
raise app_exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 151, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 191, in call
response = await self.dispatch_func(request, call_next)
File "F:\Space\CTMS\ctms-api\core\middleware.py", line 46, in request_log_middleware
response = await call_next(request)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 165, in call_next
raise app_exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 151, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette_exception_handler.py", line 55, in wrapped_app
raise exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette_exception_handler.py", line 44, in wrapped_app
await app(scope, receive, sender)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\routing.py", line 746, in call
await route.handle(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\routing.py", line 288, in handle
await self.app(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\routing.py", line 75, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette_exception_handler.py", line 55, in wrapped_app
raise exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette_exception_handler.py", line 44, in wrapped_app
await app(scope, receive, sender)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\routing.py", line 70, in app
response = await func(request)
File "D:\Python\VEN\ctms-api\lib\site-packages\fastapi\routing.py", line 285, in app
raise e
File "D:\Python\VEN\ctms-api\lib\site-packages\fastapi\routing.py", line 275, in app
solved_result = await solve_dependencies(
File "D:\Python\VEN\ctms-api\lib\site-packages\fastapi\dependencies\utils.py", line 598, in solve_dependencies
solved = await call(**sub_values)
File "F:\Space\CTMS\ctms-api\apps\vadmin\auth\utils\current.py", line 99, in call
result = await self.validate_user(request, user, db, is_all=False)
File "F:\Space\CTMS\ctms-api\apps\vadmin\auth\utils\validation\auth.py", line 108, in validate_user
data_range, dept_ids = await cls.get_user_data_range(user, db)
File "F:\Space\CTMS\ctms-api\apps\vadmin\auth\utils\validation\auth.py", line 154, in get_user_data_range
for dept in role_obj.depts:
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\attributes.py", line 566, in get
return self.impl.get(state, dict) # type: ignore[no-any-return]
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\attributes.py", line 1086, in get
value = self._fire_loader_callables(state, key, passive)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\attributes.py", line 1121, in fire_loader_callables
return self.callable(state, passive)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\strategies.py", line 967, in _load_for_state
return self._emit_lazyload(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\strategies.py", line 1130, in _emit_lazyload
result = session.execute(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\session.py", line 2308, in execute
return self._execute_internal(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\session.py", line 2190, in _execute_internal
result: Result[Any] = compile_state_cls.orm_execute_statement(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\context.py", line 293, in orm_execute_statement
result = conn.execute(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 1416, in execute
return meth(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\sql\elements.py", line 517, in _execute_on_connection
return connection._execute_clauseelement(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 1639, in _execute_clauseelement
ret = self._execute_context(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 1820, in _execute_context
self._handle_dbapi_exception(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 2344, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 1814, in _execute_context
context = constructor(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1399, in _init_compiled
self.cursor = self.create_cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1723, in create_cursor
return self.create_default_cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1729, in create_default_cursor
return self._dbapi_connection.cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\pool\base.py", line 1491, in cursor
return self.dbapi_connection.cursor(*args, **kwargs)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\dialects\mysql\asyncmy.py", line 216, in cursor
return AsyncAdapt_asyncmy_cursor(self)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\dialects\mysql\asyncmy.py", line 58, in init
self.cursor = self.await(cursor.aenter())
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\util_concurrency_py3k.py", line 121, in await_only
raise exc.MissingGreenlet(
sqlalchemy.exc.StatementError: (sqlalchemy.exc.MissingGreenlet) greenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place?
[SQL: SELECT vadmin_auth_dept.name AS vadmin_auth_dept_name, vadmin_auth_dept.dept_key AS vadmin_auth_dept_dept_key, vadmin_auth_dept.disabled AS vadmin_auth_dept_disabled, vadmin_auth_dept.order
AS vadmin_auth_dept_order, vadmin_auth_dept.desc
AS vadmin_auth_dept_desc, vadmin_auth_dept.owner AS vadmin_auth_dept_owner, vadmin_auth_dept.phone AS vadmin_auth_dept_phone, vadmin_auth_dept.email AS vadmin_auth_dept_email, vadmin_auth_dept.parent_id AS vadmin_auth_dept_parent_id, vadmin_auth_dept.id AS vadmin_auth_dept_id, vadmin_auth_dept.create_datetime AS vadmin_auth_dept_create_datetime, vadmin_auth_dept.update_datetime AS vadmin_auth_dept_update_datetime, vadmin_auth_dept.delete_datetime AS vadmin_auth_dept_delete_datetime, vadmin_auth_dept.is_delete AS vadmin_auth_dept_is_delete
FROM vadmin_auth_dept, vadmin_auth_role_depts
WHERE %s = vadmin_auth_role_depts.role_id AND vadmin_auth_dept.id = vadmin_auth_role_depts.dept_id]
[parameters: [{'%(2519007426688 param)s': 2}]]
(Background on this error at: https://sqlalche.me/e/20/xd2s)
请求地址 http://127.0.0.1:9000/auth/getMenuList
捕捉到全局异常:all_exception_handler
(sqlalchemy.exc.MissingGreenlet) greenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place?
[SQL: SELECT vadmin_auth_dept.name AS vadmin_auth_dept_name, vadmin_auth_dept.dept_key AS vadmin_auth_dept_dept_key, vadmin_auth_dept.disabled AS vadmin_auth_dept_disabled, vadmin_auth_dept.order
AS vadmin_auth_dept_order, vadmin_auth_dept.desc
AS vadmin_auth_dept_desc, vadmin_auth_dept.owner AS vadmin_auth_dept_owner, vadmin_auth_dept.phone AS vadmin_auth_dept_phone, vadmin_auth_dept.email AS vadmin_auth_dept_email, vadmin_auth_dept.parent_id AS vadmin_auth_dept_parent_id, vadmin_auth_dept.id AS vadmin_auth_dept_id, vadmin_auth_dept.create_datetime AS vadmin_auth_dept_create_datetime, vadmin_auth_dept.update_datetime AS vadmin_auth_dept_update_datetime, vadmin_auth_dept.delete_datetime AS vadmin_auth_dept_delete_datetime, vadmin_auth_dept.is_delete AS vadmin_auth_dept_is_delete
FROM vadmin_auth_dept, vadmin_auth_role_depts
WHERE %s = vadmin_auth_role_depts.role_id AND vadmin_auth_dept.id = vadmin_auth_role_depts.dept_id]
[parameters: [{'%(2519007426688 param)s': 2}]]
(Background on this error at: https://sqlalche.me/e/20/xd2s)
INFO: 127.0.0.1:50803 - "GET /auth/getMenuList HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 1814, in _execute_context
context = constructor(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1399, in _init_compiled
self.cursor = self.create_cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1723, in create_cursor
return self.create_default_cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1729, in create_default_cursor
return self._dbapi_connection.cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\pool\base.py", line 1491, in cursor
return self.dbapi_connection.cursor(*args, **kwargs)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\dialects\mysql\asyncmy.py", line 216, in cursor
return AsyncAdapt_asyncmy_cursor(self)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\dialects\mysql\asyncmy.py", line 58, in init
self.cursor = self.await(cursor.aenter())
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\util_concurrency_py3k.py", line 121, in await_only
raise exc.MissingGreenlet(
sqlalchemy.exc.MissingGreenlet: greenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place? (Background on this error at: https://sqlalche.me/e/20/xd2s)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Python\VEN\ctms-api\lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 426, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "D:\Python\VEN\ctms-api\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in call
return await self.app(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\fastapi\applications.py", line 1054, in call
await super().call(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\applications.py", line 116, in call
await self.middleware_stack(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\errors.py", line 186, in call
raise exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\errors.py", line 164, in call
await self.app(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\cors.py", line 83, in call
await self.app(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 191, in call
response = await self.dispatch_func(request, call_next)
File "F:\Space\CTMS\ctms-api\core\middleware.py", line 146, in jwt_refresh_middleware
response = await call_next(request)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 165, in call_next
raise app_exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 151, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 191, in call
response = await self.dispatch_func(request, call_next)
File "F:\Space\CTMS\ctms-api\core\middleware.py", line 64, in operation_record_middleware
response = await call_next(request)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 165, in call_next
raise app_exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 151, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 191, in call
response = await self.dispatch_func(request, call_next)
File "F:\Space\CTMS\ctms-api\core\middleware.py", line 46, in request_log_middleware
response = await call_next(request)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 165, in call_next
raise app_exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\base.py", line 151, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\middleware\exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette_exception_handler.py", line 55, in wrapped_app
raise exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette_exception_handler.py", line 44, in wrapped_app
await app(scope, receive, sender)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\routing.py", line 746, in call
await route.handle(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\routing.py", line 288, in handle
await self.app(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\routing.py", line 75, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette_exception_handler.py", line 55, in wrapped_app
raise exc
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette_exception_handler.py", line 44, in wrapped_app
await app(scope, receive, sender)
File "D:\Python\VEN\ctms-api\lib\site-packages\starlette\routing.py", line 70, in app
response = await func(request)
File "D:\Python\VEN\ctms-api\lib\site-packages\fastapi\routing.py", line 285, in app
raise e
File "D:\Python\VEN\ctms-api\lib\site-packages\fastapi\routing.py", line 275, in app
solved_result = await solve_dependencies(
File "D:\Python\VEN\ctms-api\lib\site-packages\fastapi\dependencies\utils.py", line 598, in solve_dependencies
solved = await call(**sub_values)
File "F:\Space\CTMS\ctms-api\apps\vadmin\auth\utils\current.py", line 99, in call
result = await self.validate_user(request, user, db, is_all=False)
File "F:\Space\CTMS\ctms-api\apps\vadmin\auth\utils\validation\auth.py", line 108, in validate_user
data_range, dept_ids = await cls.get_user_data_range(user, db)
File "F:\Space\CTMS\ctms-api\apps\vadmin\auth\utils\validation\auth.py", line 154, in get_user_data_range
for dept in role_obj.depts:
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\attributes.py", line 566, in get
return self.impl.get(state, dict) # type: ignore[no-any-return]
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\attributes.py", line 1086, in get
value = self._fire_loader_callables(state, key, passive)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\attributes.py", line 1121, in fire_loader_callables
return self.callable(state, passive)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\strategies.py", line 967, in _load_for_state
return self._emit_lazyload(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\strategies.py", line 1130, in _emit_lazyload
result = session.execute(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\session.py", line 2308, in execute
return self._execute_internal(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\session.py", line 2190, in _execute_internal
result: Result[Any] = compile_state_cls.orm_execute_statement(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\orm\context.py", line 293, in orm_execute_statement
result = conn.execute(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 1416, in execute
return meth(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\sql\elements.py", line 517, in _execute_on_connection
return connection._execute_clauseelement(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 1639, in _execute_clauseelement
ret = self._execute_context(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 1820, in _execute_context
self._handle_dbapi_exception(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 2344, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\base.py", line 1814, in _execute_context
context = constructor(
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1399, in _init_compiled
self.cursor = self.create_cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1723, in create_cursor
return self.create_default_cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\engine\default.py", line 1729, in create_default_cursor
return self._dbapi_connection.cursor()
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\pool\base.py", line 1491, in cursor
return self.dbapi_connection.cursor(*args, **kwargs)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\dialects\mysql\asyncmy.py", line 216, in cursor
return AsyncAdapt_asyncmy_cursor(self)
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\dialects\mysql\asyncmy.py", line 58, in init
self.cursor = self.await(cursor.aenter())
File "D:\Python\VEN\ctms-api\lib\site-packages\sqlalchemy\util_concurrency_py3k.py", line 121, in await_only
raise exc.MissingGreenlet(
sqlalchemy.exc.StatementError: (sqlalchemy.exc.MissingGreenlet) greenlet_spawn has not been called; can't call await_only() here. Was IO attempted in an unexpected place?
[SQL: SELECT vadmin_auth_dept.name AS vadmin_auth_dept_name, vadmin_auth_dept.dept_key AS vadmin_auth_dept_dept_key, vadmin_auth_dept.disabled AS vadmin_auth_dept_disabled, vadmin_auth_dept.order
AS vadmin_auth_dept_order, vadmin_auth_dept.desc
AS vadmin_auth_dept_desc, vadmin_auth_dept.owner AS vadmin_auth_dept_owner, vadmin_auth_dept.phone AS vadmin_auth_dept_phone, vadmin_auth_dept.email AS vadmin_auth_dept_email, vadmin_auth_dept.parent_id AS vadmin_auth_dept_parent_id, vadmin_auth_dept.id AS vadmin_auth_dept_id, vadmin_auth_dept.create_datetime AS vadmin_auth_dept_create_datetime, vadmin_auth_dept.update_datetime AS vadmin_auth_dept_update_datetime, vadmin_auth_dept.delete_datetime AS vadmin_auth_dept_delete_datetime, vadmin_auth_dept.is_delete AS vadmin_auth_dept_is_delete
FROM vadmin_auth_dept, vadmin_auth_role_depts
WHERE %s = vadmin_auth_role_depts.role_id AND vadmin_auth_dept.id = vadmin_auth_role_depts.dept_id]
[parameters: [{'%(2519007426688 param)s': 2}]]
(Background on this error at: https://sqlalche.me/e/20/xd2s)