A-kirami / nonebot-plugin-chatgpt

MIT License
319 stars 37 forks source link

[BUG]: 收到消息返回报错. #123

Open sherlockHlb opened 1 year ago

sherlockHlb commented 1 year ago

报告清单

影响版本

2023年2月20日版本

问题描述

02-20 21:04:55 [ERROR] nonebot_plugin_chatgpt | playwright未安装,请先在shell中运行playwright install Traceback (most recent call last): File "C:\Users\Administrator\Desktop\NBBOOT\FistBot\bot.py", line 17, in nonebot.run() File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot__init.py", line 273, in run get_driver().run(*args, *kwargs) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run uvicorn.run( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\uvicorn\main.py", line 569, in run server.run() File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1919, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\message.py", line 141, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\message.py", line 187, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 732, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 707, in simple_run await handler( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\dependencies\init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot_plugin_chatgpt\init__.py", line 60, in ai_chat await chat_bot.playwright_start()

File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot_plugin_chatgpt\chatgpt.py", line 54, in playwright_start self.browser = await playwright.firefox.launch( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright\async_api_generated.py", line 14340, in launch await self._impl_obj.launch( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright_impl_browser_type.py", line 93, in launch Browser, from_channel(await self._channel.send("launch", params)) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright_impl_connection.py", line 44, in send return await self._connection.wrap_api_call( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright_impl_connection.py", line 419, in wrap_api_call return await cb() File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright_impl_connection.py", line 79, in inner_send result = next(iter(done)).result() playwright._impl._api_types.Error: Executable doesn't exist at C:\Users\Administrator\AppData\Local\ms-playwright\firefox-1372\firefox\firefox.exe

╔════════════════════════════════════════════════════════════╗ ║ Looks like Playwright was just installed or updated. ║ ║ Please run the following command to download new browsers: ║ ║ ║ ║ playwright install ║ ║ ║ ║ <3 Playwright Team ║ ╚════════════════════════════════════════════════════════════╝ 02-20 21:04:55 [INFO] nonebot | Matcher(type='message', module=nonebot_plugin_chatgpt.utils) running complete 02-20 21:04:55 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_chatgpt.utils) failed. Traceback (most recent call last): File "C:\Users\Administrator\Desktop\NBBOOT\FistBot\bot.py", line 17, in nonebot.run() File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot__init__.py", line 273, in run get_driver().run(*args, *kwargs) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run uvicorn.run( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\uvicorn\main.py", line 569, in run server.run() File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1919, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\message.py", line 141, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\message.py", line 187, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 732, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 707, in simple_run await handler( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\dependencies__init.py", line 108, in call return await cast(Callable[..., Awaitable[R]], self.call)(values) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot_plugin_chatgpt__init__.py", line 66, in ai_chat msg = await chat_bot(session[event]).get_chat_response(text) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot_plugin_chatgpt\chatgpt.py", line 123, in get_chat_response async with self.get_page() as page: File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 204, in aenter__ return await anext(self.gen) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot_plugin_chatgpt\chatgpt.py", line 115, in get_page page = await self.content.new_page() AttributeError: 'NoneType' object has no attribute 'new_page'

复现步骤

安装之后,收到信息直接报错, 但是CD冷却可以正常回复.

预期行为

No response

实际行为

No response

日志信息

No response

额外补充

No response

sherlockHlb commented 1 year ago

无法理解什么叫"playwright install"

CCYellowStar @.***> 于2023年2月21日周二 17:52写道:

playwright install

— Reply to this email directly, view it on GitHub https://github.com/A-kirami/nonebot-plugin-chatgpt/issues/123#issuecomment-1438176840, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHGWKXXKLLC4FALNFGWVGTLWYSF6RANCNFSM6AAAAAAVB3RRWU . You are receiving this because you authored the thread.Message ID: @.***>

sherlockHlb commented 1 year ago

无法识别该指令

sherlockHlb commented 1 year ago

powershell和cmd都不行. bot用的是虚拟环境

sherlockHlb commented 1 year ago

现在处理好了,但是返回错误 02-22 16:16:23 [ERROR] nonebot_plugin_chatgpt | ChatGPT request failed: Error: NS_ERROR_NET_INTERRUPT =========================== logs =========================== navigating to "https://chat.openai.com/chat", waiting until "load"

Traceback (most recent call last): File "C:\Users\Administrator\Desktop\NBBOOT\FistBot\bot.py", line 17, in nonebot.run() File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot__init.py", line 273, in run get_driver().run(*args, *kwargs) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\drivers\fastapi.py", line 187, in run uvicorn.run( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\uvicorn\main.py", line 569, in run server.run() File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 640, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 607, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 1919, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\message.py", line 141, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\message.py", line 187, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 732, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\internal\matcher\matcher.py", line 707, in simple_run await handler( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot\dependencies\init.py", line 108, in call__ return await cast(Callable[..., Awaitable[R]], self.call)(**values)

File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot_plugin_chatgpt__init__.py", line 66, in ai_chat msg = await chat_bot(session[event]).get_chat_response(text) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot_plugin_chatgpt\chatgpt.py", line 123, in get_chat_response async with self.get_page() as page: File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\contextlib.py", line 204, in aenter return await anext(self.gen) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\nonebot_plugin_chatgpt\chatgpt.py", line 118, in get_page await page.goto("https://chat.openai.com/chat") File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright\async_api_generated.py", line 9135, in goto await self._impl_obj.goto( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright_impl_page.py", line 491, in goto return await self._main_frame.goto(locals_to_params(locals())) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright_impl_frame.py", line 147, in goto await self._channel.send("goto", locals_to_params(locals())) File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright_impl_connection.py", line 44, in send return await self._connection.wrap_api_call( File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright_impl_connection.py", line 419, in wrap_api_call return await cb() File "C:\Users\Administrator\Desktop\NBBOOT\FistBot.venv\Lib\site-packages\playwright_impl_connection.py", line 79, in inner_send result = next(iter(done)).result() playwright._impl._api_types.Error: NS_ERROR_NET_INTERRUPT =========================== logs =========================== navigating to "https://chat.openai.com/chat", waiting until "load"

sherlockHlb commented 1 year ago

ChatGPT 目前无法回复您的问题。 Error: NS_ERROR_NET_INTERRUPT =========================== logs =========================== navigating to "https://chat.openai.com/chat", waiting until "load"

Chatgpt目前无法回复您的问题. 错误:NS_ERROR_NET中断 =。 导航到“Https://chat.openai.com/chat,等待“装载

sherlockHlb commented 1 year ago

ummmm试了很多次,可能是什么原因造成的呢.网络波动吗

sherlockHlb commented 1 year ago

是否要加上梯子?

sherlockHlb commented 1 year ago

CHATGPT_PROXIES=http://127.0.0.1:1090 加上了http代理梯子依然不行

sherlockHlb commented 1 year ago

WINDOWS 服务器

sherlockHlb commented 1 year ago

可以的,重新获取后提示02-22 16:40:33 [ERROR] nonebot_plugin_chatgpt | cf cookies获取失败

sherlockHlb commented 1 year ago

image

sherlockHlb commented 1 year ago

You do not have access to chat.openai.com.

The site owner may have set restrictions that prevent you from accessing the site.

Ray ID: 79d67601192e523f
Timestamp: 2023-02-22 08:48:07 UTC
Your IP address: 89.208.253.46
Requested URL: chat.openai.com/chat
Error reference number: 1020
Server ID: FL_12F824
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/108.0.2

弹出的不是默认浏览器

sherlockHlb commented 1 year ago

没有找到代理相关选项

sherlockHlb commented 1 year ago

看样子应该是的. 弹出了一个FF浏览器

sherlockHlb commented 1 year ago

默认用的EDGE浏览器

sherlockHlb commented 1 year ago

image edge可以正常访问