mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5434] [Bug]: Deleted clients/configs remain active and can still connect #3796
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#3796
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 @rezamoody1 on GitHub (Jun 18, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5434
Describe the bug
I'm facing a bug in 3x-ui v3.3.1. When I delete a client/config from the panel, it doesn't actually get disabled or disconnected. The user can still connect and use the internet even though they are completely removed from the UI.
How to reproduce the problem
clients
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.3.1
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
ubuntu 24
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@GlacierLaunch commented on GitHub (Jun 18, 2026):
this is true, same for me @claude
@vrcher commented on GitHub (Jun 20, 2026):
I've noticed the same problem in the latest version; when switching users, duplicates are sometimes created or the information doesn't update. A “database is locked” error may also appear. I have several nodes configured.
@github-actions[bot] commented on GitHub (Jun 20, 2026):
Claude finished @MHSanaei's task in 8m 52s —— View job
Analysis and fix for #5434
Root cause
In
internal/web/service/client_inbound_apply.go,DelInboundClientByEmailskips the live Xray runtime removal whenemailShared=true(i.e. the client email also appears in at least one other inbound):Each inbound in Xray is a separate handler with its own user list. Whether the email exists in another inbound has no bearing on whether it must be evicted from this inbound's handler. By skipping
RemoveUser/DeleteUserwhenemailShared=true, the user's session on the deleted inbound is never terminated. BecauseneedRestartis also never set in this branch, the 30-second restart cron (@every 30s IsNeedRestartAndSetFalse) is never triggered either, so the stale active session persists indefinitely.emailSharedis only relevant for deciding whether to delete traffic stats and IPs (which must be preserved if the email still lives in another inbound). It must not prevent the per-inbound Xray handler cleanup.The batch path (
delInboundClients, used by Bulk Detach) already calledRemoveUserregardless ofemailShared— this fix brings the single-delete path in line with it.Fix (commit
1b3afa8)Note on push permission
The GitHub App token used by this action does not have write access to this repository. The commit exists locally (
1b3afa8) but could not be pushed. The maintainer can apply the fix manually or grant write access to the App.The secondary issue reported by
@vrcher(database locked / duplicates on multi-node) is a distinct SQLite contention problem and is not addressed by this fix.@MHSanaei commented on GitHub (Jun 21, 2026):
Fixed on
mainby #5352 (commitcbb21b75, "fix(nodes): propagate single-client deletion to remote nodes").Deleting a client now:
RemoveUsercall (or flags an xray restart if the live call can't be made), andDeleteUser/detach to remote-node inbounds regardless of the client's enable flag (internal/web/service/client_inbound_apply.go:850-866), marking the node dirty for reconcile on any push failure.An email tombstone (
deleteTombstoneTTL) also prevents a node's next cumulative snapshot from resurrecting the just-deleted client. A regression test (node_dirty_test.go) covers the disabled-client-on-node case.If you can still reproduce this on a build that includes
cbb21b75(after 3.3.1), please reopen with the panel/node versions and whether the inbound is local or on a node.