A-kirami / nonebot-plugin-chatgpt

MIT License
321 stars 37 forks source link

[BUG]: 错误信息: LocalProtocolError: Illegal header value b'Bearer ' #55

Open LSGLSH opened 1 year ago

LSGLSH commented 1 year ago

报告清单

影响版本

当前最新版本

问题描述

功能使用报错

复现步骤

正常艾特bot,发生报错,启动无报错,运行报错

预期行为

恢复正常使用

实际行为

No response

日志信息

return await self.request(

File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-lAGE7ajM-py3.9/lib/python3.9/site-packages/httpx/_client.py", line 1506, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-lAGE7ajM-py3.9/lib/python3.9/site-packages/httpx/_client.py", line 1593, in send response = await self._send_handling_auth( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-lAGE7ajM-py3.9/lib/python3.9/site-packages/httpx/_client.py", line 1621, in _send_handling_auth response = await self._send_handling_redirects( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-lAGE7ajM-py3.9/lib/python3.9/site-packages/httpx/_client.py", line 1658, in _send_handling_redirects response = await self._send_single_request(request) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-lAGE7ajM-py3.9/lib/python3.9/site-packages/httpx/_client.py", line 1695, in _send_single_request response = await transport.handle_async_request(request) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-lAGE7ajM-py3.9/lib/python3.9/site-packages/httpx/_transports/default.py", line 353, in handle_async_request resp = await self._pool.handle_async_request(req) File "/usr/lib/python3.9/contextlib.py", line 137, in exit self.gen.throw(typ, value, traceback) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-lAGE7ajM-py3.9/lib/python3.9/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ConnectError

额外补充

No response

Prometheus-first commented 1 year ago

你是怎么运行出来的呢,我运行起来还是上次那个tag的报错

LSGLSH commented 1 year ago

你是怎么运行出来的呢,我运行起来还是上次那个tag的报错

我是上次更新的版本,直接用这次更新的包替换,然后token是之前保存的,重启就报错就改变了。

Prometheus-first commented 1 year ago

pip install nonebot-plugin-chatgpt --upgrade,除了这个之外还用别的命令了嘛

LSGLSH commented 1 year ago

pip install nonebot-plugin-chatgpt --upgrade,除了这个之外还用别的命令了嘛

没有,我是手动下载,手动替换的

Prometheus-first commented 1 year ago

咱俩现在报同样的错了

sena-nana commented 1 year ago

你运行过playwright install了吗

LSGLSH commented 1 year ago

你运行过playwright install了吗

不是很懂,比较小白

Prometheus-first commented 1 year ago

我运行了,但是终端不鸟我 image

Prometheus-first commented 1 year ago

我看了一下pip list 里面有playwright,也运行过playwright install

zhouwenze1 commented 1 year ago

把.env里的FASTAPI_RELOAD关了

void258 commented 1 year ago

官网好像又崩了

Prometheus-first commented 1 year ago

把.env里的FASTAPI_RELOAD关了

我用的prod环境,没有用那个fastapi呀 image image

zhouwenze1 commented 1 year ago

把.env里的FASTAPI_RELOAD关了

我用的prod环境,没有用那个fastapi呀 image image

我今天早上也是遇到这个问题,我加了个 image 就好了

Prometheus-first commented 1 year ago

把.env里的FASTAPI_RELOAD关了

我用的prod环境,没有用那个fastapi呀 image image

我今天早上也是遇到这个问题,我加了个 image 就好了

改了,但还是报错,完整报错信息在这里 报错.txt

sena-nana commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

Prometheus-first commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

算了,等几天吧,还是不行

sena-nana commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

算了,等几天吧,还是不行

看看报错

zhouwenze1 commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

算了,等几天吧,还是不行

看看报错 https://pastebin.ubuntu.com/p/tRfDHgFBDY/ 这是我今天早上的报错,和这个基本一样,我关了fastapi就好了,您研究下吧

Prometheus-first commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

算了,等几天吧,还是不行

看看报错

default.txt

sena-nana commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

算了,等几天吧,还是不行

看看报错

default.txt

你这截的有点少( 如果你的服务器是1H2G那种性能偏低的可以再clone一下试试,刚刚解决了由于性能低导致的bearer

Prometheus-first commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

算了,等几天吧,还是不行

看看报错

default.txt

你这截的有点少( 如果你的服务器是1H2G那种性能偏低的可以再clone一下试试,刚刚解决了由于性能低导致的bearer

完整报错.txt 从启动到关闭的所有信息都在这了

sena-nana commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

算了,等几天吧,还是不行

看看报错

default.txt

你这截的有点少( 如果你的服务器是1H2G那种性能偏低的可以再clone一下试试,刚刚解决了由于性能低导致的bearer

完整报错.txt 从启动到关闭的所有信息都在这了

你用的不是我改过的版本

Prometheus-first commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

算了,等几天吧,还是不行

看看报错

default.txt

你这截的有点少( 如果你的服务器是1H2G那种性能偏低的可以再clone一下试试,刚刚解决了由于性能低导致的bearer

完整报错.txt 从启动到关闭的所有信息都在这了

你用的不是我改过的版本

太强了,能用了

Prometheus-first commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

算了,等几天吧,还是不行

看看报错

default.txt

你这截的有点少( 如果你的服务器是1H2G那种性能偏低的可以再clone一下试试,刚刚解决了由于性能低导致的bearer

完整报错.txt 从启动到关闭的所有信息都在这了

你用的不是我改过的版本

你是我的神

sena-nana commented 1 year ago

在该pr中得到解决(大概),如果有使用该pr的版本还是出现该问题的可以及时联系我排查原因

52

Prometheus-first commented 1 year ago

在该pr中得到解决(大概),如果有使用该pr的版本还是出现该问题的可以及时联系我排查原因 #52

太强了,我每天都在用,有任何问题我会及时反馈

zhouwenze1 commented 1 year ago

在该pr中得到解决(大概),如果有使用该pr的版本还是出现该问题的可以及时联系我排查原因 #52

借地方问一下,这个问题解决了但是请求会超时是官方的问题不

sena-nana commented 1 year ago

在该pr中得到解决(大概),如果有使用该pr的版本还是出现该问题的可以及时联系我排查原因 #52

借地方问一下,这个问题解决了但是请求会超时是官方的问题不

timeout调大点试试

void258 commented 1 year ago

我这边刚才一直提示可能遇到人工验证,换了token就能连上了

zhouwenze1 commented 1 year ago

在该pr中得到解决(大概),如果有使用该pr的版本还是出现该问题的可以及时联系我排查原因 #52

借地方问一下,这个问题解决了但是请求会超时是官方的问题不

timeout调大点试试

改成120还是会超时

MandarinDuck231 commented 1 year ago

image image 我的bot使用了你修改的会出现这种错误是为什么啊求告知。。。

sena-nana commented 1 year ago

真正的报错在上面,看看是不是没运行过playwright install

image image 我的bot使用了你修改的会出现这种错误是为什么啊求告知。。。

MandarinDuck231 commented 1 year ago

真正的报错在上面,看是不是没有运行过编剧安装

图片 图片我的机器人使用了你修改的会出现这种错误是为什么啊求告知道。。。

我已经playwright install过了,还是这样。。。。

sena-nana commented 1 year ago

真正的报错在上面,看是不是没有运行过编剧安装

图片 图片我的机器人使用了你修改的会出现这种错误是为什么啊求告知道。。。

我已经playwright install过了,还是这样。。。。

你导一份完整的日志给我吧,感觉看着不全,这个报错太离谱了

kasdals commented 1 year ago

真正的报错在上面,看是不是没有运行过编剧安装

图片 图片我的机器人使用了你修改的会出现这种错误是为什么啊求告知道。。。

我已经playwright install过了,还是这样。。。。

你导一份完整的日志给我吧,感觉看着不全,这个报错太离谱了

大佬,同款报错,我重启过服务器和更换过token,还是这样

12-13 19:27:19 [ERROR] nonebot_plugin_chatgpt | playwright未安装,请先在shell中运行playwright install Traceback (most recent call last): File "C:\Users\Administrator\Desktop\zhenxun_bot-main\bot.py", line 20, in nonebot.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot__init.py", line 273, in run get_driver().run(*args, *kwargs) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run uvicorn.run( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\uvicorn\main.py", line 576, in run server.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\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\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 596, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\message.py", line 186, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\internal\matcher.py", line 716, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\internal\matcher.py", line 688, in simple_run await handler( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\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\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\init__.py", line 60, in ai_chat msg = await chat_bot(**session[event]).get_chat_response(text) File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 94, in get_chat_response await self.refresh_session() File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 150, in refresh_session await self.get_cf_cookies()

File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 194, in get_cf_cookies browser = await p.firefox.launch( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\playwright\async_api_generated.py", line 12664, in launch await self._impl_obj.launch( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\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\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\playwright_impl_connection.py", line 43, in send return await self._connection.wrap_api_call( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\playwright_impl_connection.py", line 396, in wrap_api_call return await cb() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\playwright_impl_connection.py", line 78, 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-1357\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 ║ ╚════════════════════════════════════════════════════════════╝ 12-13 19:27:19 [ERROR] nonebot_plugin_chatgpt | 刷新会话失败: HTTP403 <!DOCTYPE html>

Just a moment...

chat.openai.com

Checking if the site connection is secure

chat.openai.com needs to review the security of your connection before proceeding.

Traceback (most recent call last): File "C:\Users\Administrator\Desktop\zhenxun_bot-main\bot.py", line 20, in nonebot.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot__init.py", line 273, in run get_driver().run(*args, *kwargs) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run uvicorn.run( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\uvicorn\main.py", line 576, in run server.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\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\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 596, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\message.py", line 186, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\internal\matcher.py", line 716, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\internal\matcher.py", line 688, in simple_run await handler( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\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\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\init__.py", line 60, in ai_chat msg = await chat_bot(**session[event]).get_chat_response(text) File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 94, in get_chat_response await self.refresh_session()

File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 150, in refresh_session await self.get_cf_cookies() File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 212, in get_cf_cookies ua = f"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/{browser.version}" UnboundLocalError: local variable 'browser' referenced before assignment 12-13 19:27:20 [ERROR] nonebot_plugin_chatgpt | playwright未安装,请先在shell中运行playwright install Traceback (most recent call last): File "C:\Users\Administrator\Desktop\zhenxun_bot-main\bot.py", line 20, in nonebot.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot__init.py", line 273, in run get_driver().run(*args, *kwargs) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run uvicorn.run( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\uvicorn\main.py", line 576, in run server.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\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\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 596, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\message.py", line 186, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\internal\matcher.py", line 716, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\internal\matcher.py", line 688, in simple_run await handler( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\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\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\init__.py", line 60, in ai_chat msg = await chat_bot(**session[event]).get_chat_response(text) File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 94, in get_chat_response await self.refresh_session() File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 150, in refresh_session await self.get_cf_cookies() File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 194, in get_cf_cookies browser = await p.firefox.launch( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\playwright\async_api_generated.py", line 12664, in launch await self._impl_obj.launch( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\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\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\playwright_impl_connection.py", line 43, in send return await self._connection.wrap_api_call( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\playwright_impl_connection.py", line 396, in wrap_api_call return await cb() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\playwright_impl_connection.py", line 78, 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-1357\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 ║ ╚════════════════════════════════════════════════════════════╝ 12-13 19:27:20 [ERROR] nonebot_plugin_chatgpt | 刷新会话失败: HTTP403 <!DOCTYPE html>

Just a moment...

chat.openai.com

Checking if the site connection is secure

chat.openai.com needs to review the security of your connection before proceeding.

Traceback (most recent call last): File "C:\Users\Administrator\Desktop\zhenxun_bot-main\bot.py", line 20, in nonebot.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot__init.py", line 273, in run get_driver().run(*args, *kwargs) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run uvicorn.run( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\uvicorn\main.py", line 576, in run server.run() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\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\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 596, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1890, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\message.py", line 186, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\internal\matcher.py", line 716, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\lib\site-packages\nonebot\internal\matcher.py", line 688, in simple_run await handler( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-cjzdVN1J-py3.9\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\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\init__.py", line 60, in ai_chat msg = await chat_bot(**session[event]).get_chat_response(text) File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 94, in get_chat_response await self.refresh_session()

File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 150, in refresh_session await self.get_cf_cookies() File "C:\Users\Administrator\Desktop\zhenxun_bot-main\plugins\nonebot_plugin_chatgpt\chatgpt.py", line 212, in get_cf_cookies ua = f"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/{browser.version}" UnboundLocalError: local variable 'browser' referenced before assignment 12-13 19:27:21 [INFO] nonebot | Matcher(type='message', module=plugins.nonebot_plugin_chatgpt.utils) running complete

image

sena-nana commented 1 year ago

在shell里运行playwright install,你这个报错就是没有运行过这个指令导致的

kasdals commented 1 year ago

在shell里运行playwright install,你这个报错就是没有运行过这个指令导致的

好的,大佬,我在试一下

kchaifiuou commented 1 year ago

更新后触发指令后台报coroutine raised StopIteration,机器人报获取session失败,请检查后台报错,麻烦大佬帮忙看看,谢谢大佬 日志.txt

sena-nana commented 1 year ago

更新后触发指令后台报coroutine raised StopIteration,机器人报获取session失败,请检查后台报错,麻烦大佬帮忙看看,谢谢大佬 日志.txt

你去重新clone,这个已经解决了(或者转换成了可读的报错)

MandarinDuck231 commented 1 year ago

真正的报错在上面,看是不是没有运行过编剧安装

图片 图片我的机器人用了你修改的会出现这种错误是为什么啊求告知道。。。

我已经经编剧安装过了,还是这样。。。。

你把一份完整的日志给我吧,感觉看着不全,这个报错太离谱了

12-13 20:08:30 [ERROR] extensive_plugin | playwright未安装,请先在shell中运行playwright install Traceback (most recent call last): File "/opt/soft/zhenxun_bot-main/bot.py", line 21, in nonebot.run() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/init.py", line 261, in run get_driver().run(*args, kwargs) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 170, in run uvicorn.run( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/uvicorn/main.py", line 463, in run server.run() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 146, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 196, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 668, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 635, in simple_run await handler( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 92, in call return await self.call(values) File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/init.py", line 60, in ai_chat msg = await chat_bot(**session[event]).get_chat_response(text) File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 89, in get_chat_response await self.refresh_session() File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 145, in refresh_session await self.get_cf_cookies()

File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 187, in get_cf_cookies browser = await p.firefox.launch( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/playwright/async_api/_generated.py", line 12809, in launch await self._impl_obj.launch( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/playwright/_impl/_browser_type.py", line 93, in launch Browser, from_channel(await self._channel.send("launch", params)) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 44, in send return await self._connection.wrap_api_call( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 419, in wrap_api_call return await cb() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 79, in inner_send result = next(iter(done)).result() playwright._impl._api_types.Error: Browser.enable): Browser closed. ==================== Browser output: ====================

/root/.cache/ms-playwright/firefox-1364/firefox/firefox -no-remote -headless -profile /tmp/playwright_firefoxdev_profile-TEpRV6 -juggler-pipe --disable-extensions --disable-application-cache --disable-gpu --disable-setuid-sandbox --disable-dev-shm-usage --incognito -silent pid=7200 [pid=7200][err] Running Nightly as root in a regular user's session is not supported. ($XDG_RUNTIME_DIR is /run/user/1000 which is owned by ubuntu.) [pid=7200] [pid=7200] starting temporary directories cleanup =========================== logs =========================== /root/.cache/ms-playwright/firefox-1364/firefox/firefox -no-remote -headless -profile /tmp/playwright_firefoxdev_profile-TEpRV6 -juggler-pipe --disable-extensions --disable-application-cache --disable-gpu --disable-setuid-sandbox --disable-dev-shm-usage --incognito -silent pid=7200 [pid=7200][err] Running Nightly as root in a regular user's session is not supported. ($XDG_RUNTIME_DIR is /run/user/1000 which is owned by ubuntu.) [pid=7200] [pid=7200] starting temporary directories cleanup ============================================================ 12-13 20:08:30 [ERROR] extensive_plugin | 刷新会话失败: HTTP403 Just a moment...

chat.openai.com

Checking if the site connection is secure

chat.openai.com needs to review the security of your connection before proceeding.

Traceback (most recent call last): File "/opt/soft/zhenxun_bot-main/bot.py", line 21, in nonebot.run() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/init.py", line 261, in run get_driver().run(*args, kwargs) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 170, in run uvicorn.run( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/uvicorn/main.py", line 463, in run server.run() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 146, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 196, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 668, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 635, in simple_run await handler( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 92, in call return await self.call(values) File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/init.py", line 60, in ai_chat msg = await chat_bot(**session[event]).get_chat_response(text) File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 89, in get_chat_response await self.refresh_session()

File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 145, in refresh_session await self.get_cf_cookies() File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 205, in get_cf_cookies ua = f"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/{browser.version}" UnboundLocalError: local variable 'browser' referenced before assignment 12-13 20:08:30 [SUCCESS] nonebot | ONEBOT V11 3133974598 | [message.group.normal]: Message -1945365186 from 1687457230@[群:948192110] "[CQ:image,file=d8d6488ed430cb363732ea274ff62a09.image,subType=1,url=https://gchat.qpic.cn/gchatpic_new/1687457230/948192110-3074210752-D8D6488ED430CB363732EA274FF62A09/0?term=3&amp;is_origin=0]" 12-13 20:08:30 [INFO] nonebot | Event will be handled by <Matcher from plugins.mute, type=message, priority=1, temp=False> 12-13 20:08:30 [INFO] nonebot | Event will be handled by <Matcher from plugins.black_word, type=message, priority=1, temp=False> 12-13 20:08:30 [INFO] nonebot | Event will be handled by <Matcher from extensive_plugin.zhenxun_plugin_intercept_withdraw-main, type=message, priority=1, temp=False> 12-13 20:08:30 [INFO] nonebot | Event will be handled by <Matcher from basic_plugins.chat_history.chat_message, type=message, priority=1, temp=False> 12-13 20:08:30 [INFO] nonebot | Event will be handled by <Matcher from plugins.parse_bilibili_json, type=message, priority=1, temp=False> 12-13 20:08:31 [INFO] nonebot | Matcher <Matcher from plugins.black_word, type=message, priority=1, temp=False> running complete {'time': 1670933310, 'self_id': 3133974598, 'post_type': 'message', 'sub_type': 'normal', 'user_id': 1687457230, 'message_type': 'group', 'message_id': -1945365186, 'message': [{'type': 'image', 'data': {'file': 'd8d6488ed430cb363732ea274ff62a09.image', 'subType': '1', 'url': 'https://gchat.qpic.cn/gchatpic_new/1687457230/948192110-3074210752-D8D6488ED430CB363732EA274FF62A09/0?term=3&is_origin=0'}}], 'original_message': [{'type': 'image', 'data': {'file': 'd8d6488ed430cb363732ea274ff62a09.image', 'subType': '1', 'url': 'https://gchat.qpic.cn/gchatpic_new/1687457230/948192110-3074210752-D8D6488ED430CB363732EA274FF62A09/0?term=3&is_origin=0'}}], 'raw_message': '[CQ:image,file=d8d6488ed430cb363732ea274ff62a09.image,subType=1,url=https://gchat.qpic.cn/gchatpic_new/1687457230/948192110-3074210752-D8D6488ED430CB363732EA274FF62A09/0?term=3&amp;is_origin=0]', 'font': 0, 'sender': {'user_id': 1687457230, 'nickname': '喵~', 'sex': 'unknown', 'age': 0, 'card': '', 'area': '', 'level': '', 'role': 'member', 'title': ''}, 'to_me': False, 'reply': None, 'group_id': 948192110, 'anonymous': None, 'message_seq': 69776} 12-13 20:08:31 [INFO] nonebot | Matcher <Matcher from extensive_plugin.zhenxun_plugin_intercept_withdraw-main, type=message, priority=1, temp=False> running complete 12-13 20:08:31 [INFO] nonebot | Matcher <Matcher from plugins.parse_bilibili_json, type=message, priority=1, temp=False> running complete 12-13 20:08:31 [INFO] nonebot | Matcher <Matcher from basic_plugins.chat_history.chat_message, type=message, priority=1, temp=False> running complete 12-13 20:08:31 [INFO] nonebot | Matcher <Matcher from plugins.mute, type=message, priority=1, temp=False> running complete 12-13 20:08:31 [ERROR] extensive_plugin | playwright未安装,请先在shell中运行playwright install Traceback (most recent call last): File "/opt/soft/zhenxun_bot-main/bot.py", line 21, in nonebot.run() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/init.py", line 261, in run get_driver().run(*args, kwargs) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 170, in run uvicorn.run( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/uvicorn/main.py", line 463, in run server.run() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 146, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 196, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 668, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 635, in simple_run await handler( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 92, in call return await self.call(values) File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/init.py", line 60, in ai_chat msg = await chat_bot(**session[event]).get_chat_response(text) File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 89, in get_chat_response await self.refresh_session() File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 145, in refresh_session await self.get_cf_cookies() File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 187, in get_cf_cookies browser = await p.firefox.launch( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/playwright/async_api/_generated.py", line 12809, in launch await self._impl_obj.launch( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/playwright/_impl/_browser_type.py", line 93, in launch Browser, from_channel(await self._channel.send("launch", params)) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 44, in send return await self._connection.wrap_api_call( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 419, in wrap_api_call return await cb() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/playwright/_impl/_connection.py", line 79, in inner_send result = next(iter(done)).result() playwright._impl._api_types.Error: Browser.enable): Browser closed. ==================== Browser output: ====================

/root/.cache/ms-playwright/firefox-1364/firefox/firefox -no-remote -headless -profile /tmp/playwright_firefoxdev_profile-znoH99 -juggler-pipe --disable-extensions --disable-application-cache --disable-gpu --disable-setuid-sandbox --disable-dev-shm-usage --incognito -silent pid=7387 [pid=7387][err] Running Nightly as root in a regular user's session is not supported. ($XDG_RUNTIME_DIR is /run/user/1000 which is owned by ubuntu.) [pid=7387] [pid=7387] starting temporary directories cleanup =========================== logs =========================== /root/.cache/ms-playwright/firefox-1364/firefox/firefox -no-remote -headless -profile /tmp/playwright_firefoxdev_profile-znoH99 -juggler-pipe --disable-extensions --disable-application-cache --disable-gpu --disable-setuid-sandbox --disable-dev-shm-usage --incognito -silent pid=7387 [pid=7387][err] Running Nightly as root in a regular user's session is not supported. ($XDG_RUNTIME_DIR is /run/user/1000 which is owned by ubuntu.) [pid=7387] [pid=7387] starting temporary directories cleanup ============================================================ 12-13 20:08:31 [ERROR] extensive_plugin | 刷新会话失败: HTTP403 Just a moment...

chat.openai.com

Checking if the site connection is secure

chat.openai.com needs to review the security of your connection before proceeding.

Traceback (most recent call last): File "/opt/soft/zhenxun_bot-main/bot.py", line 21, in nonebot.run() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/init.py", line 261, in run get_driver().run(*args, kwargs) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/drivers/fastapi.py", line 170, in run uvicorn.run( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/uvicorn/main.py", line 463, in run server.run() File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 146, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/message.py", line 196, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 668, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 635, in simple_run await handler( File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-W3xnIl2g-py3.9/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 92, in call return await self.call(values) File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/init.py", line 60, in ai_chat msg = await chat_bot(**session[event]).get_chat_response(text) File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 89, in get_chat_response await self.refresh_session()

File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 145, in refresh_session await self.get_cf_cookies() File "/opt/soft/zhenxun_bot-main/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 205, in get_cf_cookies ua = f"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/{browser.version}" UnboundLocalError: local variable 'browser' referenced before assignment 看了一眼日志可能确实是playwright的问题可是我依赖有playwright image 在shell也运行了playwright install但是没有反应?是我环境的问题吗。。。 image

zhouwenze1 commented 1 year ago

在该pr中得到解决(大概),如果有使用该pr的版本还是出现该问题的可以及时联系我排查原因 #52

借地方问一下,这个问题解决了但是请求会超时是官方的问题不

timeout调大点试试

我调了之后还是会超时,在我windows的电脑上没有事,但在ubuntu上就会显示超时, https://pastebin.ubuntu.com/p/F3qQfbVGWH/ 大佬能不能帮忙看看

sena-nana commented 1 year ago

在shell也运行了playwright install但是没有反应?是我环境的问题吗。。。 image

有可能。。确实不太清楚你这个怎么回事,可以百度看看playwright有没有别人遇到过这种问题

sena-nana commented 1 year ago

在该pr中得到解决(大概),如果有使用该pr的版本还是出现该问题的可以及时联系我排查原因 #52

借地方问一下,这个问题解决了但是请求会超时是官方的问题不

timeout调大点试试

我调了之后还是会超时,在我windows的电脑上没有事,但在ubuntu上就会显示超时, https://pastebin.ubuntu.com/p/F3qQfbVGWH/ 大佬能不能帮忙看看

看了,确实是超时( 如果调大timeout没用的话我也不清楚了

kasdals commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

在shell也运行了playwright install但是没有反应?是我环境的问题吗。。。 image

有可能。。确实不太清楚你这个怎么回事,可以百度看看playwright有没有别人遇到过这种问题

大佬,这个好像是路径问题playwright._impl._api_types.Error: Executable doesn't exist at C:\Users\Administrator\AppData\Local\ms-playwright\firefox-1357\firefox\firefox.exe 他索取到的是firefox-1357这个文件夹,但ms-playwright默认文件夹名字不是这个,所以我把默认文件夹名改成firefox-1357就解决了

MandarinDuck231 commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

在shell也运行了playwright install但是没有反应?是我环境的问题吗。。。 image

有可能。。确实不太清楚你这个怎么回事,可以百度看看playwright有没有别人遇到过这种问题

大佬,这个好像是路径问题playwright._impl._api_types.Error: Executable doesn't exist at C:\Users\Administrator\AppData\Local\ms-playwright\firefox-1357\firefox\firefox.exe 他索取到的是firefox-1357这个文件夹,但ms-playwright默认文件夹名字不是这个,所以我把默认文件夹名改成firefox-1357就解决了

是吗你是怎么修改的我也想试一下看看

kasdals commented 1 year ago

image playwright._impl._api_types.Error: Executable doesn't exist at C:\Users\Administrator\AppData\Local\ms-playwright\firefox-1357\firefox\firefox.exe 我是把它改成和报错代码一样的名字

AbCooly commented 1 year ago

你们clone我的fork试试,现在作者这边还没合并绕过cf的代码 现在我也正在解决这个报错的问题

在shell也运行了playwright install但是没有反应?是我环境的问题吗。。。 image

有可能。。确实不太清楚你这个怎么回事,可以百度看看playwright有没有别人遇到过这种问题

大佬,这个好像是路径问题playwright._impl._api_types.Error: Executable doesn't exist at C:\Users\Administrator\AppData\Local\ms-playwright\firefox-1357\firefox\firefox.exe 他索取到的是firefox-1357这个文件夹,但ms-playwright默认文件夹名字不是这个,所以我把默认文件夹名改成firefox-1357就解决了

是吗你是怎么修改的我也想试一下看看

我运行的时候用 sudo nb run 就行了

Prometheus-first commented 1 year ago

在该pr中得到解决(大概),如果有使用该pr的版本还是出现该问题的可以及时联系我排查原因 #52

出新问题了,一直提示token失效,请重新设置token image token我换了三个号的,全都是失效 但是控制台没有给报错信息,下面txt是运行时候的日志 1.txt

sena-nana commented 1 year ago

在该pr中得到解决(大概),如果有使用该pr的版本还是出现该问题的可以及时联系我排查原因 #52

出新问题了,一直提示token失效,请重新设置token image token我换了三个号的,全都是失效 但是控制台没有给报错信息,下面txt是运行时候的日志 1.txt

你下的哪一个分支,这是另外一个bug,没有在patxh_playwright分支里解决,你clone master分支,或者等作者发新包吧,已经合并了