17TheWord / nonebot-plugin-mcqq

基于NoneBot的与Minecraft Server互通消息的插件
MIT License
92 stars 5 forks source link

【错误反馈】服务器发送到群第一条消息之后连接断开 #14

Closed Cloudwhile closed 1 year ago

Cloudwhile commented 1 year ago

运行环境

Windows Server 2022

Python版本

python 3.8

插件版本

nonebot-plugin-mcqq

插件版本号

V0.1.1

错误描述

进入服务器后成功发了信息到群聊,但是只能发这一条,之后就显示MC_QQ断开连接。

报错日志(如果有)

10-02 21:53:38 [ERROR] nonebot | Running matcher <Matcher from nonebot_plugin_mcqq, type=message, priority=5, temp=False> failed.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files\python\lib\multiprocessing\spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "c:\program files\python\lib\multiprocessing\spawn.py", line 129, in _main
    return self._bootstrap(parent_sentinel)
  File "c:\program files\python\lib\multiprocessing\process.py", line 315, in _bootstrap
    self.run()
  File "c:\program files\python\lib\multiprocessing\process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "c:\program files\python\lib\site-packages\uvicorn\_subprocess.py", line 76, in subprocess_started
    target(sockets=sockets)
  File "c:\program files\python\lib\site-packages\uvicorn\server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "c:\program files\python\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "c:\program files\python\lib\asyncio\base_events.py", line 603, in run_until_complete
    self.run_forever()
  File "c:\program files\python\lib\asyncio\base_events.py", line 570, in run_forever
    self._run_once()
  File "c:\program files\python\lib\asyncio\base_events.py", line 1859, in _run_once
    handle._run()
  File "c:\program files\python\lib\asyncio\events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "c:\program files\python\lib\site-packages\nonebot\message.py", line 146, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "c:\program files\python\lib\site-packages\nonebot\message.py", line 196, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "c:\program files\python\lib\site-packages\nonebot\internal\matcher.py", line 672, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "c:\program files\python\lib\site-packages\nonebot\internal\matcher.py", line 639, in simple_run
    await handler(
  File "c:\program files\python\lib\site-packages\nonebot\dependencies\__init__.py", line 92, in __call__
    return await self.call(**values)
  File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\__init__.py", line 27, in handle_first_receive
    await send_msg_to_mc(bot=bot, event=event)
  File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\data_source.py", line 53, in send_msg_to_mc
    await websocket.send(msgJson)
  File "c:\program files\python\lib\site-packages\websockets\legacy\protocol.py", line 620, in send
    await self.ensure_open()
  File "c:\program files\python\lib\site-packages\websockets\legacy\protocol.py", line 921, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedOK: sent 1000 (OK); then received 1000 (OK)
17TheWord commented 1 year ago

能否提供复现情况?(如配置信息等更详细的内容) 我无法复现问题

Cloudwhile commented 1 year ago

请问你需要什么配置信息和详细的内容

Cloudwhile commented 1 year ago

10-03 11:39:43 [ERROR] nonebot | Error when running WebSocketConnection hook. Running cancelled! Traceback (most recent call last): File "", line 1, in File "c:\program files\python\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "c:\program files\python\lib\multiprocessing\spawn.py", line 129, in _main return self._bootstrap(parent_sentinel) File "c:\program files\python\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "c:\program files\python\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, self._kwargs) File "c:\program files\python\lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "c:\program files\python\lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "c:\program files\python\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "c:\program files\python\lib\asyncio\base_events.py", line 603, in run_until_complete self.run_forever() File "c:\program files\python\lib\asyncio\base_events.py", line 570, in run_forever self._run_once() File "c:\program files\python\lib\asyncio\base_events.py", line 1859, in _run_once handle._run() File "c:\program files\python\lib\asyncio\events.py", line 81, in _run self._context.run(self._callback, self._args) File "c:\program files\python\lib\site-packages\nonebot\internal\driver\driver.py", line 140, in _run_hook await asyncio.gather(coros) File "c:\program files\python\lib\site-packages\nonebot\utils.py", line 138, in run_coro_with_catch return await coro File "c:\program files\python\lib\site-packages\nonebot\dependencies__init.py", line 92, in call__ return await self.call(values) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq__init__.py", line 17, in on_start await on_connect(bot=bot) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\data_source.py", line 43, in on_connect await send_msg_to_qq(bot=bot, recv_msg=recv_msg) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\utils.py", line 14, in send_msg_to_qq await bot.call_api("send_guild_channel_msg", guild_id=per_guild[0], IndexError: list index out of range

17TheWord commented 1 year ago

这是重启过bot之后么? 重启之后还是只发送一条消息就断开连接么?

Cloudwhile commented 1 year ago

Cloudwhile commented 1 year ago

盲猜是频道问题?

17TheWord commented 1 year ago

10-03 11:39:43 [ERROR] nonebot | Error when running WebSocketConnection hook. Running cancelled! Traceback (most recent call last): File "", line 1, in File "c:\program files\python\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "c:\program files\python\lib\multiprocessing\spawn.py", line 129, in _main return self._bootstrap(parent_sentinel) File "c:\program files\python\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "c:\program files\python\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, self._kwargs) File "c:\program files\python\lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "c:\program files\python\lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "c:\program files\python\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "c:\program files\python\lib\asyncio\base_events.py", line 603, in run_until_complete self.run_forever() File "c:\program files\python\lib\asyncio\base_events.py", line 570, in run_forever self._run_once() File "c:\program files\python\lib\asyncio\base_events.py", line 1859, in _run_once handle._run() File "c:\program files\python\lib\asyncio\events.py", line 81, in _run self._context.run(self._callback, self._args) File "c:\program files\python\lib\site-packages\nonebot\internal\driver\driver.py", line 140, in _run_hook await asyncio.gather(coros) File "c:\program files\python\lib\site-packages\nonebot\utils.py", line 138, in run_coro_with_catch return await coro File "c:\program files\python\lib\site-packages\nonebot\dependencies__init.py", line 92, in call__ return await self.call(values) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq__init__.py", line 17, in on_start await on_connect(bot=bot) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\data_source.py", line 43, in on_connect await send_msg_to_qq(bot=bot, recv_msg=recv_msg) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\utils.py", line 14, in send_msg_to_qq await bot.call_api("send_guild_channel_msg", guild_id=per_guild[0], IndexError: list index out of range

如果不需要频道,把频道的配置删掉 或将频道配置从[[]]改为[]

17TheWord commented 1 year ago

第一个问题我会尝试在发送时加入断线重连

Cloudwhile commented 1 year ago

【BuliRua】444,发送的消息有点问题

Cloudwhile commented 1 year ago

image

17TheWord commented 1 year ago

【BuliRua】444,发送的消息有点问题

这个日志截全一点,我看不出来这是哪里的问题

Cloudwhile commented 1 year ago

这是q群里的发送记录

17TheWord commented 1 year ago

image

还是不能够理解 这是什么情况下出现的? 服务端发送到群还是群发送到bot? 日志前后有无内容?

Cloudwhile commented 1 year ago

image image

17TheWord commented 1 year ago

好的 后续会去修复(虽然我也不知道是什么问题)

Cloudwhile commented 1 year ago

这是Go-cqhttp中的信息 发送到群*****的消息: 【[2022-10-03 11:51:51] [WARNING]: 处理 WebSocket 请求时出现错误: websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header [2022-10-03 11:52:18] [WARNING]: 处理 WebSocket 请求时出现错误: websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header

Cloudwhile commented 1 year ago

二创的插件也有问题(不知道为什么我的问题特别多

Cloudwhile commented 1 year ago

10-03 12:35:37 [ERROR] nonebot | Error when running WebSocketConnection hook. Running cancelled! Traceback (most recent call last): File "", line 1, in File "c:\program files\python\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "c:\program files\python\lib\multiprocessing\spawn.py", line 129, in _main return self._bootstrap(parent_sentinel) File "c:\program files\python\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "c:\program files\python\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, *self._kwargs) File "c:\program files\python\lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "c:\program files\python\lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "c:\program files\python\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "c:\program files\python\lib\asyncio\base_events.py", line 603, in run_until_complete self.run_forever() File "c:\program files\python\lib\asyncio\base_events.py", line 570, in run_forever self._run_once() File "c:\program files\python\lib\asyncio\base_events.py", line 1859, in _run_once handle._run() File "c:\program files\python\lib\asyncio\events.py", line 81, in _run self._context.run(self._callback, self._args)

File "c:\program files\python\lib\site-packages\nonebot\internal\driver\driver.py", line 140, in _run_hook await asyncio.gather(*coros) File "c:\program files\python\lib\site-packages\nonebot\utils.py", line 138, in run_coro_with_catch return await coro File "c:\program files\python\lib\site-packages\nonebot\dependencies__init.py", line 92, in call return await self.call(**values) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\init__.py", line 17, in on_start await on_connect(bot=bot) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\data_source.py", line 43, in on_connect await send_msg_to_qq(bot=bot, recv_msg=recv_msg) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\utils.py", line 14, in send_msg_to_qq await bot.call_api("send_guild_channel_msg", guild_id=per_guild[0], IndexError: list index out of range image image image

17TheWord commented 1 year ago

10-03 12:35:37 [ERROR] nonebot | Error when running WebSocketConnection hook. Running cancelled! Traceback (most recent call last): File "", line 1, in File "c:\program files\python\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "c:\program files\python\lib\multiprocessing\spawn.py", line 129, in _main return self._bootstrap(parent_sentinel) File "c:\program files\python\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "c:\program files\python\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, *self._kwargs) File "c:\program files\python\lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "c:\program files\python\lib\site-packages\uvicorn\server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "c:\program files\python\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "c:\program files\python\lib\asyncio\base_events.py", line 603, in run_until_complete self.run_forever() File "c:\program files\python\lib\asyncio\base_events.py", line 570, in run_forever self._run_once() File "c:\program files\python\lib\asyncio\base_events.py", line 1859, in _run_once handle._run() File "c:\program files\python\lib\asyncio\events.py", line 81, in _run self._context.run(self._callback, self._args)

File "c:\program files\python\lib\site-packages\nonebot\internal\driver\driver.py", line 140, in _run_hook await asyncio.gather(*coros) File "c:\program files\python\lib\site-packages\nonebot\utils.py", line 138, in run_coro_with_catch return await coro File "c:\program files\python\lib\site-packages\nonebot\dependencies__init.py", line 92, in call return await self.call(**values) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\init__.py", line 17, in on_start await on_connect(bot=bot) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\data_source.py", line 43, in on_connect await send_msg_to_qq(bot=bot, recv_msg=recv_msg) File "c:\program files\python\lib\site-packages\nonebot_plugin_mcqq\utils.py", line 14, in send_msg_to_qq await bot.call_api("send_guild_channel_msg", guild_id=per_guild[0], IndexError: list index out of range image image image

二创的话应该去二创提交issue

Cloudwhile commented 1 year ago

这个不是二创的

17TheWord commented 1 year ago

这个不是二创的

我的插件并没有填写日志路径的配置

可以的话,我晚上可以远程帮忙看看

Cloudwhile commented 1 year ago

加个qq?

Cloudwhile commented 1 year ago

image 上面这个是你插件的配置,下面是别的

17TheWord commented 1 year ago

加个qq?

你发吧

Cloudwhile commented 1 year ago

3245567560

---原始邮件--- 发件人: @.> 发送时间: 2022年10月3日(周一) 中午1:55 收件人: @.>; 抄送: @.**@.>; 主题: Re: [17TheWord/nonebot-plugin-mcqq] 【错误反馈】服务器发送到群第一条消息之后连接断开 (Issue #14)

加个qq?

你发吧

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>