[GH-ISSUE #5022] [Bug]: Nodes traffic usage #3535

Closed
opened 2026-10-31 20:33:08 +07:00 by bsakaguchi · 4 comments
Owner

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

Describe the bug

As I tested, the master panel doesn't count the Nodes usage, it even doesn't show as an online user if connected to any Node rather than the main panel.

How to reproduce the problem

Create a user that has assigned nodes, connect to any remote Node's config then monitor the traffic usage on the main panel (however it shows the usage correctly on the corresponded Node)

Expected behavior

No response

Actual behavior

No response

Relevant logs


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

Ubuntu 24.04

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

  • 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 @Nima786 on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5022 ### Describe the bug As I tested, the master panel doesn't count the Nodes usage, it even doesn't show as an online user if connected to any Node rather than the main panel. ### How to reproduce the problem Create a user that has assigned nodes, connect to any remote Node's config then monitor the traffic usage on the main panel (however it shows the usage correctly on the corresponded Node) ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### 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 Ubuntu 24.04 ### 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 - [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:33:08 +07:00
Author
Owner

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

Thanks for the detailed report. The node-traffic sync mechanism works like this on the master:

  1. Heartbeat job (every 5 s): probes each enabled node's GET /panel/api/server/status with the configured Bearer token and marks the node online or offline in the master DB.
  2. Traffic sync job (every 5 s): only processes nodes whose status is online AND Enable = true. For every such node it fetches /panel/api/inbounds/list + /panel/api/clients/onlinesByGuid (or the legacy /panel/api/clients/onlines) and merges traffic deltas into the master database. If the node is offline or the heartbeat failed, ClearNodeOnlineClients is called and no traffic is counted.

The most common causes of traffic/online-status not reaching the master:


1. Node shows as "offline" on the master

Open Nodes page on the master panel. If the node badge is red/offline, the sync never runs. Possible sub-causes:

  • Master cannot reach the node's panel IP/port (firewall, wrong port, wrong scheme — http vs https).
  • The node is on the same machine or a private LAN and "Allow Private Address" is not enabled in the node's master-side settings.
  • TLS certificate mismatch (if scheme is https and TLS verify mode is set to verify with a self-signed cert — use skip or pin).

2. API token not configured or mismatched

Every request the master makes to a node uses Authorization: Bearer <token>. If the token is missing, the sync immediately fails with node has no API token configured (logged as a WARNING but never shown in the UI).

  • On the node panel: Settings → Panel Settings → set an API token.
  • On the master panel: Nodes → edit that node → enter the same token.
  • If you change the token on the node side, update it on the master side too.

3. Sync errors in the master logs

Run this on the master server to see any live sync warnings:

journalctl -u x-ui -n 200 | grep "node traffic sync"

A line like node traffic sync: fetch from <NodeName> failed: … pinpoints the exact failure.


To confirm the exact problem, please share:

  1. The node status shown on the master's Nodes page (online/offline + any error tooltip).
  2. The output of the log command above.
  3. Whether an API token is set on both sides (master node config and node panel settings).

If the node shows as online and the logs are clean, the next step would be to check whether the client email is actually attached to a node-backed inbound (one with a node_id) rather than a local inbound on the master — only node-backed inbound traffic is synced via this path.

<!-- gh-comment-id:4639923670 --> @github-actions[bot] commented on GitHub (Jun 6, 2026): Thanks for the detailed report. The node-traffic sync mechanism works like this on the master: 1. **Heartbeat job (every 5 s):** probes each enabled node's `GET /panel/api/server/status` with the configured Bearer token and marks the node **online** or **offline** in the master DB. 2. **Traffic sync job (every 5 s):** only processes nodes whose status is **`online`** AND `Enable = true`. For every such node it fetches `/panel/api/inbounds/list` + `/panel/api/clients/onlinesByGuid` (or the legacy `/panel/api/clients/onlines`) and merges traffic deltas into the master database. If the node is **offline** or the heartbeat failed, `ClearNodeOnlineClients` is called and no traffic is counted. The most common causes of traffic/online-status not reaching the master: --- ### 1. Node shows as "offline" on the master Open **Nodes** page on the master panel. If the node badge is red/offline, the sync never runs. Possible sub-causes: - Master cannot reach the node's panel IP/port (firewall, wrong port, wrong scheme — http vs https). - The node is on the same machine or a private LAN and **"Allow Private Address"** is not enabled in the node's master-side settings. - TLS certificate mismatch (if scheme is https and TLS verify mode is set to `verify` with a self-signed cert — use `skip` or `pin`). ### 2. API token not configured or mismatched Every request the master makes to a node uses `Authorization: Bearer <token>`. If the token is missing, the sync immediately fails with `node has no API token configured` (logged as a WARNING but never shown in the UI). - On the **node panel**: Settings → Panel Settings → set an API token. - On the **master panel**: Nodes → edit that node → enter the same token. - If you change the token on the node side, update it on the master side too. ### 3. Sync errors in the master logs Run this on the master server to see any live sync warnings: ```bash journalctl -u x-ui -n 200 | grep "node traffic sync" ``` A line like `node traffic sync: fetch from <NodeName> failed: …` pinpoints the exact failure. --- **To confirm the exact problem, please share:** 1. The node status shown on the master's Nodes page (online/offline + any error tooltip). 2. The output of the log command above. 3. Whether an API token is set on both sides (master node config and node panel settings). If the node shows as online and the logs are clean, the next step would be to check whether the client email is actually attached to a node-backed inbound (one with a **node_id**) rather than a local inbound on the master — only node-backed inbound traffic is synced via this path.
Author
Owner

@ahmetakdag101 commented on GitHub (Jun 6, 2026):

I had the same issue on a multi-node setup.

In my case:

  • Main panel was running 3x-ui v3.2.8
  • Remote nodes were also visible and online
  • Clients could connect to the nodes successfully
  • Traffic and online status were visible on the node panels
  • But the main/accounting panel did not show the user as online and did not update the traffic usage

The main panel logs showed errors like:

WARNING - node traffic sync: merge for s521-node-01 failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804)
WARNING - node traffic sync: merge for s521-node-02 failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804)
WARNING - node traffic sync: merge for s521-node-03 failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804)

