[GH-ISSUE #4984] [Bug]: Incorrect node mapping for clients in nested/chained multi-node setup (Node 1 -> Node 2 -> Node 3) #3504

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

Originally created by @zetrock1 on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4984

Describe the bug

In a nested/chained multi-node setup (where Node 1 manages Node 2, and Node 2 manages Node 3), the online status of clients is displayed incorrectly on the primary Master panel (Node 1). Clients that are active on Node 3 are incorrectly shown on Node 1 as if they are online on Node 2.

How to reproduce the problem

  1. Set up Master Panel (Node 1).
  2. Register Server 2 as a node under Node 1.
  3. On Server 2 (Node 2), set up its own panel and register Server 3 (Node 3) as its child node.
  4. Connect a client to an inbound that physically resides on Node 3.
  5. Open the Master Panel (Node 1) and check the "Inbounds" or "Clients" page.
  6. Observe that the client connected to Node 3 is shown as online on Node 2.

Expected behavior

The primary Master panel (Node 1) should correctly map and display which downstream node a client is active on. If a client is connected to Node 3, the Node 1 panel should show them as online on Node 3, instead of flattening and mapping all cascaded clients to Node 2.

Actual behavior

All active clients from Node 3 are incorrectly displayed on Node 1 as if they are online on Node 2. This happens because Node 2 merges the online clients of Node 3 into its own list, and Node 1 (having no direct relationship with Node 3 in its direct database mapping) associates all of them with Node 2.

Relevant logs

No explicit error logs are generated. This is an architectural mapping issue in how the node traffic and online client sync jobs (such as node_traffic_sync_job and the onlinesByNode state) aggregate and propagate nested client lists in a cascading multi-node topology.

Screenshots

No response

3x-ui version

3.2.8

Xray-core version

26.6.1

How did you install 3x-ui?

install.sh script

Operating system

Arch linux

Which parts of the panel are affected?

Frontend (UI / panel pages), Backend (API endpoints, login, settings), 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

  • 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 @zetrock1 on GitHub (Jun 5, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4984 ### Describe the bug In a nested/chained multi-node setup (where Node 1 manages Node 2, and Node 2 manages Node 3), the online status of clients is displayed incorrectly on the primary Master panel (Node 1). Clients that are active on Node 3 are incorrectly shown on Node 1 as if they are online on Node 2. ### How to reproduce the problem 1. Set up Master Panel (Node 1). 2. Register Server 2 as a node under Node 1. 3. On Server 2 (Node 2), set up its own panel and register Server 3 (Node 3) as its child node. 4. Connect a client to an inbound that physically resides on Node 3. 5. Open the Master Panel (Node 1) and check the "Inbounds" or "Clients" page. 6. Observe that the client connected to Node 3 is shown as online on Node 2. ### Expected behavior The primary Master panel (Node 1) should correctly map and display which downstream node a client is active on. If a client is connected to Node 3, the Node 1 panel should show them as online on Node 3, instead of flattening and mapping all cascaded clients to Node 2. ### Actual behavior All active clients from Node 3 are incorrectly displayed on Node 1 as if they are online on Node 2. This happens because Node 2 merges the online clients of Node 3 into its own list, and Node 1 (having no direct relationship with Node 3 in its direct database mapping) associates all of them with Node 2. ### Relevant logs ```shell No explicit error logs are generated. This is an architectural mapping issue in how the node traffic and online client sync jobs (such as node_traffic_sync_job and the onlinesByNode state) aggregate and propagate nested client lists in a cascading multi-node topology. ``` ### Screenshots _No response_ ### 3x-ui version 3.2.8 ### Xray-core version 26.6.1 ### How did you install 3x-ui? install.sh script ### Operating system Arch linux ### Which parts of the panel are affected? Frontend (UI / panel pages), Backend (API endpoints, login, settings), 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 - [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:32:54 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 5, 2026):

This appears to be a duplicate of #4983, submitted by the same author ~13 seconds earlier. Closing this copy in favour of #4983.

For anyone finding this via search: the bug has been verified in the source. Root cause summary:

The multi-node online-status tracking is designed for a flat star topology (one master to many leaf nodes). It does not handle a chained topology (Node 1 to Node 2 to Node 3).

  • NodeTrafficSyncJob on Node 1 calls FetchTrafficSnapshot on Node 2 via panel/api/clients/onlines (web/runtime/remote.go).
  • Node 2 returns the result of GetOnlineClients() (web/controller/client.go:417), which is the union of Node 2's own clients AND all of Node 2's sub-nodes' clients (including Node 3's), because Node 2 has already stored them in p.nodeOnlineClients via its own NodeTrafficSyncJob (xray/process.go:254).
  • Node 1 stores the entire flattened list under Node 2's ID via SetNodeOnlineClients(node2Id, snap.OnlineEmails) (web/service/inbound.go:1931).
  • GetOnlineClientsByNode() then shows all of Node 3's clients as belonging to Node 2.

The panel/api/clients/onlinesByNode endpoint already exists (web/controller/client.go:420) and returns a per-sub-node breakdown. Using it in FetchTrafficSnapshot would help, but Node 1 still has no Node 3 entry in its own database, so a deeper mapping solution would be needed.

Please continue the discussion on #4983.

<!-- gh-comment-id:4634832838 --> @github-actions[bot] commented on GitHub (Jun 5, 2026): This appears to be a duplicate of #4983, submitted by the same author ~13 seconds earlier. Closing this copy in favour of #4983. For anyone finding this via search: the bug has been verified in the source. Root cause summary: The multi-node online-status tracking is designed for a flat star topology (one master to many leaf nodes). It does not handle a chained topology (Node 1 to Node 2 to Node 3). - NodeTrafficSyncJob on Node 1 calls FetchTrafficSnapshot on Node 2 via panel/api/clients/onlines (web/runtime/remote.go). - Node 2 returns the result of GetOnlineClients() (web/controller/client.go:417), which is the union of Node 2's own clients AND all of Node 2's sub-nodes' clients (including Node 3's), because Node 2 has already stored them in p.nodeOnlineClients via its own NodeTrafficSyncJob (xray/process.go:254). - Node 1 stores the entire flattened list under Node 2's ID via SetNodeOnlineClients(node2Id, snap.OnlineEmails) (web/service/inbound.go:1931). - GetOnlineClientsByNode() then shows all of Node 3's clients as belonging to Node 2. The panel/api/clients/onlinesByNode endpoint already exists (web/controller/client.go:420) and returns a per-sub-node breakdown. Using it in FetchTrafficSnapshot would help, but Node 1 still has no Node 3 entry in its own database, so a deeper mapping solution would be needed. Please continue the discussion on #4983.
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#3504
No description provided.