Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: 回复超时,cf cookies获取失败,弹出来的弹窗没有人机验证按钮 #139

Open
3 of 4 tasks
modongfox opened this issue Apr 1, 2023 · 0 comments
Open
3 of 4 tasks
Labels
bug Something isn't working

Comments

@modongfox
Copy link

报告清单

  • 我已仔细阅读并了解上述注意事项。
  • 我已使用最新版本测试过,确认问题依旧存在。
  • 我确定在 GitHub Issues 中没有相同或相似的问题。
  • 我有足够的时间和能力,愿意为此提交 PR 来修复问题。

影响版本

3fc4a14

问题描述

在腾讯云服务器(Ubuntu20.04)上env中配置CHATGPT_SESSION_TOKEN登录,加载插件成功后,在两个小时候,发送任意消息,后台均报错显示cf cookies获取失败,尝试更新session-token仍然出现同样bug。于是关闭服务器在本地计算机(Windows11)重复配置并启动后报cf cookies获取失败。将headless改为False后仍然报错。问题主要是两点:
1.第一次打开时更新后的按键名称也没法解决初次打开的弹窗,手动点掉后卡在输入页面,并没有将从QQ获取的消息输入文本框。
2.第二次及以后打开时浏览器上不再显示人机验证按钮,只剩logo。

复现步骤

使用平台:Windows11
1.env中配置使用CHATGPT_SESSION_TOKEN等配置项配置完全
2.发送任意消息,后台显示cf cookies获取失败
3.将headless改为False,查看页面
4.浏览器只剩logo,不再能点击

预期行为

正常回复消息,正常打开页面并继续自动化进程

实际行为

卡在进入输入页面前,或者进入输入页面也不会主动点击输入框,得手动指定已有的对话框。处于左上角虚线“New Chat”的页面下是无法输入的。

日志信息

04-01 20:12:04 [ERROR] nonebot_plugin_chatgpt | cf cookies获取失败
04-01 20:12:22 [ERROR] nonebot_plugin_chatgpt | ChatGPT request failed: TimeoutError: Timeout 30000ms exceeded while waiting for event "response"
=========================== logs ===========================
waiting for response https://chat.openai.com/backend-api/conversation

Traceback (most recent call last):
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_chatgpt\chatgpt.py", line 159, in get_chat_response
await textarea.fill(prompt)
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright\async_api_generated.py", line 15203, in fill
await self._impl_obj.fill(
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_locator.py", line 198, in fill
return await self._frame.fill(self._selector, strict=True, params)
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_frame.py", line 528, in fill
await self._channel.send("fill", locals_to_params(locals()))
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_connection.py", line 44, in send
return await self._connection.wrap_api_call(
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_connection.py", line 419, in wrap_api_call
return await cb()
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_connection.py", line 79, in inner_send
result = next(iter(done)).result()
playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for locator("textarea")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\multiprocessing\spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, self._kwargs)
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_reboot\reloader.py", line 27, in _run
nb_run(*args, kwargs)
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_init
.py", line 273, in run
get_driver().run(*args, kwargs)
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\drivers\fastapi.py", line 172, in run
uvicorn.run(
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\main.py", line 569, in run
server.run()
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 633, in run_until_complete
self.run_forever()
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
self._run_once()
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1896, in _run_once
handle._run()
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 142, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\message.py", line 188, in run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "C:\Users*\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher\matcher.py", line 727, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\internal\matcher\matcher.py", line 702, in simple_run
await handler(
File "C:\Users***\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot\dependencies_init
.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)

File "C:\Users*\AppData\Local\Programs\Python\Python310\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*\AppData\Local\Programs\Python\Python310\lib\site-packages\nonebot_plugin_chatgpt\chatgpt.py", line 151, in get_chat_response
async with page.expect_response(
File "C:\Users*
\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_async_base.py", line 53, in aexit
await self._event.value
File "C:\Users***\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_async_base.py", line 34, in value
return mapping.from_maybe_impl(await self._future)
playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded while waiting for event "response"
=========================== logs ===========================
waiting for response https://chat.openai.com/backend-api/conversation
============================================================

额外补充

No response

@modongfox modongfox added the bug Something isn't working label Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant