project-mirai / mirai-api-http

Mirai HTTP API (console) plugin
GNU Affero General Public License v3.0
1.66k stars 343 forks source link

我反复确认配置是正确的,但还是报错“无法连接到 mirai。请检查 mirai-api-http 是否启动,地址与端口是否正确。” #633

Closed A-n-k-a closed 1 year ago

A-n-k-a commented 2 years ago

以前旧版本测试是正常的,最新版报错如下 INFO: Started server process [12208] INFO: Waiting for application startup. 2022-10-11 02:12:58 - ERROR 无法连接到 mirai。请检查 mirai-api-http 是否启动,地址与端口是否正确。 ERROR: Traceback (most recent call last): File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\site-packages\mirai\adapters\base.py", line 35, in wrapped return await func(self, *args, **kwargs) File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\site-packages\mirai\adapters\websocket.py", line 187, in login self.connection = await connect(self.host_name, extra_headers=headers) File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\site-packages\websockets\legacy\client.py", line 622, in __await_impl__ transport, protocol = await self._create_connection() File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1056, in create_connection raise exceptions[0] File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1041, in create_connection sock = await self._connect_sock( File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 955, in _connect_sock
await self.sock_connect(sock, address) File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\asyncio\selector_events.py", line 502, in sock_connect
return await fut File "C:\Users\20742\AppData\Local\Programs\Python\Python39\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 ('129.204.92.123', 6060)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py", line 621, in lifespan async with self.lifespan_context(app): File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py", line 518, in aenter await self._router.startup() File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\site-packages\starlette\routing.py", line 598, in startup await handler() File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\site-packages\mirai\bot.py", line 216, in startup
await asyncio.gather(*coros) File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\site-packages\mirai\bot.py", line 135, in startup
await self._adapter.login(self.qq) File "C:\Users\20742\AppData\Local\Programs\Python\Python39\lib\site-packages\mirai\adapters\base.py", line 41, in wrapped raise err from e mirai.exceptions.NetworkError: 无法连接到 mirai。请检查 mirai-api-http 是否启动,地址与端口是否正确。

ERROR: Application startup failed. Exiting.

MDeath commented 2 years ago

你贴这个报错又看不到你的代码和环境很难排除问题

ryoii commented 2 years ago

你把问题提到对应 sdk 让他们定位问题