Temporary workaround:

I downgraded only the main/accounting panel from v3.2.8 to v3.2.7.

I did not downgrade the remote nodes. The nodes stayed on v3.2.8.

After downgrading the main panel to v3.2.7, the node traffic sync error disappeared and the main panel started receiving traffic/online status correctly again.

So for now, as a temporary workaround, downgrading only the main panel to v3.2.7 may be enough until this is fixed in a future release.

<!-- gh-comment-id:4639954618 --> @ahmetakdag101 commented on GitHub (Jun 6, 2026): I had the same issue on a multi-node setup. In my case: - Main panel was running 3x-ui v3.2.8 - Remote nodes were also visible and online - Clients could connect to the nodes successfully - Traffic and online status were visible on the node panels - But the main/accounting panel did not show the user as online and did not update the traffic usage The main panel logs showed errors like: WARNING - node traffic sync: merge for s521-node-01 failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804) WARNING - node traffic sync: merge for s521-node-02 failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804) WARNING - node traffic sync: merge for s521-node-03 failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804) Temporary workaround: I downgraded only the main/accounting panel from v3.2.8 to v3.2.7. I did not downgrade the remote nodes. The nodes stayed on v3.2.8. After downgrading the main panel to v3.2.7, the node traffic sync error disappeared and the main panel started receiving traffic/online status correctly again. So for now, as a temporary workaround, downgrading only the main panel to v3.2.7 may be enough until this is fixed in a future release.
Author
Owner

@usamirali commented on GitHub (Jun 6, 2026):

i had this problem too

on local its work

but on the node it doesnt work

<!-- gh-comment-id:4640292416 --> @usamirali commented on GitHub (Jun 6, 2026): i had this problem too on local its work but on the node it doesnt work
Author
Owner

@Nima786 commented on GitHub (Jun 7, 2026):

that is correct, when I checked the master panel server logs, showed the exact same errors as below:

Jun 07 03:30:55 nima.fun /usr/local/x-ui/x-ui[149303]: WARNING - node traffic sync: merge for USA - Oracle failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804)
Jun 07 03:31:00 nima.fun /usr/local/x-ui/x-ui[149303]: WARNING - node traffic sync: merge for Germany - Oracle failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804)
Jun 07 03:31:00 nima.fun /usr/local/x-ui/x-ui[149303]: WARNING - node traffic sync: merge for Turkey failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804)
...

and the same things:

Main panel was running 3x-ui v3.2.8
Remote nodes were also visible and online
Clients could connect to the nodes successfully
Traffic and online status were visible on the node panels
But the main/accounting panel did not show the user as online and did not update the traffic usage.

<!-- gh-comment-id:4641198973 --> @Nima786 commented on GitHub (Jun 7, 2026): that is correct, when I checked the master panel server logs, showed the exact same errors as below: Jun 07 03:30:55 nima.fun /usr/local/x-ui/x-ui[149303]: WARNING - node traffic sync: merge for USA - Oracle failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804) Jun 07 03:31:00 nima.fun /usr/local/x-ui/x-ui[149303]: WARNING - node traffic sync: merge for Germany - Oracle failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804) Jun 07 03:31:00 nima.fun /usr/local/x-ui/x-ui[149303]: WARNING - node traffic sync: merge for Turkey failed: ERROR: CASE types boolean and integer cannot be matched (SQLSTATE 42804) ... and the same things: Main panel was running 3x-ui v3.2.8 Remote nodes were also visible and online Clients could connect to the nodes successfully Traffic and online status were visible on the node panels But the main/accounting panel did not show the user as online and did not update the traffic usage.
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#3535
No description provided.