mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4954] [Bug]: Removing one inbound from a client deletes all inbounds of that node #3473
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#3473
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 @mo3g666 on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4954
Describe the bug
Setup: central panel (subscription mode), 2 nodes, multiple inbounds per node
When editing a client in the central panel (multi-node / subscription setup), removing a single inbound from one node causes all inbounds of that node to be deleted from the client. Inbounds belonging to other nodes are not affected.
How to reproduce the problem
inbound-1,inbound-2/ Node B:inbound-3)inbound-1from Node AExpected behavior
Client retains
inbound-2(Node A) andinbound-3(Node B). Onlyinbound-1is removed.Actual behavior
All inbounds of Node A are removed (
inbound-1andinbound-2). Node B inbounds remain intact.Relevant logs
Screenshots
No response
3x-ui version
3.2.7
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?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 5, 2026):
Thanks for the detailed report and logs — this is enough to identify the bug.
What the logs tell us
The central-panel log shows four consecutive entries at the same second:
This message is emitted by
rt.DeleteUserinsideDelInboundClient(web/service/client.go). OneDeleteUsercall is made per inbound ID passed toDetach. Four failures means the browser sent all four Node A inbound IDs in the detach request — when it should have sent only the one you unchecked.The four
DelInbound: runtime lookup failedlines on Node A are a separate, secondary effect: after eachDeleteUserfails, the central panel marks Node A as dirty; the nextNodeTrafficSyncJobtick firesReconcileNode, which pushesrt.DelInboundfor any inbound tags it cannot resolve on the node (likely a transient tag-cache miss at that moment).Root cause — frontend diff mismatch
The edit-client save path in
ClientFormModal.tsxcomputes what to detach with:attachedIdscomes fromGET /panel/api/clients/get/:email→GetInboundIdsForRecord, which reads every row inclient_inboundsfor this client, regardless of protocol.The inbound multi-select is built from a filtered list:
Any inbound whose protocol is not in that set (
wireguard,http,mixed,tunnel,tun) is excluded from the Select'soptions. If the client is attached to such an inbound on Node A, its ID appears inoriginal(from hydrate) but has no entry ininboundOptions.In Ant Design v6 Select with
mode="multiple", a controlledvalueentry that has no matching option may not be preserved in theonChangepayload when the user interacts with the widget. Once that ID is dropped fromform.inboundIds, it disappears fromnext— so at save time,toDetachincludes it alongside the inbound you explicitly removed.If all non-
MULTI_CLIENT_PROTOCOLSinbounds the client holds are on Node A, then all of them end up intoDetachwhile Node B's inbounds (all visible in the Select) remain innext. This matches your observation exactly.Confirming the hypothesis
Could you check what protocols Node A's inbounds use? Specifically, does the client have any attachment to a
wireguard,http,mixed,tunnel, ortuninbound on Node A (even one added automatically or via bulk-assign)? You can query the central-panel DB directly:Suggested fix direction
The safest fix is to restrict
toDetachto inbound IDs that were actually visible in the Select — IDs the user could have interacted with:This prevents silently detaching inbounds that the protocol filter hid from the UI. It also makes the behavior consistent: inbounds with non-subscription protocols can only be removed via the dedicated Detach API, not accidentally through the edit-client modal.