Soulter / AstrBot

QQ、Telegram、微信 等多平台兼容的支持 LLM 聊天的机器人平台。支持自定义插件扩展。
GNU Affero General Public License v3.0
581 stars 58 forks source link

启用QQ机器人,远程计算机拒绝网络连接 #93

Closed Ren-Boo closed 1 year ago

Ren-Boo commented 1 year ago

[System] 启用QQ机器人 [ERROR] (base_events.py:1744)default_exception_handler Task exception was never retrieved future: <Task finished name='Task-2' coro=<CQHTTP.ws_event() done, defined at C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\nakuru\application.py:56> exception=ClientConnectorError(ConnectionKey(host='127.0.0.1', port=6700, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None), ConnectionRefusedError(22, '远程计算机 拒绝网络连接。', None, 1225, None))> Traceback (most recent call last): File "C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\aiohttp\connector.py", line 980, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 1064, in create_connection raise exceptions[0] File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 1049, in create_connection sock = await self._connect_sock( File "C:\Program Files\Python310\lib\asyncio\base_events.py", line 960, in _connect_sock await self.sock_connect(sock, address) File "C:\Program Files\Python310\lib\asyncio\proactor_events.py", line 705, in sock_connect return await self._proactor.connect(sock, address) File "C:\Program Files\Python310\lib\asyncio\windows_events.py", line 817, in _poll value = callback(transferred, key, ov) File "C:\Program Files\Python310\lib\asyncio\windows_events.py", line 604, in finish_connect ov.getresult() ConnectionRefusedError: [WinError 1225] 远程计算机拒绝网络连接。

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

Traceback (most recent call last): File "C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\nakuru\application.py", line 58, in ws_event async with session.ws_connect(f"{self.baseurl}", headers=self.headers) as ws_connection: File "C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\aiohttp\client.py", line 1141, in aenter self._resp = await self._coro File "C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\aiohttp\client.py", line 779, in _ws_connect resp = await self.request( File "C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\aiohttp\client.py", line 536, in _request conn = await self._connector.connect( File "C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\aiohttp\connector.py", line 540, in connect proto = await self._create_connection(req, traces, timeout) File "C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\aiohttp\connector.py", line 901, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) File "C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\aiohttp\connector.py", line 1206, in _create_direct_connection raise last_exc File "C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\aiohttp\connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "C:\Users\Liu Lin\AppData\Roaming\Python\Python310\site-packages\aiohttp\connector.py", line 988, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 127.0.0.1:6700 ssl:default [远程计算机拒绝网络连 接。]

Soulter commented 1 year ago

gocq-http启动了吗,下载的启动器尾号是fix-多少

Ren-Boo commented 1 year ago

gocq-http启动了吗,下载的启动器尾号是fix-多少

launcher-0.0.3-fix-1 开全局代理不会报这个错,但是会提示 OpenAI API错误。原因如下: 连接超时 前往官方频道反馈~

[System] 启用QQ机器人 [GOCQ-BOT] 接收到消息:1 [WARNING] (connectionpool.py:810)urlopen Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /v1/chat/completions [WARNING] (connectionpool.py:810)urlopen Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /v1/chat/completions Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))) [WARNING] (connectionpool.py:810)urlopen Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /v1/chat/completions [WARNING] (connectionpool.py:810)urlopen Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /v1/chat/completions Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))) [WARNING] (connectionpool.py:810)urlopen Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /v1/chat/completions [WARNING] (connectionpool.py:810)urlopen Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /v1/chat/completions Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))) [WARNING] (connectionpool.py:810)urlopen Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /v1/chat/completions [WARNING] (connectionpool.py:810)urlopen Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /v1/chat/completions Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))) [WARNING] (connectionpool.py:810)urlopen Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /v1/chat/completions [WARNING] (connectionpool.py:810)urlopen Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /v1/chat/completions Error communicating with OpenAI: HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))) [System-Err] OpenAI API错误。原因如下: 连接超时 [System-Info] 回复QQ消息中...OpenAI API错误。原因如下: 连接超时 前往官方频道反馈~

Soulter commented 1 year ago

需要在配置文件正确设置系统代理。

不同的代理软件端口可能不同。Clash是7890.

Ren-Boo commented 1 year ago

OK,好了,谢谢大佬