mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #5921] [Bug]: 某个客户端节点日期到期后,其余未到期的客户端节点使用vless xhttp reality会链接重置,只能重启X-ray才能用 #4106
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4106
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @1649861646 on GitHub (Jul 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5921
Describe the bug
[Bug]: 某个客户端节点日期到期后,其余未到期的客户端节点使用vless xhttp reality会链接重置,只能重启X-ray才行
How to reproduce the problem
添加一个新客户端,选择vless xhttp reality节点,设置个3分钟到期,到期后,就算是其他未到期的客户端使用vless xhttp reality这个节点也会出现链接重置,只能重启解决,ss协议不受影响
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.5.0
Xray-core version
26.6.27
How did you install 3x-ui?
install.sh script
Operating system
Debian 13
Which parts of the panel are affected?
Other
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@1649861646 commented on GitHub (Jul 13, 2026):
12:24:01
2026/07/13
ERROR
XRAY: transport/internet/splithttp: failed to serve HTTP for XHTTP > accept tcp [::]:443: use of closed network connection
12:20:32
2026/07/13
WARNING
X-UI: [POST /x-ui/panel/api/clients/update/oouez7y5ko handler=controller.(*ClientController).update client.go:169] Something went wrong Failed: record not found
12:15:02
2026/07/13
ERROR
XRAY: transport/internet/splithttp: failed to serve HTTP for XHTTP > accept tcp [::]:443: use of closed network connection
@github-actions[bot] commented on GitHub (Jul 13, 2026):
Title: 客户端到期自动禁用后,同一个 vless+xhttp+reality inbound 上其他在线客户端的连接被重置
Severity: High
Category: Reliability
Why this matters:
客户端到期后面板的处理路径是"就地摘除该客户端",设计上不应该影响同一 inbound 下其它客户端。完整链路(均已在源码中确认):
internal/web/service/inbound_disable.go第 57-70 行:expiry_time > 0 AND expiry_time <= now命中后,disableInvalidClients把该 client 标记为enable=false。internal/web/service/inbound_traffic.go第 54-67 行:AddTraffic检测到有 client 被禁用后返回clientsDisabled=true。internal/web/job/xray_traffic_job.go第 55-66 行:只要面板设置"客户端自动禁用后重启 Xray"保持默认开启(internal/web/service/setting.go第 111 行默认值true),就会立即调用XrayService.RestartXray(false)。internal/web/service/xray.go第 163-166 行:重新生成配置时,被禁用的 client 会整个从该 inbound 的settings.clients中剔除,其余 client 原样保留。internal/web/service/xray.go第 985-1098 行:RestartXray(false)并不直接重启进程,而是先调用tryHotApply,通过 Xray 的 gRPC HandlerService 只下发"增量"操作(例如只删除过期的那一个 user),使其它连接不受影响;只有当internal/xray/hot_diff.go的ComputeHotDiff判定这次变更"无法通过 API 增量应用"时,才会回退成更重的操作。项目自己的架构文档docs/architecture.md明确把"不该重启却重启、导致连接被杀"列为hot_diff.go误判会触发的已知风险类别。internal/xray/hot_diff.go第 115-139 行的diffInbounds:如果针对某个 inbound 的diffInboundUsers(同文件第 157-200 行,只对 vless/vmess/trojan 生效)判定失败,代码不会整体重启 Xray 进程,而是只对这一个 inbound 调用RemoveInbound+AddInbound(第 131-138 行)。这能完整解释你看到的现象:只有到期客户端所在的这一个 vless+xhttp+reality inbound 被整体摘除重建(该 inbound 下所有客户端的连接一起被重置/RST),而独立的 ss inbound 因为配置完全没变,不会被触碰。仅凭现有报告,无法判断具体是(a)这个 inbound 的某个字段被
diffInboundUsers误判为"结构性变化"从而整体重建,还是(b)Xray-core 处理 xhttp 传输下AlterInbound(internal/xray/api.go第 639-655 行)本身对同 inbound 其它连接有副作用(这部分不在 3x-ui 代码范围内)。Recommendation:
定位需要以下信息,麻烦提供:
/etc/default/x-ui中加入一行XUI_LOG_LEVEL=debug,然后systemctl restart x-ui(该文件是x-ui.service的EnvironmentFile)。复现问题后查看日志(x-ui菜单 → 日志管理 → "Debug Log",等价于journalctl -u x-ui -e --no-pager -f -p debug),重点看客户端到期前后是否出现:Xray config changes applied through the core API, no restart needed(说明只做了增量操作,其它连接理论上不受影响);或者hot diff:开头的调试信息(说明某个判定失败,对该 inbound 做了整体重建)。reverse转发。Confidence: 中等。"自动禁用触发增量优先、失败回退到该 inbound 整体重建/重启"这条机制在源码中是明确的;但具体命中的是
diffInboundUsers判定失败还是 Xray-core 自身在 xhttp 下的行为,需要上面第 1 项的调试日志才能确认。Example:
@MHSanaei 需要你或提交者补充上述调试日志,才能确认具体命中的分支并决定修复方向。
This reply was generated automatically; a maintainer may follow up.
@1649861646 commented on GitHub (Jul 13, 2026):
请求修复,非常严重的bug,目前所有vless xhttp reality只要一个客户端到期,所有客户端都无法使用!!,必须重启
@1649861646 commented on GitHub (Jul 13, 2026):
搞错了,不是3x-ui的问题。。。还是那个utls的问题,因为用新的app还可以继续用