[GH-ISSUE #6257] [Bug]: When a user is disabled, the user gets detached from their inbounds #4247

Closed
opened 2026-10-31 20:38:16 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @NethminaYasas on GitHub (Aug 18, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6257

Describe the bug

when a user in a node is disabled from the master node, the user gets detached from their inbounds, which leads to traffic reset.

How to reproduce the problem

  1. go to the client list in master node
  2. disable a client in a node

Expected behavior

it should just disable the client without detaching from its inbounds

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.6.0

Xray-core version

26.7.28

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

Which parts of the panel are affected?

Xray config generation

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

No — direct access

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @NethminaYasas on GitHub (Aug 18, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6257 ### Describe the bug when a user in a node is disabled from the master node, the user gets detached from their inbounds, which leads to traffic reset. ### How to reproduce the problem 1. go to the client list in master node 2. disable a client in a node ### Expected behavior it should just disable the client without detaching from its inbounds ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.6.0 ### Xray-core version 26.7.28 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### Which parts of the panel are affected? Xray config generation ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? No — direct access ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:38:16 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 18, 2026):

This matches #6247 ("Disabling a client removes node associations and re-enabling does not restore them"), which was reported on 3.6.0 as well and closed as completed after a fix was merged to main. That fix is not in a numbered release: v3.6.0 (2026-07-30) is still the latest release and internal/config/version on main still reads 3.6.0, so it is currently reachable only from main or the rolling dev-latest pre-release.

I could not reproduce the detach itself from the source available to me (a checkout of main that predates that commit), so I am not confirming the trigger here. The second half of your report — the traffic reset — does follow from a lost attachment, and that chain is confirmed in the source (line numbers from current main):

  • For a node-hosted inbound the panel rebuilds the client_inbounds rows on every traffic poll from what the node reports: ClientService.SyncInbound deletes the inbound's links and re-creates them (internal/web/service/client_link.go:86), called from setRemoteTrafficLocked (internal/web/service/inbound_node.go:1044).
  • A client that ends that merge attached to nothing is marked a sync orphan (inbound_node.go:1083, internal/web/service/client_sync_orphan.go:28).
  • If nothing re-attaches it within 15 minutes, ReapSyncOrphans hard-deletes the client record, its client_traffics row and its per-node baselines (client_sync_orphan.go:16, :47-84).
  • The next node snapshot re-creates the client from the node's settings with Up/Down seeded at 0 (inbound_node.go:835-848). That is the counter reset.

Two things that may help in the meantime:

  1. Re-attaching the client to its inbounds inside that 15-minute window prevents the deletion and the reset: the orphan mark is cleared as soon as a link exists again (client_sync_orphan.go:39-43), and the reaper only deletes clients that still have no link (client_sync_orphan.go:54).
  2. The dev channel installs main: x-ui update-dev (x-ui.sh:167-169), or the "Update to Dev channel" menu entry. It is a per-commit pre-release rather than a stable build, so back up /etc/x-ui/x-ui.db first.

To confirm this is the same defect rather than a second path, these would settle it:

  1. Whether the behaviour still occurs on a dev-latest build.
  2. If it does, the master's log covering the disable and the following ~20 minutes (x-ui log, or journalctl -u x-ui -n 500 --no-pager), filtered to the strings setRemoteTraffic, reaped and reap sync orphans: removed.
  3. Which control you used: the Enable switch in the table row, or the Enable field inside the client edit dialog. Saving that dialog also submits the attached-inbounds diff (frontend/src/pages/clients/ClientFormModal.tsx:658-661) and sends a real detach to POST /panel/api/clients/<email>/detach, which is a different endpoint from the row switch.

@MHSanaei for visibility — if this is the same defect as #6247, it can be closed against that fix.

This reply was generated automatically. A maintainer may follow up.

<!-- gh-comment-id:5332445476 --> @github-actions[bot] commented on GitHub (Aug 18, 2026): This matches #6247 ("Disabling a client removes node associations and re-enabling does not restore them"), which was reported on 3.6.0 as well and closed as completed after a fix was merged to `main`. That fix is not in a numbered release: `v3.6.0` (2026-07-30) is still the latest release and `internal/config/version` on `main` still reads `3.6.0`, so it is currently reachable only from `main` or the rolling `dev-latest` pre-release. I could not reproduce the detach itself from the source available to me (a checkout of `main` that predates that commit), so I am not confirming the trigger here. The second half of your report — the traffic reset — does follow from a lost attachment, and that chain is confirmed in the source (line numbers from current `main`): - For a node-hosted inbound the panel rebuilds the `client_inbounds` rows on every traffic poll from what the node reports: `ClientService.SyncInbound` deletes the inbound's links and re-creates them (`internal/web/service/client_link.go:86`), called from `setRemoteTrafficLocked` (`internal/web/service/inbound_node.go:1044`). - A client that ends that merge attached to nothing is marked a sync orphan (`inbound_node.go:1083`, `internal/web/service/client_sync_orphan.go:28`). - If nothing re-attaches it within 15 minutes, `ReapSyncOrphans` hard-deletes the client record, its `client_traffics` row and its per-node baselines (`client_sync_orphan.go:16`, `:47-84`). - The next node snapshot re-creates the client from the node's settings with `Up`/`Down` seeded at `0` (`inbound_node.go:835-848`). That is the counter reset. Two things that may help in the meantime: 1. Re-attaching the client to its inbounds inside that 15-minute window prevents the deletion and the reset: the orphan mark is cleared as soon as a link exists again (`client_sync_orphan.go:39-43`), and the reaper only deletes clients that still have no link (`client_sync_orphan.go:54`). 2. The dev channel installs `main`: `x-ui update-dev` (`x-ui.sh:167-169`), or the "Update to Dev channel" menu entry. It is a per-commit pre-release rather than a stable build, so back up `/etc/x-ui/x-ui.db` first. To confirm this is the same defect rather than a second path, these would settle it: 1. Whether the behaviour still occurs on a `dev-latest` build. 2. If it does, the master's log covering the disable and the following ~20 minutes (`x-ui log`, or `journalctl -u x-ui -n 500 --no-pager`), filtered to the strings `setRemoteTraffic`, `reaped` and `reap sync orphans: removed`. 3. Which control you used: the Enable switch in the table row, or the Enable field inside the client edit dialog. Saving that dialog also submits the attached-inbounds diff (`frontend/src/pages/clients/ClientFormModal.tsx:658-661`) and sends a real detach to `POST /panel/api/clients/<email>/detach`, which is a different endpoint from the row switch. @MHSanaei for visibility — if this is the same defect as #6247, it can be closed against that fix. *This reply was generated automatically. A maintainer may follow up.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#4247
No description provided.