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

反向WebSocket异常断开 #9

Closed
ghost opened this issue Dec 20, 2023 · 7 comments
Closed

反向WebSocket异常断开 #9

ghost opened this issue Dec 20, 2023 · 7 comments

Comments

@ghost
Copy link

ghost commented Dec 20, 2023

问题描述

使用OpenShamrock的反向WebSocket连接Overflow,会出现突然断开且两边均无异常报错的情况,过一会又会自动连上

复现

一开始Overflow可以正常连接OpenShamrock,可以正常收发消息,然后突然就断开了,过一会又突然自己连上了

不知道该怎么复现,但已经遇到三回了,平均一天一回吧

Overflow 版本

1bf69de

其他组件版本

OpenShamrock 1.0.7.r204.34eccda

系统日志

2023-12-20 18:47:06 W/Onebot: Request failed: [send_group_msg, echo=345] Timed out waiting for 10000 ms
2023-12-20 18:48:12 I/Onebot: ▌ 反向 WebSocket 客户端连接因 The connection was closed because the other endpoint did not respond with a pong in time. For more information check: https://github.com/TooTallNate/Java-WebSocket/wiki/Lost-connection-detection 已关闭

【中间省略了大量由mirai-api-http主动发出的消息,虽然`logs`里的日志有这些发送记录,但是`logs/onebot`下的日志并没有这些发送记录,OpenShamrock端也并没有收到】

2023-12-20 20:17:58 I/Onebot: ▌ 反向 WebSocket 客户端 /********:**** 已连接 ┈━═☆

网络日志

No response

补充信息

附上OpenShamrock端的日志

屏幕截图 2023-12-20 202320

【中间省略了一些OpenShamrock自身接收到的QQ消息,非Overflow发送过去的】

6bdbac093ac9e79b95ee42046f85aa2f

@MrXiaoM
Copy link
Owner

MrXiaoM commented Dec 20, 2023

信息不足,无解

目前的信息只能判断出,你的网络连接(手机或者服务器)可能有问题

@ghost
Copy link
Author

ghost commented Dec 20, 2023

不排除网络连接有问题的可能

不过,有没有可能和OpenShamrock的这个问题 whitechi73/OpenShamrock#157 有关呢?

@ghost
Copy link
Author

ghost commented Dec 20, 2023

而且有一点很奇怪,Overflow是在18:48:12显示WebSocket断开连接的,但是OpenShamrock直到20:17:53才显示WebSocket断开连接,而这中间一段时间也确实没有消息从Overflow成功发送到OpenShamrock。

按理来说,Overflow和OpenShamrock应该在几乎同一时间显示断开连接才对?

@ghost
Copy link
Author

ghost commented Dec 26, 2023

报告一则很奇怪的异常日志:

2023-12-26 00:40:45 I/Onebot: ▌ 反向 WebSocket 客户端连接因  已关闭
2023-12-26 00:40:46 I/Onebot: ▌ 反向 WebSocket 客户端 /**********:**** 已连接 ┈━═☆
2023-12-26 01:36:45 I/Onebot: ▌ 反向 WebSocket 客户端连接因  已关闭
2023-12-26 01:36:46 I/Onebot: ▌ 反向 WebSocket 客户端 /**********:**** 已连接 ┈━═☆
2023-12-26 01:36:47 I/Onebot: ▌ 反向 WebSocket 客户端连接因 Overflow 不支持多客户端连接 已关闭
2023-12-26 01:36:51 I/Onebot: ▌ 反向 WebSocket 客户端连接因  已关闭
2023-12-26 01:36:52 I/Onebot: ▌ 反向 WebSocket 客户端 /**********:**** 已连接 ┈━═☆

说它奇怪是因为我很确定在这个时间没有使用多客户端连接Overflow,也没有在OpenShamrock上登陆多个QQ号,但是却报了“不支持多客户端连接”的错误

@ghost
Copy link
Author

ghost commented Jan 17, 2024

尝试了10537f2构建,看了一下那个commit应该是支持断连后的自动重连才对,但是我这里在logs/onebot下看到了如下日志:

2024-01-15 18:31:55 I/Onebot: ▌ 反向 WebSocket 客户端连接因 The connection was closed because the other endpoint did not respond with a pong in time. For more information check: https://github.com/TooTallNate/Java-WebSocket/wiki/Lost-connection-detection 已关闭 (1006)
2024-01-15 19:53:31 I/Onebot: ▌ 反向 WebSocket 客户端 /**********:**** 已连接 ┈━═☆

断连之后过了一个多小时才重新连上,而且并没有那个commit中新增的一些重连消息日志

@MrXiaoM
Copy link
Owner

MrXiaoM commented Jan 17, 2024

尝试了10537f2构建,看了一下那个commit应该是支持断连后的自动重连才对,但是我这里在logs/onebot下看到了如下日志:

2024-01-15 18:31:55 I/Onebot: ▌ 反向 WebSocket 客户端连接因 The connection was closed because the other endpoint did not respond with a pong in time. For more information check: https://github.com/TooTallNate/Java-WebSocket/wiki/Lost-connection-detection 已关闭 (1006)
2024-01-15 19:53:31 I/Onebot: ▌ 反向 WebSocket 客户端 /**********:**** 已连接 ┈━═☆

断连之后过了一个多小时才重新连上,而且并没有那个commit中新增的一些重连消息日志

反向ws不支持自动重连,因为Overflow才是服务端,应该要onebot端连接Overflow才是

@ghost
Copy link
Author

ghost commented Feb 17, 2024

根据我这里的实际部署,overflow和shamrock之间的通信(反向WebSocket)貌似已经很久没有长时间断开过了

虽然不清楚具体原因,但貌似是因为部署shamrock的设备上安装了ToDesk,并作为可被连接的服务端
大概是因为该设备原本的网络环境容易导致断线,但是ToDesk的存在使得该设备始终保持活跃的网络环境?

@ghost ghost closed this as completed Feb 17, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant