diff --git a/.idea/Mutual_Fund.iml b/.idea/Mutual_Fund.iml index 3fbabf5..7b59439 100644 --- a/.idea/Mutual_Fund.iml +++ b/.idea/Mutual_Fund.iml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 7440d61..34dc9d9 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/api/router.py b/api/router.py index 9161688..d65a21b 100644 --- a/api/router.py +++ b/api/router.py @@ -3,6 +3,7 @@ """ from fastapi import APIRouter +from api.routers import auth, product, questionnaire from api.routers import account, auth, holdings, purchase, redeem api_router = APIRouter() @@ -11,3 +12,5 @@ api_router.include_router(account.router, prefix="/api", tags=["资金账户"]) api_router.include_router(holdings.router, prefix="/api", tags=["持仓"]) api_router.include_router(purchase.router, prefix="/api", tags=["交易"]) api_router.include_router(redeem.router, prefix="/api", tags=["交易"]) +api_router.include_router(product.router, prefix="/api", tags=["产品"]) +api_router.include_router(questionnaire.router, prefix="/api", tags=["问卷"]) diff --git a/api/routers/auth.py b/api/routers/auth.py index df51975..0bb0891 100644 --- a/api/routers/auth.py +++ b/api/routers/auth.py @@ -1,12 +1,13 @@ -"""认证路由:登录 + 当前用户(业务在 service/auth.py,路由只做编排)。""" +"""认证路由:登录 + 注册 + 当前用户(业务在 service/auth.py,路由只做编排)。""" from fastapi import APIRouter, Depends from sqlalchemy.ext.asyncio import AsyncSession from api.deps import get_current_user from config.deps import get_db from model.sys_user import SysUser -from schemas.auth import LoginReq +from schemas.auth import LoginReq, RegisterReq from service.auth import login as auth_login +from service.auth import register as auth_register from service.auth import user_payload from utils.response import success @@ -18,7 +19,14 @@ async def login(body: LoginReq, db: AsyncSession = Depends(get_db)): return success(await auth_login(db, body.username, body.password)) +@router.post("/auth/register") +async def register(body: RegisterReq, db: AsyncSession = Depends(get_db)): + return success( + await auth_register(db, body.username, body.password, body.phone, body.real_name) + ) + + @router.get("/auth/me") async def me(user: SysUser = Depends(get_current_user)): """受保护示例路由:任意接口加 Depends(get_current_user) 即获得当前用户。""" - return success({"user": user_payload(user)}) \ No newline at end of file + return success({"user": user_payload(user)}) diff --git a/logs/error.log b/logs/error.log index a7f2a72..428d8f4 100644 --- a/logs/error.log +++ b/logs/error.log @@ -403,1154 +403,854 @@ Traceback (most recent call last): self._write_fut = self._loop._proactor.send(self._sock, data) ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'send' -2026-09-10 19:55:57,028 ERROR [-] api: unhandled error on /api/auth/login +2026-09-10 20:49:20,257 ERROR [-] api: unhandled error on /api/auth/login Traceback (most recent call last): - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ await self.app(scope, receive, _send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\utils\request_id.py", line 28, in dispatch + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\utils\request_id.py", line 28, in dispatch response: Response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next raise app_exc from app_exc.__cause__ or app_exc.__context__ - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 144, in coro + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro await self.app(scope, receive_or_disconnect, send_no_error) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\routing.py", line 670, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ await self.middleware_stack(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2734, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2734, in app await route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1780, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle await self.original_router.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2789, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle await included_router._handle_selected(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected await route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1780, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle await self.original_router.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2789, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle await included_router._handle_selected(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected await original_route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1279, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle await app(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 158, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 158, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 144, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 144, in app response = await f(request) ^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 706, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 706, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\api\routers\auth.py", line 18, in login + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\api\routers\auth.py", line 19, in login return success(await auth_login(db, body.username, body.password)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\service\auth.py", line 68, in login + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\service\auth.py", line 68, in login user = await SysUserRepo(db).get_by_username(username) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\repositories\sys_user.py", line 14, in get_by_username + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\repositories\sys_user.py", line 14, in get_by_username return await self.db.scalar(select(SysUser).where(SysUser.username == username)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar return await greenlet_spawn( ^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn result = context.throw(*sys.exc_info()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar return self._execute_internal( ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal conn = self._connection_for_bind(bind) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind return trans._connection_for_bind(engine, execution_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 2, in _connection_for_bind - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go ret_value = fn(self, *arg, **kw) ^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind conn = bind.connect() ^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect return self._connection_cls(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ self._dbapi_connection = engine.raw_connection() ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection return self.pool.connect() ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect return _ConnectionFairy._checkout(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout fairy = _ConnectionRecord.checkout(pool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout rec = pool._do_get() ^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get with util.safe_reraise(): ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ raise exc_value.with_traceback(exc_tb) - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get return self._create_connection() ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection return _ConnectionRecord(self) ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ self.__connect() - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect with util.safe_reraise(): ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ raise exc_value.with_traceback(exc_tb) - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect self.dbapi_connection = connection = pool._invoke_creator(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect return dialect.connect(*cargs_tup, **cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect await_only(creator_fn(*arg, **kw)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn value = await result ^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect await conn._connect() - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect await self._request_authentication() - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication await self.caching_sha2_password_auth(auth_packet) - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 984, in caching_sha2_password_auth + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 984, in caching_sha2_password_auth data = _auth.sha2_rsa_encrypt( ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\pymysql\_auth.py", line 144, in sha2_rsa_encrypt + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\_auth.py", line 144, in sha2_rsa_encrypt raise RuntimeError( RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods -2026-09-10 19:56:15,991 ERROR [-] api: unhandled error on /api/auth/login +2026-09-10 20:50:16,723 ERROR [-] api: unhandled error on /api/auth/login Traceback (most recent call last): - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + self._dbapi_connection = engine.raw_connection() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + return self.pool.connect() + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + return _ConnectionFairy._checkout(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + fairy = _ConnectionRecord.checkout(pool) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + rec = pool._do_get() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + return self._create_connection() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + return _ConnectionRecord(self) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + self.__connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + self.dbapi_connection = connection = pool._invoke_creator(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + return dialect.connect(*cargs_tup, **cparams) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + await_only(creator_fn(*arg, **kw)), + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + value = await result + ^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + await conn._connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + await self._request_authentication() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + await self.caching_sha2_password_auth(auth_packet) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 989, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +pymysql.err.OperationalError: (1049, "Unknown database 'memory'") + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ await self.app(scope, receive, _send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\utils\request_id.py", line 28, in dispatch + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\utils\request_id.py", line 28, in dispatch response: Response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next raise app_exc from app_exc.__cause__ or app_exc.__context__ - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 144, in coro + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro await self.app(scope, receive_or_disconnect, send_no_error) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\routing.py", line 670, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ await self.middleware_stack(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2734, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2734, in app await route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1780, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle await self.original_router.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2789, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle await included_router._handle_selected(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected await route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1780, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle await self.original_router.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2789, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle await included_router._handle_selected(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected await original_route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1279, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle await app(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 158, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 158, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 144, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 144, in app response = await f(request) ^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 706, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 706, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\api\routers\auth.py", line 18, in login + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\api\routers\auth.py", line 19, in login return success(await auth_login(db, body.username, body.password)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\service\auth.py", line 68, in login + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\service\auth.py", line 68, in login user = await SysUserRepo(db).get_by_username(username) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\repositories\sys_user.py", line 14, in get_by_username + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\repositories\sys_user.py", line 14, in get_by_username return await self.db.scalar(select(SysUser).where(SysUser.username == username)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar return await greenlet_spawn( ^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn result = context.throw(*sys.exc_info()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar return self._execute_internal( ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal conn = self._connection_for_bind(bind) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind return trans._connection_for_bind(engine, execution_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 2, in _connection_for_bind - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go ret_value = fn(self, *arg, **kw) ^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind conn = bind.connect() ^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect return self._connection_cls(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 146, in __init__ + Connection._handle_dbapi_exception_noconnection( + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 2450, in _handle_dbapi_exception_noconnection + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ self._dbapi_connection = engine.raw_connection() ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection return self.pool.connect() ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect return _ConnectionFairy._checkout(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout fairy = _ConnectionRecord.checkout(pool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout rec = pool._do_get() ^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get with util.safe_reraise(): ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ raise exc_value.with_traceback(exc_tb) - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get return self._create_connection() ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection return _ConnectionRecord(self) ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ self.__connect() - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect with util.safe_reraise(): ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ raise exc_value.with_traceback(exc_tb) - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect self.dbapi_connection = connection = pool._invoke_creator(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect return dialect.connect(*cargs_tup, **cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect await_only(creator_fn(*arg, **kw)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn value = await result ^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect await conn._connect() - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect await self._request_authentication() - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication await self.caching_sha2_password_auth(auth_packet) - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 984, in caching_sha2_password_auth - data = _auth.sha2_rsa_encrypt( - ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\pymysql\_auth.py", line 144, in sha2_rsa_encrypt - raise RuntimeError( -RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods -2026-09-10 20:06:46,339 ERROR [-] api: unhandled error on /api/auth/login + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 989, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1049, "Unknown database 'memory'") +(Background on this error at: https://sqlalche.me/e/20/e3q8) +2026-09-10 20:51:21,189 ERROR [-] api: unhandled error on /api/auth/login Traceback (most recent call last): - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + self._dbapi_connection = engine.raw_connection() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + return self.pool.connect() + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + return _ConnectionFairy._checkout(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + fairy = _ConnectionRecord.checkout(pool) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + rec = pool._do_get() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + return self._create_connection() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + return _ConnectionRecord(self) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + self.__connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + self.dbapi_connection = connection = pool._invoke_creator(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + return dialect.connect(*cargs_tup, **cparams) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + await_only(creator_fn(*arg, **kw)), + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + value = await result + ^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + await conn._connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + await self._request_authentication() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + await self.caching_sha2_password_auth(auth_packet) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 952, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +pymysql.err.OperationalError: (1049, "Unknown database 'memory'") + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ await self.app(scope, receive, _send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\utils\request_id.py", line 28, in dispatch + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\utils\request_id.py", line 28, in dispatch response: Response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next raise app_exc from app_exc.__cause__ or app_exc.__context__ - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 144, in coro + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro await self.app(scope, receive_or_disconnect, send_no_error) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\routing.py", line 660, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ await self.middleware_stack(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2531, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2734, in app await route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1700, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle await self.original_router.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2586, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle await included_router._handle_selected(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1711, in _handle_selected + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected await route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1700, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle await self.original_router.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2586, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle await included_router._handle_selected(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1720, in _handle_selected + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected await original_route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1239, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle await app(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 150, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 158, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 136, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 144, in app response = await f(request) ^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 690, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 706, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 344, in run_endpoint_function + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\api\routers\auth.py", line 18, in login + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\api\routers\auth.py", line 19, in login return success(await auth_login(db, body.username, body.password)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\service\auth.py", line 68, in login + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\service\auth.py", line 68, in login user = await SysUserRepo(db).get_by_username(username) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\repositories\sys_user.py", line 14, in get_by_username + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\repositories\sys_user.py", line 14, in get_by_username return await self.db.scalar(select(SysUser).where(SysUser.username == username)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar return await greenlet_spawn( ^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn result = context.throw(*sys.exc_info()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar return self._execute_internal( ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal conn = self._connection_for_bind(bind) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind return trans._connection_for_bind(engine, execution_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 2, in _connection_for_bind - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go ret_value = fn(self, *arg, **kw) ^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind conn = bind.connect() ^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect return self._connection_cls(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 146, in __init__ + Connection._handle_dbapi_exception_noconnection( + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 2450, in _handle_dbapi_exception_noconnection + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ self._dbapi_connection = engine.raw_connection() ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection return self.pool.connect() ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect return _ConnectionFairy._checkout(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout fairy = _ConnectionRecord.checkout(pool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout rec = pool._do_get() ^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get with util.safe_reraise(): ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ raise exc_value.with_traceback(exc_tb) - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get return self._create_connection() ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection return _ConnectionRecord(self) ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ self.__connect() - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect with util.safe_reraise(): ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ raise exc_value.with_traceback(exc_tb) - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect self.dbapi_connection = connection = pool._invoke_creator(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect return dialect.connect(*cargs_tup, **cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect await_only(creator_fn(*arg, **kw)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn value = await result ^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect await conn._connect() - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect await self._request_authentication() - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication await self.caching_sha2_password_auth(auth_packet) - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 984, in caching_sha2_password_auth - data = _auth.sha2_rsa_encrypt( - ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\pymysql\_auth.py", line 144, in sha2_rsa_encrypt - raise RuntimeError( -RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods -2026-09-10 20:06:54,037 ERROR [-] api: unhandled error on /api/auth/login + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 952, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1049, "Unknown database 'memory'") +(Background on this error at: https://sqlalche.me/e/20/e3q8) +2026-09-10 21:54:16,943 ERROR [-] api: unhandled error on /api/products Traceback (most recent call last): - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + self._dbapi_connection = engine.raw_connection() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + return self.pool.connect() + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + return _ConnectionFairy._checkout(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + fairy = _ConnectionRecord.checkout(pool) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + rec = pool._do_get() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + return self._create_connection() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + return _ConnectionRecord(self) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + self.__connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + self.dbapi_connection = connection = pool._invoke_creator(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + return dialect.connect(*cargs_tup, **cparams) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + await_only(creator_fn(*arg, **kw)), + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + value = await result + ^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + await conn._connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + await self._request_authentication() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + await self.caching_sha2_password_auth(auth_packet) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 989, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)") + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ await self.app(scope, receive, _send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\utils\request_id.py", line 28, in dispatch + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\utils\request_id.py", line 28, in dispatch response: Response = await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next raise app_exc from app_exc.__cause__ or app_exc.__context__ - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\base.py", line 144, in coro + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro await self.app(scope, receive_or_disconnect, send_no_error) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\routing.py", line 660, in __call__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ await self.middleware_stack(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2531, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2734, in app await route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1700, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle await self.original_router.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2586, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle await included_router._handle_selected(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1711, in _handle_selected + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected await route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1700, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle await self.original_router.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 2586, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle await included_router._handle_selected(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1720, in _handle_selected + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected await original_route.handle(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 1239, in handle + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle await app(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 150, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 158, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc - File "D:\cocnd\envs\fund\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 136, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 144, in app response = await f(request) ^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 690, in app + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 706, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\fastapi\routing.py", line 344, in run_endpoint_function + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\api\routers\auth.py", line 18, in login - return success(await auth_login(db, body.username, body.password)) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\service\auth.py", line 68, in login - user = await SysUserRepo(db).get_by_username(username) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\repositories\sys_user.py", line 14, in get_by_username - return await self.db.scalar(select(SysUser).where(SysUser.username == username)) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar - return await greenlet_spawn( - ^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\api\routers\product.py", line 26, in products + data = await list_products( + ^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\service\product.py", line 54, in list_products + items, total = await ProductRepo(db).search( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\repositories\product.py", line 64, in search + items = list((await self.db.scalars(stmt)).all()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 561, in scalars + result = await self.execute( + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 448, in execute + result = await greenlet_spawn( + ^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn result = context.throw(*sys.exc_info()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2373, in execute return self._execute_internal( ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal conn = self._connection_for_bind(bind) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind return trans._connection_for_bind(engine, execution_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 2, in _connection_for_bind - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go ret_value = fn(self, *arg, **kw) ^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind conn = bind.connect() ^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect return self._connection_cls(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 146, in __init__ + Connection._handle_dbapi_exception_noconnection( + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 2450, in _handle_dbapi_exception_noconnection + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ self._dbapi_connection = engine.raw_connection() ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection return self.pool.connect() ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect return _ConnectionFairy._checkout(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout fairy = _ConnectionRecord.checkout(pool) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout rec = pool._do_get() ^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get with util.safe_reraise(): ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ raise exc_value.with_traceback(exc_tb) - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get return self._create_connection() ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection return _ConnectionRecord(self) ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ self.__connect() - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect with util.safe_reraise(): ^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ raise exc_value.with_traceback(exc_tb) - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect self.dbapi_connection = connection = pool._invoke_creator(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect return dialect.connect(*cargs_tup, **cparams) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect await_only(creator_fn(*arg, **kw)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn value = await result ^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect await conn._connect() - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect await self._request_authentication() - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication await self.caching_sha2_password_auth(auth_packet) - File "D:\cocnd\envs\fund\Lib\site-packages\aiomysql\connection.py", line 984, in caching_sha2_password_auth - data = _auth.sha2_rsa_encrypt( - ^^^^^^^^^^^^^^^^^^^^^^^ - File "D:\cocnd\envs\fund\Lib\site-packages\pymysql\_auth.py", line 144, in sha2_rsa_encrypt - raise RuntimeError( -RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods -2026-09-10 20:15:28,098 ERROR [-] api: unhandled error on /api/auth/login -Traceback (most recent call last): - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ - await self.app(scope, receive, _send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ - response = await self.dispatch_func(request, call_next) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\utils\request_id.py", line 28, in dispatch - response: Response = await call_next(request) - ^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next - raise app_exc from app_exc.__cause__ or app_exc.__context__ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro - await self.app(scope, receive_or_disconnect, send_no_error) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ - await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app - raise exc - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app - await app(scope, receive, sender) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ - await self.app(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ - await self.middleware_stack(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2734, in app - await route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle - await self.original_router.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle - await included_router._handle_selected(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected - await route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle - await self.original_router.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle - await included_router._handle_selected(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected - await original_route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle - await app(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 158, in app - await wrap_app_handling_exceptions(app, request)(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app - raise exc - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app - await app(scope, receive, sender) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 144, in app - response = await f(request) - ^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 481, in app - solved_result = await solve_dependencies( - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\dependencies\utils.py", line 668, in solve_dependencies - solved = await _solve_generator( - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\dependencies\utils.py", line 574, in _solve_generator - return await stack.enter_async_context(cm) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\AppData\Roaming\uv\python\cpython-3.12.14-windows-x86_64-none\Lib\contextlib.py", line 659, in enter_async_context - result = await _enter(cm) - ^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\AppData\Roaming\uv\python\cpython-3.12.14-windows-x86_64-none\Lib\contextlib.py", line 210, in __aenter__ - return await anext(self.gen) - ^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\config\deps.py", line 7, in get_db - async with mysql.get_session_factory()() as session: - ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\config\database\mysql.py", line 32, in get_session_factory - _sessionmaker = async_sessionmaker(bind=get_engine(), expire_on_commit=False) - ^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\config\database\mysql.py", line 17, in get_engine - _engine = create_async_engine( - ^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\ext\asyncio\engine.py", line 120, in create_async_engine - sync_engine = _create_engine(url, **kw) - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "", line 2, in create_engine - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\deprecations.py", line 281, in warned - return fn(*args, **kwargs) # type: ignore[no-any-return] - ^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\create.py", line 617, in create_engine - dbapi = dbapi_meth(**dbapi_args) - ^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 229, in import_dbapi - __import__("aiomysql"), __import__("pymysql") - ^^^^^^^^^^^^^^^^^^^^^^ -ModuleNotFoundError: No module named 'aiomysql' -2026-09-10 20:15:47,067 ERROR [-] api: unhandled error on /api/auth/login -Traceback (most recent call last): - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ - await self.app(scope, receive, _send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ - response = await self.dispatch_func(request, call_next) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\utils\request_id.py", line 28, in dispatch - response: Response = await call_next(request) - ^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next - raise app_exc from app_exc.__cause__ or app_exc.__context__ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro - await self.app(scope, receive_or_disconnect, send_no_error) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ - await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app - raise exc - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app - await app(scope, receive, sender) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ - await self.app(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ - await self.middleware_stack(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2734, in app - await route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle - await self.original_router.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle - await included_router._handle_selected(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected - await route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle - await self.original_router.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle - await included_router._handle_selected(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected - await original_route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle - await app(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 158, in app - await wrap_app_handling_exceptions(app, request)(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app - raise exc - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app - await app(scope, receive, sender) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 144, in app - response = await f(request) - ^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 706, in app - raw_response = await run_endpoint_function( - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function - return await dependant.call(**values) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\api\routers\auth.py", line 18, in login - return success(await auth_login(db, body.username, body.password)) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\service\auth.py", line 68, in login - user = await SysUserRepo(db).get_by_username(username) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\repositories\sys_user.py", line 14, in get_by_username - return await self.db.scalar(select(SysUser).where(SysUser.username == username)) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar - return await greenlet_spawn( - ^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn - result = context.throw(*sys.exc_info()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar - return self._execute_internal( - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal - conn = self._connection_for_bind(bind) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind - return trans._connection_for_bind(engine, execution_options) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "", line 2, in _connection_for_bind - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go - ret_value = fn(self, *arg, **kw) - ^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind - conn = bind.connect() - ^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect - return self._connection_cls(self) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ - self._dbapi_connection = engine.raw_connection() - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection - return self.pool.connect() - ^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect - return _ConnectionFairy._checkout(self) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout - fairy = _ConnectionRecord.checkout(pool) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout - rec = pool._do_get() - ^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get - with util.safe_reraise(): - ^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ - raise exc_value.with_traceback(exc_tb) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get - return self._create_connection() - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection - return _ConnectionRecord(self) - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ - self.__connect() - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect - with util.safe_reraise(): - ^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ - raise exc_value.with_traceback(exc_tb) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect - self.dbapi_connection = connection = pool._invoke_creator(self) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect - return dialect.connect(*cargs_tup, **cparams) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect - return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect - await_only(creator_fn(*arg, **kw)), - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only - return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn - value = await result - ^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect - await conn._connect() - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect - await self._request_authentication() - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication - await self.caching_sha2_password_auth(auth_packet) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 984, in caching_sha2_password_auth - data = _auth.sha2_rsa_encrypt( - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\pymysql\_auth.py", line 144, in sha2_rsa_encrypt - raise RuntimeError( -RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods -2026-09-10 20:18:52,269 ERROR [-] api: unhandled error on /api/auth/login -Traceback (most recent call last): - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ - await self.app(scope, receive, _send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ - response = await self.dispatch_func(request, call_next) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\utils\request_id.py", line 28, in dispatch - response: Response = await call_next(request) - ^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next - raise app_exc from app_exc.__cause__ or app_exc.__context__ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro - await self.app(scope, receive_or_disconnect, send_no_error) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ - await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app - raise exc - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app - await app(scope, receive, sender) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ - await self.app(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ - await self.middleware_stack(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2734, in app - await route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle - await self.original_router.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle - await included_router._handle_selected(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected - await route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle - await self.original_router.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle - await included_router._handle_selected(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected - await original_route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle - await app(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 158, in app - await wrap_app_handling_exceptions(app, request)(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app - raise exc - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app - await app(scope, receive, sender) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 144, in app - response = await f(request) - ^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 706, in app - raw_response = await run_endpoint_function( - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function - return await dependant.call(**values) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\api\routers\auth.py", line 18, in login - return success(await auth_login(db, body.username, body.password)) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\service\auth.py", line 68, in login - user = await SysUserRepo(db).get_by_username(username) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\repositories\sys_user.py", line 14, in get_by_username - return await self.db.scalar(select(SysUser).where(SysUser.username == username)) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar - return await greenlet_spawn( - ^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn - result = context.throw(*sys.exc_info()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar - return self._execute_internal( - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal - conn = self._connection_for_bind(bind) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind - return trans._connection_for_bind(engine, execution_options) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "", line 2, in _connection_for_bind - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go - ret_value = fn(self, *arg, **kw) - ^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind - conn = bind.connect() - ^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect - return self._connection_cls(self) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ - self._dbapi_connection = engine.raw_connection() - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection - return self.pool.connect() - ^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect - return _ConnectionFairy._checkout(self) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout - fairy = _ConnectionRecord.checkout(pool) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout - rec = pool._do_get() - ^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get - with util.safe_reraise(): - ^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ - raise exc_value.with_traceback(exc_tb) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get - return self._create_connection() - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection - return _ConnectionRecord(self) - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ - self.__connect() - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect - with util.safe_reraise(): - ^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ - raise exc_value.with_traceback(exc_tb) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect - self.dbapi_connection = connection = pool._invoke_creator(self) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect - return dialect.connect(*cargs_tup, **cparams) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect - return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect - await_only(creator_fn(*arg, **kw)), - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only - return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn - value = await result - ^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect - await conn._connect() - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect - await self._request_authentication() - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication - await self.caching_sha2_password_auth(auth_packet) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 984, in caching_sha2_password_auth - data = _auth.sha2_rsa_encrypt( - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\pymysql\_auth.py", line 144, in sha2_rsa_encrypt - raise RuntimeError( -RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods -2026-09-10 20:26:43,171 ERROR [-] api: unhandled error on /api/auth/login -Traceback (most recent call last): - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ - await self.app(scope, receive, _send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ - response = await self.dispatch_func(request, call_next) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\utils\request_id.py", line 28, in dispatch - response: Response = await call_next(request) - ^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next - raise app_exc from app_exc.__cause__ or app_exc.__context__ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro - await self.app(scope, receive_or_disconnect, send_no_error) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ - await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app - raise exc - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app - await app(scope, receive, sender) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ - await self.app(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ - await self.middleware_stack(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2734, in app - await route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle - await self.original_router.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle - await included_router._handle_selected(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected - await route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle - await self.original_router.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle - await included_router._handle_selected(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected - await original_route.handle(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle - await app(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 158, in app - await wrap_app_handling_exceptions(app, request)(scope, receive, send) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app - raise exc - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app - await app(scope, receive, sender) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 144, in app - response = await f(request) - ^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 706, in app - raw_response = await run_endpoint_function( - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function - return await dependant.call(**values) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\api\routers\auth.py", line 18, in login - return success(await auth_login(db, body.username, body.password)) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\service\auth.py", line 68, in login - user = await SysUserRepo(db).get_by_username(username) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\repositories\sys_user.py", line 14, in get_by_username - return await self.db.scalar(select(SysUser).where(SysUser.username == username)) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar - return await greenlet_spawn( - ^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn - result = context.throw(*sys.exc_info()) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar - return self._execute_internal( - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal - conn = self._connection_for_bind(bind) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind - return trans._connection_for_bind(engine, execution_options) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "", line 2, in _connection_for_bind - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go - ret_value = fn(self, *arg, **kw) - ^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind - conn = bind.connect() - ^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect - return self._connection_cls(self) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ - self._dbapi_connection = engine.raw_connection() - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection - return self.pool.connect() - ^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect - return _ConnectionFairy._checkout(self) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout - fairy = _ConnectionRecord.checkout(pool) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout - rec = pool._do_get() - ^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get - with util.safe_reraise(): - ^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ - raise exc_value.with_traceback(exc_tb) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get - return self._create_connection() - ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection - return _ConnectionRecord(self) - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ - self.__connect() - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect - with util.safe_reraise(): - ^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ - raise exc_value.with_traceback(exc_tb) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect - self.dbapi_connection = connection = pool._invoke_creator(self) - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect - return dialect.connect(*cargs_tup, **cparams) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect - return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect - await_only(creator_fn(*arg, **kw)), - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only - return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn - value = await result - ^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect - await conn._connect() - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect - await self._request_authentication() - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication - await self.caching_sha2_password_auth(auth_packet) - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\aiomysql\connection.py", line 984, in caching_sha2_password_auth - data = _auth.sha2_rsa_encrypt( - ^^^^^^^^^^^^^^^^^^^^^^^ - File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\pymysql\_auth.py", line 144, in sha2_rsa_encrypt - raise RuntimeError( -RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 989, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1045, "Access denied for user 'root'@'localhost' (using password: YES)") +(Background on this error at: https://sqlalche.me/e/20/e3q8) diff --git a/logs/info.log b/logs/info.log index a34de19..21a10f7 100644 --- a/logs/info.log +++ b/logs/info.log @@ -1563,3 +1563,854 @@ Traceback (most recent call last): File "C:\Users\Windows\Desktop\fund\venv\Lib\site-packages\pymysql\_auth.py", line 144, in sha2_rsa_encrypt raise RuntimeError( RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods +2026-09-10 20:49:20,257 ERROR [-] api: unhandled error on /api/auth/login +Traceback (most recent call last): + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ + await self.app(scope, receive, _send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ + response = await self.dispatch_func(request, call_next) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\utils\request_id.py", line 28, in dispatch + response: Response = await call_next(request) + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next + raise app_exc from app_exc.__cause__ or app_exc.__context__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro + await self.app(scope, receive_or_disconnect, send_no_error) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ + await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + raise exc + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + await app(scope, receive, sender) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ + await self.app(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ + await self.middleware_stack(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2734, in app + await route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle + await self.original_router.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle + await included_router._handle_selected(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected + await route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle + await self.original_router.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle + await included_router._handle_selected(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected + await original_route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle + await app(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 158, in app + await wrap_app_handling_exceptions(app, request)(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + raise exc + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + await app(scope, receive, sender) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 144, in app + response = await f(request) + ^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 706, in app + raw_response = await run_endpoint_function( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function + return await dependant.call(**values) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\api\routers\auth.py", line 19, in login + return success(await auth_login(db, body.username, body.password)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\service\auth.py", line 68, in login + user = await SysUserRepo(db).get_by_username(username) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\repositories\sys_user.py", line 14, in get_by_username + return await self.db.scalar(select(SysUser).where(SysUser.username == username)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar + return await greenlet_spawn( + ^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn + result = context.throw(*sys.exc_info()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar + return self._execute_internal( + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal + conn = self._connection_for_bind(bind) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind + return trans._connection_for_bind(engine, execution_options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "", line 2, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go + ret_value = fn(self, *arg, **kw) + ^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind + conn = bind.connect() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect + return self._connection_cls(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + self._dbapi_connection = engine.raw_connection() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + return self.pool.connect() + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + return _ConnectionFairy._checkout(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + fairy = _ConnectionRecord.checkout(pool) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + rec = pool._do_get() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + return self._create_connection() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + return _ConnectionRecord(self) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + self.__connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + self.dbapi_connection = connection = pool._invoke_creator(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + return dialect.connect(*cargs_tup, **cparams) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + await_only(creator_fn(*arg, **kw)), + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + value = await result + ^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + await conn._connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + await self._request_authentication() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + await self.caching_sha2_password_auth(auth_packet) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 984, in caching_sha2_password_auth + data = _auth.sha2_rsa_encrypt( + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\_auth.py", line 144, in sha2_rsa_encrypt + raise RuntimeError( +RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods +2026-09-10 20:50:16,723 ERROR [-] api: unhandled error on /api/auth/login +Traceback (most recent call last): + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + self._dbapi_connection = engine.raw_connection() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + return self.pool.connect() + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + return _ConnectionFairy._checkout(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + fairy = _ConnectionRecord.checkout(pool) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + rec = pool._do_get() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + return self._create_connection() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + return _ConnectionRecord(self) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + self.__connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + self.dbapi_connection = connection = pool._invoke_creator(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + return dialect.connect(*cargs_tup, **cparams) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + await_only(creator_fn(*arg, **kw)), + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + value = await result + ^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + await conn._connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + await self._request_authentication() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + await self.caching_sha2_password_auth(auth_packet) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 989, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +pymysql.err.OperationalError: (1049, "Unknown database 'memory'") + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ + await self.app(scope, receive, _send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ + response = await self.dispatch_func(request, call_next) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\utils\request_id.py", line 28, in dispatch + response: Response = await call_next(request) + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next + raise app_exc from app_exc.__cause__ or app_exc.__context__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro + await self.app(scope, receive_or_disconnect, send_no_error) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ + await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + raise exc + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + await app(scope, receive, sender) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ + await self.app(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ + await self.middleware_stack(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2734, in app + await route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle + await self.original_router.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle + await included_router._handle_selected(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected + await route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle + await self.original_router.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle + await included_router._handle_selected(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected + await original_route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle + await app(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 158, in app + await wrap_app_handling_exceptions(app, request)(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + raise exc + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + await app(scope, receive, sender) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 144, in app + response = await f(request) + ^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 706, in app + raw_response = await run_endpoint_function( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function + return await dependant.call(**values) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\api\routers\auth.py", line 19, in login + return success(await auth_login(db, body.username, body.password)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\service\auth.py", line 68, in login + user = await SysUserRepo(db).get_by_username(username) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\repositories\sys_user.py", line 14, in get_by_username + return await self.db.scalar(select(SysUser).where(SysUser.username == username)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar + return await greenlet_spawn( + ^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn + result = context.throw(*sys.exc_info()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar + return self._execute_internal( + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal + conn = self._connection_for_bind(bind) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind + return trans._connection_for_bind(engine, execution_options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "", line 2, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go + ret_value = fn(self, *arg, **kw) + ^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind + conn = bind.connect() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect + return self._connection_cls(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 146, in __init__ + Connection._handle_dbapi_exception_noconnection( + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 2450, in _handle_dbapi_exception_noconnection + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + self._dbapi_connection = engine.raw_connection() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + return self.pool.connect() + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + return _ConnectionFairy._checkout(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + fairy = _ConnectionRecord.checkout(pool) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + rec = pool._do_get() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + return self._create_connection() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + return _ConnectionRecord(self) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + self.__connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + self.dbapi_connection = connection = pool._invoke_creator(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + return dialect.connect(*cargs_tup, **cparams) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + await_only(creator_fn(*arg, **kw)), + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + value = await result + ^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + await conn._connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + await self._request_authentication() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + await self.caching_sha2_password_auth(auth_packet) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 989, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1049, "Unknown database 'memory'") +(Background on this error at: https://sqlalche.me/e/20/e3q8) +2026-09-10 20:51:21,189 ERROR [-] api: unhandled error on /api/auth/login +Traceback (most recent call last): + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + self._dbapi_connection = engine.raw_connection() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + return self.pool.connect() + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + return _ConnectionFairy._checkout(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + fairy = _ConnectionRecord.checkout(pool) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + rec = pool._do_get() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + return self._create_connection() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + return _ConnectionRecord(self) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + self.__connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + self.dbapi_connection = connection = pool._invoke_creator(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + return dialect.connect(*cargs_tup, **cparams) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + await_only(creator_fn(*arg, **kw)), + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + value = await result + ^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + await conn._connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + await self._request_authentication() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + await self.caching_sha2_password_auth(auth_packet) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 952, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +pymysql.err.OperationalError: (1049, "Unknown database 'memory'") + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ + await self.app(scope, receive, _send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ + response = await self.dispatch_func(request, call_next) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\utils\request_id.py", line 28, in dispatch + response: Response = await call_next(request) + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next + raise app_exc from app_exc.__cause__ or app_exc.__context__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro + await self.app(scope, receive_or_disconnect, send_no_error) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ + await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + raise exc + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + await app(scope, receive, sender) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ + await self.app(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ + await self.middleware_stack(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2734, in app + await route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle + await self.original_router.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle + await included_router._handle_selected(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected + await route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle + await self.original_router.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle + await included_router._handle_selected(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected + await original_route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle + await app(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 158, in app + await wrap_app_handling_exceptions(app, request)(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + raise exc + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + await app(scope, receive, sender) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 144, in app + response = await f(request) + ^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 706, in app + raw_response = await run_endpoint_function( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function + return await dependant.call(**values) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\api\routers\auth.py", line 19, in login + return success(await auth_login(db, body.username, body.password)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\service\auth.py", line 68, in login + user = await SysUserRepo(db).get_by_username(username) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\repositories\sys_user.py", line 14, in get_by_username + return await self.db.scalar(select(SysUser).where(SysUser.username == username)) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 504, in scalar + return await greenlet_spawn( + ^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn + result = context.throw(*sys.exc_info()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2421, in scalar + return self._execute_internal( + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal + conn = self._connection_for_bind(bind) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind + return trans._connection_for_bind(engine, execution_options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "", line 2, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go + ret_value = fn(self, *arg, **kw) + ^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind + conn = bind.connect() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect + return self._connection_cls(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 146, in __init__ + Connection._handle_dbapi_exception_noconnection( + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 2450, in _handle_dbapi_exception_noconnection + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + self._dbapi_connection = engine.raw_connection() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + return self.pool.connect() + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + return _ConnectionFairy._checkout(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + fairy = _ConnectionRecord.checkout(pool) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + rec = pool._do_get() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + return self._create_connection() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + return _ConnectionRecord(self) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + self.__connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + self.dbapi_connection = connection = pool._invoke_creator(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + return dialect.connect(*cargs_tup, **cparams) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + await_only(creator_fn(*arg, **kw)), + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + value = await result + ^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + await conn._connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + await self._request_authentication() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + await self.caching_sha2_password_auth(auth_packet) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 952, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1049, "Unknown database 'memory'") +(Background on this error at: https://sqlalche.me/e/20/e3q8) +2026-09-10 21:54:16,943 ERROR [-] api: unhandled error on /api/products +Traceback (most recent call last): + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + self._dbapi_connection = engine.raw_connection() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + return self.pool.connect() + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + return _ConnectionFairy._checkout(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + fairy = _ConnectionRecord.checkout(pool) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + rec = pool._do_get() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + return self._create_connection() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + return _ConnectionRecord(self) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + self.__connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + self.dbapi_connection = connection = pool._invoke_creator(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + return dialect.connect(*cargs_tup, **cparams) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + await_only(creator_fn(*arg, **kw)), + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + value = await result + ^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + await conn._connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + await self._request_authentication() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + await self.caching_sha2_password_auth(auth_packet) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 989, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)") + +The above exception was the direct cause of the following exception: + +Traceback (most recent call last): + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\errors.py", line 164, in __call__ + await self.app(scope, receive, _send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 193, in __call__ + response = await self.dispatch_func(request, call_next) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\utils\request_id.py", line 28, in dispatch + response: Response = await call_next(request) + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 168, in call_next + raise app_exc from app_exc.__cause__ or app_exc.__context__ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\base.py", line 144, in coro + await self.app(scope, receive_or_disconnect, send_no_error) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\middleware\exceptions.py", line 63, in __call__ + await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + raise exc + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + await app(scope, receive, sender) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__ + await self.app(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\routing.py", line 670, in __call__ + await self.middleware_stack(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2734, in app + await route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle + await self.original_router.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle + await included_router._handle_selected(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1791, in _handle_selected + await route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1780, in handle + await self.original_router.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 2789, in handle + await included_router._handle_selected(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1800, in _handle_selected + await original_route.handle(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 1279, in handle + await app(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 158, in app + await wrap_app_handling_exceptions(app, request)(scope, receive, send) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app + raise exc + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app + await app(scope, receive, sender) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 144, in app + response = await f(request) + ^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 706, in app + raw_response = await run_endpoint_function( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\fastapi\routing.py", line 352, in run_endpoint_function + return await dependant.call(**values) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\api\routers\product.py", line 26, in products + data = await list_products( + ^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\service\product.py", line 54, in list_products + items, total = await ProductRepo(db).search( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\repositories\product.py", line 64, in search + items = list((await self.db.scalars(stmt)).all()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 561, in scalars + result = await self.execute( + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 448, in execute + result = await greenlet_spawn( + ^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 201, in greenlet_spawn + result = context.throw(*sys.exc_info()) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2373, in execute + return self._execute_internal( + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2261, in _execute_internal + conn = self._connection_for_bind(bind) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 2113, in _connection_for_bind + return trans._connection_for_bind(engine, execution_options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "", line 2, in _connection_for_bind + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\state_changes.py", line 137, in _go + ret_value = fn(self, *arg, **kw) + ^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\orm\session.py", line 1191, in _connection_for_bind + conn = bind.connect() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3295, in connect + return self._connection_cls(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 146, in __init__ + Connection._handle_dbapi_exception_noconnection( + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 2450, in _handle_dbapi_exception_noconnection + raise sqlalchemy_exception.with_traceback(exc_info[2]) from e + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 144, in __init__ + self._dbapi_connection = engine.raw_connection() + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\base.py", line 3319, in raw_connection + return self.pool.connect() + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 448, in connect + return _ConnectionFairy._checkout(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 1272, in _checkout + fairy = _ConnectionRecord.checkout(pool) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 712, in checkout + rec = pool._do_get() + ^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 178, in _do_get + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\impl.py", line 176, in _do_get + return self._create_connection() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 389, in _create_connection + return _ConnectionRecord(self) + ^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 674, in __init__ + self.__connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 900, in __connect + with util.safe_reraise(): + ^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\langhelpers.py", line 122, in __exit__ + raise exc_value.with_traceback(exc_tb) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\pool\base.py", line 896, in __connect + self.dbapi_connection = connection = pool._invoke_creator(self) + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\create.py", line 667, in connect + return dialect.connect(*cargs_tup, **cparams) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\engine\default.py", line 630, in connect + return self.loaded_dbapi.connect(*cargs, **cparams) # type: ignore[no-any-return] # NOQA: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\dialects\mysql\aiomysql.py", line 176, in connect + await_only(creator_fn(*arg, **kw)), + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 132, in await_only + return current.parent.switch(awaitable) # type: ignore[no-any-return,attr-defined] # noqa: E501 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 196, in greenlet_spawn + value = await result + ^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 74, in _connect + await conn._connect() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 540, in _connect + await self._request_authentication() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 865, in _request_authentication + await self.caching_sha2_password_auth(auth_packet) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 989, in caching_sha2_password_auth + pkt = await self._read_packet() + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\aiomysql\connection.py", line 652, in _read_packet + packet.raise_for_error() + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\protocol.py", line 219, in raise_for_error + err.raise_mysql_exception(self._data) + File "C:\Users\Windows\PycharmProjects\Mutual_Fund\.venv\Lib\site-packages\pymysql\err.py", line 154, in raise_mysql_exception + raise errorclass(errno, errval, sqlstate=sqlstate) +sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1045, "Access denied for user 'root'@'localhost' (using password: YES)") +(Background on this error at: https://sqlalche.me/e/20/e3q8) diff --git a/model/fin_customer_profile.py b/model/fin_customer_profile.py index 7f71983..a9e8389 100644 --- a/model/fin_customer_profile.py +++ b/model/fin_customer_profile.py @@ -3,8 +3,9 @@ from __future__ import annotations from datetime import datetime from decimal import Decimal +from typing import Any -from sqlalchemy import JSON, BigInteger, DateTime, Integer, Numeric, String, func +from sqlalchemy import BigInteger, DateTime, Integer, JSON, Numeric, String, func from sqlalchemy.orm import Mapped, mapped_column from model.base import Base @@ -14,20 +15,17 @@ class FinCustomerProfile(Base): __tablename__ = "fin_customer_profile" __table_args__ = {"comment": "客户画像主表(RAG/GraphRAG 个性化推荐核心上下文)"} - customer_id: Mapped[int] = mapped_column( - BigInteger, primary_key=True, autoincrement=False - ) + # 主键为 customer_id(一对一关联 sys_user.id),非自增 id + customer_id: Mapped[int] = mapped_column(BigInteger, primary_key=True) risk_level: Mapped[str | None] = mapped_column(String(16)) risk_score: Mapped[int | None] = mapped_column(Integer) investment_experience: Mapped[str | None] = mapped_column(String(16)) annual_income_range: Mapped[str | None] = mapped_column(String(32)) total_assets: Mapped[Decimal | None] = mapped_column(Numeric(18, 2)) - asset_allocation: Mapped[dict | None] = mapped_column(JSON) - product_preference: Mapped[dict | None] = mapped_column(JSON) + asset_allocation: Mapped[dict[str, Any] | None] = mapped_column(JSON) + product_preference: Mapped[dict[str, Any] | None] = mapped_column(JSON) customer_level: Mapped[str | None] = mapped_column(String(16)) - confidence_score: Mapped[Decimal] = mapped_column( - Numeric(5, 2), server_default="0.50" - ) + confidence_score: Mapped[Decimal] = mapped_column(Numeric(5, 2), server_default="0.50") profile_version: Mapped[int] = mapped_column(Integer, server_default="1") update_time: Mapped[datetime] = mapped_column( DateTime, server_default=func.now(), onupdate=func.now() diff --git a/repositories/sys_user.py b/repositories/sys_user.py index d8dc4a4..5304dc5 100644 --- a/repositories/sys_user.py +++ b/repositories/sys_user.py @@ -11,4 +11,7 @@ class SysUserRepo(BaseRepository): model = SysUser async def get_by_username(self, username: str) -> SysUser | None: - return await self.db.scalar(select(SysUser).where(SysUser.username == username)) \ No newline at end of file + return await self.db.scalar(select(SysUser).where(SysUser.username == username)) + + async def get_by_phone(self, phone: str) -> SysUser | None: + return await self.db.scalar(select(SysUser).where(SysUser.phone == phone)) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 0edbc0c..a11db29 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,15 @@ fastapi~=0.141.1 sqlalchemy~=2.0.52 +httpx~=0.28.1 +pydantic~=2.13.5 +starlette~=1.6.0 +neo4j~=6.3.0 +redis~=8.1.0 +pymilvus~=3.0.1 +pydantic-settings~=2.15.0 +pyjwt~=2.13.0 +fastapi~=0.141.1 +sqlalchemy~=2.0.52 aiomysql~=0.2.0 cryptography~=44.0.0 httpx~=0.28.1 diff --git a/schemas/auth.py b/schemas/auth.py index 0084476..6c8f08b 100644 --- a/schemas/auth.py +++ b/schemas/auth.py @@ -4,4 +4,11 @@ from pydantic import BaseModel, Field class LoginReq(BaseModel): username: str = Field(min_length=1, max_length=64) - password: str = Field(min_length=1, max_length=128) \ No newline at end of file + password: str = Field(min_length=1, max_length=128) + + +class RegisterReq(BaseModel): + username: str = Field(min_length=1, max_length=64) + password: str = Field(min_length=8, max_length=128, description="密码至少 8 位") + phone: str = Field(pattern=r"^1\d{10}$", description="11 位手机号") + real_name: str | None = Field(default=None, max_length=32) \ No newline at end of file diff --git a/service/auth.py b/service/auth.py index 3ca1a2e..2d47c7e 100644 --- a/service/auth.py +++ b/service/auth.py @@ -70,4 +70,30 @@ async def login(db: AsyncSession, username: str, password: str) -> dict: raise ParamError("用户名或密码错误") if user.status != "正常": raise ForbiddenError("账号状态异常,无法登录") - return {"token": create_token(user.id), "user": user_payload(user)} \ No newline at end of file + return {"token": create_token(user.id), "user": user_payload(user)} + + +async def register( + db: AsyncSession, + username: str, + password: str, + phone: str, + real_name: str | None = None, +) -> dict: + """客户注册:唯一性校验 → 密码加密存储 → 返回用户信息(不自动签发 token)。""" + repo = SysUserRepo(db) + if await repo.get_by_username(username) is not None: + raise ParamError("用户名已存在") + if await repo.get_by_phone(phone) is not None: + raise ParamError("手机号已注册") + + user = SysUser( + username=username, + password_hash=hash_password(password), + phone=phone, + real_name=real_name, + user_type="CUSTOMER", + status="正常", + ) + user = await repo.add(user) + return user_payload(user) \ No newline at end of file