File "F:\bot\services\db_context.py", line 16, in init
await db.set_bind(i_bind)
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\gino\api.py", line 417, in set_bind
bind = await create_engine(bind, loop=loop, kwargs)
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\gino\strategies.py", line 55, in create
pool = await dialect.init_pool(u, loop, pool_class=pool_class)
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\gino\dialects\asyncpg.py", line 465, in init_pool
return await pool_class(url, loop, init=self.on_connect(), self._pool_kwargs)
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\gino\dialects\asyncpg.py", line 218, in _init
self._pool = await asyncpg.create_pool(*args)
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\pool.py", line 413, in _asyncinit
await self._initialize()
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\pool.py", line 441, in _initialize
await first_ch.connect()
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\pool.py", line 133, in connect
self._con = await self._pool._get_new_connection()
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\pool.py", line 511, in _get_new_connection
con = await connection.connect(
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connection.py", line 2085, in connect
return await connect_utils._connect(
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connect_utils.py", line 895, in _connect
raise last_error
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connect_utils.py", line 881, in _connect
return await _connect_addr(
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connect_utils.py", line 781, in _connect_addr
return await __connect_addr(params, timeout, True, args)
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connect_utils.py", line 825, in __connect_addr
tr, pr = await compat.wait_for(connector, timeout=timeout)
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\compat.py", line 66, in wait_for
return await asyncio.wait_for(fut, timeout)
File "D:\python\lib\asyncio\tasks.py", line 481, in wait_for
return fut.result()
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connect_utils.py", line 691, in _create_ssl_connection
tr, pr = await loop.create_connection(
File "D:\python\lib\asyncio\base_events.py", line 1056, in create_connection
raise exceptions[0]
File "D:\python\lib\asyncio\base_events.py", line 1041, in create_connection
sock = await self._connect_sock(
File "D:\python\lib\asyncio\base_events.py", line 955, in _connect_sock
await self.sock_connect(sock, address)
File "D:\python\lib\asyncio\selector_events.py", line 502, in sock_connect
return await fut
File "D:\python\lib\asyncio\selector_events.py", line 537, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 15588)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\starlette\routing.py", line 621, in lifespan
async with self.lifespan_context(app):
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\starlette\routing.py", line 518, in aenter
await self._router.startup()
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\starlette\routing.py", line 598, in startup
await handler()
File "F:\bot\services\db_context.py", line 20, in init
raise Exception(f'数据库连接错误.... {type(e)}: {e}')
Exception: 数据库连接错误.... <class 'ConnectionRefusedError'>: [Errno 10061] Connect call failed ('127.0.0.1', 15588)
05-19 00:52:41 [ERROR] uvicorn | Application startup failed. Exiting.
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\bilibili_api\utils\network.py", line 26, in __clean
loop = asyncio.get_event_loop()
File "D:\python\lib\asyncio\events.py", line 642, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'MainThread'.
File "F:\bot\services\db_context.py", line 16, in init await db.set_bind(i_bind) File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\gino\api.py", line 417, in set_bind bind = await create_engine(bind, loop=loop, kwargs) File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\gino\strategies.py", line 55, in create pool = await dialect.init_pool(u, loop, pool_class=pool_class) File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\gino\dialects\asyncpg.py", line 465, in init_pool return await pool_class(url, loop, init=self.on_connect(), self._pool_kwargs) File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\gino\dialects\asyncpg.py", line 218, in _init self._pool = await asyncpg.create_pool(*args) File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\pool.py", line 413, in _asyncinit await self._initialize() File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\pool.py", line 441, in _initialize await first_ch.connect() File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\pool.py", line 133, in connect self._con = await self._pool._get_new_connection() File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\pool.py", line 511, in _get_new_connection con = await connection.connect( File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connection.py", line 2085, in connect return await connect_utils._connect( File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connect_utils.py", line 895, in _connect raise last_error File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connect_utils.py", line 881, in _connect return await _connect_addr( File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connect_utils.py", line 781, in _connect_addr return await __connect_addr(params, timeout, True, args) File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connect_utils.py", line 825, in __connect_addr tr, pr = await compat.wait_for(connector, timeout=timeout) File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\compat.py", line 66, in wait_for return await asyncio.wait_for(fut, timeout) File "D:\python\lib\asyncio\tasks.py", line 481, in wait_for return fut.result() File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\asyncpg\connect_utils.py", line 691, in _create_ssl_connection tr, pr = await loop.create_connection( File "D:\python\lib\asyncio\base_events.py", line 1056, in create_connection raise exceptions[0] File "D:\python\lib\asyncio\base_events.py", line 1041, in create_connection sock = await self._connect_sock( File "D:\python\lib\asyncio\base_events.py", line 955, in _connect_sock await self.sock_connect(sock, address) File "D:\python\lib\asyncio\selector_events.py", line 502, in sock_connect return await fut File "D:\python\lib\asyncio\selector_events.py", line 537, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 15588)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\starlette\routing.py", line 621, in lifespan async with self.lifespan_context(app): File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\starlette\routing.py", line 518, in aenter await self._router.startup() File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\starlette\routing.py", line 598, in startup await handler() File "F:\bot\services\db_context.py", line 20, in init raise Exception(f'数据库连接错误.... {type(e)}: {e}') Exception: 数据库连接错误.... <class 'ConnectionRefusedError'>: [Errno 10061] Connect call failed ('127.0.0.1', 15588)
05-19 00:52:41 [ERROR] uvicorn | Application startup failed. Exiting. Error in atexit._run_exitfuncs: Traceback (most recent call last): File "C:\Users\loser\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-8cBdUBmx-py3.9\lib\site-packages\bilibili_api\utils\network.py", line 26, in __clean loop = asyncio.get_event_loop() File "D:\python\lib\asyncio\events.py", line 642, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'MainThread'.