mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5352] [Bug]: Cannot delete client on remote node #3748
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#3748
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 @Rise0x00 on GitHub (Jun 15, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5352
Describe the bug
The client cannot be deleted from the remote node. It is visually removed, but reappears after a short time, after refreshing the page.
How to reproduce the problem
Expected behavior
The client is successfully deleted
Actual behavior
The client reappears after deletion.
Relevant logs
Screenshots
https://github.com/user-attachments/assets/c5359aa4-b969-4fa7-8e00-6f894bf6bd01
3x-ui version
3.3.1
Xray-core version
26.6.1
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Which parts of the panel are affected?
Multi-node (sub-nodes)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
No — direct access
Before submitting
@Rise0x00 commented on GitHub (Jun 15, 2026):
I can't delete this particular client for the third day already.
@github-actions[bot] commented on GitHub (Jun 15, 2026):
The behavior is a confirmed bug in the node-sync path, reproducible with the current codebase. The following explains what happens and what information would help narrow down the exact failure mode.
What should happen
When a client is deleted from the master panel,
ClientService.Delete(ininternal/web/service/client_crud.go) tombstones the email in an in-memory map (TTL: 90 seconds, seedeleteTombstoneTTLininternal/web/service/client_locks.go) and callsDelInboundClientByEmailfor every inbound the client is attached to. For an inbound that belongs to a remote node,DelInboundClientByEmail(internal/web/service/client_inbound_apply.go:664) is expected to:settingsJSON and save it to the master DB.rt.DeleteUser→panel/api/clients/{email}/detachon the remote panel so the remote node's own DB and running Xray are also updated.markDirty = trueand callNodeService.MarkNodeDirty, which causesNodeTrafficSyncJobto push a full reconcile on the next tick.Where it breaks — two confirmed paths
Path A — disabled client:
needApiDelis derived from the"enable"field of the client entry in the inbound JSON. If the client was disabled,needApiDel = false(line 684), the entire block that callsrt.DeleteUserand checks the node dirty state is skipped, andmarkDirtystays false. The remote node's inbound settings are never updated and the node is never marked dirty. The 90-second tombstone is the only guard.Path B — silent
resolveRemoteIDfailure:DeleteUserininternal/web/runtime/remote.go:336callsresolveRemoteIDto translate the master-side tag to the remote node's numeric inbound ID. If that lookup fails for any reason (network timeout, stale cache, tag mismatch), the function returnsnil— treating the failure as "already done" — so the caller inDelInboundClientByEmailnever sees an error,markDirtystays false, and again the remote node is not updated.Why the client comes back
NodeTrafficSyncJobruns every few seconds and callssetRemoteTrafficLocked(internal/web/service/inbound_node.go). When the node is not dirty, the snapshot frompanel/api/inbounds/liston the remote node is processed normally: clients parsed from each inbound'ssettingsJSON are passed through the tombstone filter and then toSyncInbound(internal/web/service/client_link.go).SyncInboundfully replacesclient_inboundsfor each inbound and creates a newClientRecordfor any email that is in the snapshot but not already in the master'sclientstable. Once the 90-second tombstone expires and the remote node's inbound still carries the deleted client, the next sync run re-creates theClientRecordand the client reappears in the Clients section.What would help confirm the exact path
Warninglines around the time of deletion? The relevant log prefix would beError in deleting client onormark node dirty failed. On the master panel you can filter withjournalctl -u x-ui | grep -E 'Warning|Error'.The remote node Xray logs you attached show normal proxy traffic and are not related to the client-sync mechanism.
This reply was generated automatically; a maintainer may follow up.
@Rise0x00 commented on GitHub (Jun 15, 2026):
The client isn't deleted whether it's turned on or off. But just now I tried deleting it while it was deactivated.
It comes back after about 90 seconds.
Log: