CM-Edelweiss / nonebot-plugin-pmhelp

提取于LittlePaimon的帮助插件
GNU Affero General Public License v3.0
6 stars 1 forks source link

运行nb的时候会报错,发送帮助没有反应 #8

Open hakureireimusama opened 1 week ago

hakureireimusama commented 1 week ago

运行nb的时候会报错如下,向机器人发送帮助没有反应,webui界面可以登录和修改

11-21 16:44:42 [ERROR] nonebot_plugin_picstatus | Error when getting background, fallback to local Traceback (most recent call last): File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpx_transports\default.py", line 60, in map_httpcore_exceptions yield File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpx_transports\default.py", line 353, in handle_async_request resp = await self._pool.handle_async_request(req) File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpcore_async\connection_pool.py", line 253, in handle_async_request raise exc File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpcore_async\connection_pool.py", line 237, in handle_async_request response = await connection.handle_async_request(request) File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpcore_async\http_proxy.py", line 316, in handle_async_request return await self._connection.handle_async_request(request) File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpcore_async\http11.py", line 112, in handle_async_request raise exc File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpcore_async\http11.py", line 91, in handle_async_request ) = await self._receive_response_headers(**kwargs) File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpcore_async\http11.py", line 155, in _receive_response_headers event = await self._receive_event(timeout=timeout) File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpcore_async\http11.py", line 205, in _receive_event raise RemoteProtocolError(msg) httpcore.RemoteProtocolError: Server disconnected without sending a response.

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

Traceback (most recent call last): File "", line 17, in File "C:\bot\Haruka-Bot.venv\lib\site-packages\nonebot__init__.py", line 335, in run get_driver().run(*args, *kwargs) File "C:\bot\Haruka-Bot.venv\lib\site-packages\nonebot\drivers\fastapi.py", line 186, in run uvicorn.run( File "C:\bot\Haruka-Bot.venv\lib\site-packages\uvicorn\main.py", line 577, in run server.run() File "C:\bot\Haruka-Bot.venv\lib\site-packages\uvicorn\server.py", line 65, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete self.run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever super().run_forever() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 603, in run_forever self._run_once() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1909, in _run_once handle._run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, self._args) File "C:\bot\Haruka-Bot.venv\lib\site-packages\nonebot_plugin_picstatus\bg_provider.py", line 157, in task_func bg = await fetch_bg()

File "C:\bot\Haruka-Bot.venv\lib\site-packages\nonebot_plugin_picstatus\bg_provider.py", line 121, in fetch_bg return await registered_bg_providers[config.ps_bg_provider]() File "C:\bot\Haruka-Bot.venv\lib\site-packages\nonebot_plugin_picstatus\bg_provider.py", line 68, in loli (await cli.get("https://www.loliapi.com/acg/pe/")).raise_for_status(), File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpx_client.py", line 1757, in get return await self.request( File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpx_client.py", line 1533, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects) File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpx_client.py", line 1620, in send response = await self._send_handling_auth( File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpx_client.py", line 1648, in _send_handling_auth response = await self._send_handling_redirects( File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpx_client.py", line 1685, in _send_handling_redirects response = await self._send_single_request(request) File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpx_client.py", line 1722, in _send_single_request response = await transport.handle_async_request(request) File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpx_transports\default.py", line 352, in handle_async_request with map_httpcore_exceptions(): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 153, in exit self.gen.throw(typ, value, traceback) File "C:\bot\Haruka-Bot.venv\lib\site-packages\httpx_transports\default.py", line 77, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.RemoteProtocolError: Server disconnected without sending a response. 11-21 16:44:44 [SUCCESS] nonebot | OneBot V11 2406306534 | [message.private.friend]: Message 1218687659 from 1317645806 '帮助'

hakureireimusama commented 1 week ago

配置文件是这样的

DRIVER=~fastapi+~httpx+~websockets HOST=192.168.0.254 # ip PORT=10244 # 端口 nickname=["小小梦"] # bot昵称 SECRET= ACCESS_TOKEN= SUPERUSERS=["……"] # 超级用户 COMMAND_START=[""] # 命令前缀

###################### 帮助 ######################

配置项 必填 默认值 说明

img_cache=True #否 True 图片资源缓存开关 pm_name=小小梦帮助 #否 NoneBot帮助 帮助大标题 pm_version=1.0.0 #否 11.45.14 帮助显示的版本号 pm_text=Hi~ #否 自定义文本 自定义文本

m_message #否 True 被限流是否提醒

pm_plugin=2 #否 1 管理插件文件的位置(1为统一目录,2为机器人目录,3为自定义目录)

pm_path #否 无 pm_plugin为3时的目录(无需引号)

pm_enable_web=True #否 True 后台管理开关 pm_username=Administrator #否 pmhelp 后台管理用户名 pm_password=774084806 #否 admin 后台管理密码

pm_secret_key #否 ... 后台管理token密钥

CM-Edelweiss commented 1 week ago

报错是nonebot_plugin_picstatus插件网络连接失败抛出的 httpx.RemoteProtocolError:服务器已断开连接,但未发送响应。

帮助指令无限可以有优先级高于本插件的指令响应并阻断了,可以试试pm help看看有没有反应

hakureireimusama commented 1 week ago

117aee0534479377b9ac2f8f1224aeff 还是不行,今天更新了新版本的帮助插件才出现的问题

hakureireimusama commented 1 week ago

更新插件的时候还会出现如下警告,对插件运行有影响吗

WARNING: Ignoring invalid distribution -onebot-plugin-zxreport (c:\bot\haruka-bot.venv\lib\site-packages) ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. nonebot-plugin-pmhelp 1.3.9 requires httpx<0.24.0,>=0.23.0, but you have httpx 0.27.2 which is incompatible. Successfully installed httpcore-1.0.7 httpx-0.27.2

CM-Edelweiss commented 1 week ago

更新插件的时候还会出现如下警告,对插件运行有影响吗

WARNING: Ignoring invalid distribution -onebot-plugin-zxreport (c:\bot\haruka-bot.venv\lib\site-packages) ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. nonebot-plugin-pmhelp 1.3.9 requires httpx<0.24.0,>=0.23.0, but you have httpx 0.27.2 which is incompatible. Successfully installed httpcore-1.0.7 httpx-0.27.2

没有影响

CM-Edelweiss commented 1 week ago

117aee0534479377b9ac2f8f1224aeff 还是不行,今天更新了新版本的帮助插件才出现的问题

删除数据库重新生成试试 上次更新改了数据库结构需要重新生成

hakureireimusama commented 1 week ago

117aee0534479377b9ac2f8f1224aeff还是不行,今天更新了新版本的帮助插件才出现的问题

删除数据库重新生成试试 上次更新改了数据库结构需要重新生成

我删除了下面这些所有文件重启了bot,还是不行 C:\Users\Administrator\AppData\Local\nonebot2\Cache\nonebot_plugin_pmhelp 机器人目录里两个pm_开头的文件夹

CM-Edelweiss commented 1 week ago

进入debug模式看看 env.*填入LOG_LEVEL=DEBUG

CM-Edelweiss commented 1 week ago

已经找到问题,晚上修

CM-Edelweiss commented 1 week ago

已修 镜像站可能需要时间同步