[GH-ISSUE #6786] [Bug]: Repeated User Status Changes and setRemoteTraffic Loop in Multi-Node #4519

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

Originally created by @Begamegazon on GitHub (Oct 10, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6786

Describe the bug

I am using the Sanaei X-UI panel with 8 nodes configured.

Some users are automatically disabled and re-enabled approximately every 6 seconds, without any manual intervention. This behavior repeats continuously and appears to be related to the remote node traffic synchronization or lifecycle management.

On the main server, the following log message is repeated every 6 seconds:

2026/10/10 14:49:21 INFO - X-UI: setRemoteTraffic: node 2 lifecycle lift; marking dirty for re-push

The issue affects some users, while others appear to work normally. Since I have 8 nodes configured, I am not sure whether the problem is related to node synchronization, remote traffic updates, or the lifecycle management mechanism.

How to reproduce the problem

Install and configure the Sanaei X-UI panel.

Configure 8 nodes.

Run the panel and allow it to synchronize traffic and user statuses across the nodes.

Monitor the main server logs.

Observe that the following message appears approximately every 6 seconds:

setRemoteTraffic: node 2 lifecycle lift; marking dirty for re-push

Observe that some users are automatically disabled and re-enabled at approximately the same interval, without any manual action.

Expected behavior

User statuses should remain stable unless explicitly changed by an administrator or affected by a legitimate configuration or traffic-limit rule. Remote traffic synchronization should not cause users to be repeatedly disabled and re-enabled.

Actual behavior

Some users repeatedly switch between disabled and enabled states approximately every 6 seconds, while the main server continuously logs the same setRemoteTraffic message.

Could this be caused by a node lifecycle synchronization loop, repeated traffic updates, or an issue with remote node state management?

Relevant logs


Screenshots

No response

3x-ui version

v3.9.0

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 20

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 @Begamegazon on GitHub (Oct 10, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6786 ### Describe the bug I am using the Sanaei X-UI panel with 8 nodes configured. Some users are automatically disabled and re-enabled approximately every 6 seconds, without any manual intervention. This behavior repeats continuously and appears to be related to the remote node traffic synchronization or lifecycle management. On the main server, the following log message is repeated every 6 seconds: 2026/10/10 14:49:21 INFO - X-UI: setRemoteTraffic: node 2 lifecycle lift; marking dirty for re-push The issue affects some users, while others appear to work normally. Since I have 8 nodes configured, I am not sure whether the problem is related to node synchronization, remote traffic updates, or the lifecycle management mechanism. ### How to reproduce the problem Install and configure the Sanaei X-UI panel. Configure 8 nodes. Run the panel and allow it to synchronize traffic and user statuses across the nodes. Monitor the main server logs. Observe that the following message appears approximately every 6 seconds: setRemoteTraffic: node 2 lifecycle lift; marking dirty for re-push Observe that some users are automatically disabled and re-enabled at approximately the same interval, without any manual action. ### Expected behavior User statuses should remain stable unless explicitly changed by an administrator or affected by a legitimate configuration or traffic-limit rule. Remote traffic synchronization should not cause users to be repeatedly disabled and re-enabled. ### Actual behavior Some users repeatedly switch between disabled and enabled states approximately every 6 seconds, while the main server continuously logs the same setRemoteTraffic message. Could this be caused by a node lifecycle synchronization loop, repeated traffic updates, or an issue with remote node state management? ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version v3.9.0 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 20 ### 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:40:14 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (Oct 10, 2026):

This looks like a v3.9.0 regression that is already fixed on main but not in a release yet. In v3.9.0 a node ignores the client list and enable flag that the master re-pushes whenever the node was enrolled with an ordinary admin API token, which is the default. The master then sees the same mismatch on every traffic sync, logs lifecycle lift; marking dirty for re-push, pushes again, and the push is ignored again.

How the loop runs (v3.9.0)

  1. On each sync the master rewrites the node's reported client enable/expiryTime with its own values. If anything changed, it marks the node dirty. See internal/web/service/client_locks.go:276-278:
    if nodeEnable, _ := cm["enable"].(bool); nodeEnable != tr.Enable {
    	cm["enable"] = tr.Enable
    	changed = true
    
    and internal/web/service/inbound_node.go:1443-1449, which logs the line you are seeing.
  2. Reconcile pushes the inbound to the node. On the node, UpdateInbound keeps its stored clients and enable unless the request counts as a master push (internal/web/service/inbound.go:1856-1858):
    if !s.FromNodeSync {
    	inbound.Settings = keepStoredClients(inbound.Settings, stored.Settings)
    	inbound.Enable = stored.Enable
    
  3. In v3.9.0, a request counted as a master push only when its token had the node-sync scope. Nodes enrolled with an admin token threw the master's values away, but the push still counted as successful. The next snapshot carried the old enable again, so steps 1–3 repeated on every sync tick (the ~6 s you see).

What fixes it

Commit 2ffc694a ("fix(nodes): let a master's push and reconcile converge node inbounds") makes the master send an X-3x-Master-Push header on every request, and the node now honours it (internal/web/controller/inbound.go:70). It is on main and in the dev-latest pre-release, but not in v3.9.0. Both sides need the fix: the master sends the header and the node checks it, so update the master and all 8 nodes once it ships.

Possible workaround until then (not verified): on each node, create an API token with scope node-sync (Settings → Security → API tokens), then re-enroll that node on the master with this token. With that scope, v3.9.0 should already accept the master's pushes. If it works, the log line should stop after the next sync.

If the log line still repeats after updating master and nodes (or after the workaround), please reply with:

  1. The scope of the token each node was enrolled with (admin, monitor or node-sync). This confirms whether this is the cause.
  2. For one affected user: the enable value and expiry/total shown on the master, and on node 2, both as text. That would show which side changes it.

Verdict: Already fixed
Severity: High
Confidence: Medium
Root cause: InboundService.UpdateInbound (internal/web/service/inbound.go:1856) on the node keeps the stored clients/enable unless FromNodeSync is set. In v3.9.0 the controller set it only for the node-sync token scope, so master pushes from admin-token enrollments were ignored. liftClientLifecycleInSettings (client_locks.go:239) then sees the same mismatch every tick and marks the node dirty again. Introduced by 823db059 ("fix(inbounds): keep the stored client list and enable on inbound save"), which is in v3.9.0.
Already fixed: 2ffc694a on main / dev-latest. Not in v3.9.0, so unreleased.
Duplicate of: None
Evidence: client_locks.go:276-278 (lift overrides node enable with the master row); inbound_node.go:1443-1450 (marks dirty, logs the reported line); inbound.go:1856-1858 (node keeps stored clients/enable when not a master push); 2ffc694a diff to controller/inbound.go:70 (svc.FromNodeSync = scope == model.ApiScopeNodeSync || c.GetHeader(wirecodec.MasterPushHeader) != "") and runtime/remote.go (req.Header.Set(wirecodec.MasterPushHeader, "1")); git tag --contains 823db059 → v3.9.0, git tag --contains 2ffc694a → only dev-latest.
Not determined: That node 2 is enrolled with an admin-scope token. That is the condition this cause needs, and the report does not say. Also not settled: whether the visible enable/disable flipping is the same loop or a second effect of it. The token scope in step 1 above would settle the first point.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:6098842704 --> @github-actions[bot] commented on GitHub (Oct 10, 2026): This looks like a v3.9.0 regression that is **already fixed on `main` but not in a release yet**. In v3.9.0 a node ignores the client list and `enable` flag that the master re-pushes whenever the node was enrolled with an ordinary admin API token, which is the default. The master then sees the same mismatch on every traffic sync, logs `lifecycle lift; marking dirty for re-push`, pushes again, and the push is ignored again. **How the loop runs (v3.9.0)** 1. On each sync the master rewrites the node's reported client `enable`/`expiryTime` with its own values. If anything changed, it marks the node dirty. See `internal/web/service/client_locks.go:276-278`: ```go if nodeEnable, _ := cm["enable"].(bool); nodeEnable != tr.Enable { cm["enable"] = tr.Enable changed = true ``` and `internal/web/service/inbound_node.go:1443-1449`, which logs the line you are seeing. 2. Reconcile pushes the inbound to the node. On the node, `UpdateInbound` keeps its *stored* clients and `enable` unless the request counts as a master push (`internal/web/service/inbound.go:1856-1858`): ```go if !s.FromNodeSync { inbound.Settings = keepStoredClients(inbound.Settings, stored.Settings) inbound.Enable = stored.Enable ``` 3. In v3.9.0, a request counted as a master push only when its token had the `node-sync` scope. Nodes enrolled with an `admin` token threw the master's values away, but the push still counted as successful. The next snapshot carried the old `enable` again, so steps 1–3 repeated on every sync tick (the ~6 s you see). **What fixes it** Commit `2ffc694a` ("fix(nodes): let a master's push and reconcile converge node inbounds") makes the master send an `X-3x-Master-Push` header on every request, and the node now honours it (`internal/web/controller/inbound.go:70`). It is on `main` and in the `dev-latest` pre-release, but **not in v3.9.0**. Both sides need the fix: the master sends the header and the node checks it, so update the master **and all 8 nodes** once it ships. **Possible workaround until then (not verified):** on each node, create an API token with scope `node-sync` (Settings → Security → API tokens), then re-enroll that node on the master with this token. With that scope, v3.9.0 should already accept the master's pushes. If it works, the log line should stop after the next sync. If the log line still repeats after updating master and nodes (or after the workaround), please reply with: 1. The scope of the token each node was enrolled with (`admin`, `monitor` or `node-sync`). This confirms whether this is the cause. 2. For one affected user: the `enable` value and expiry/total shown on the master, and on node 2, both as text. That would show which side changes it. Verdict: Already fixed Severity: High Confidence: Medium Root cause: `InboundService.UpdateInbound` (`internal/web/service/inbound.go:1856`) on the node keeps the stored clients/`enable` unless `FromNodeSync` is set. In v3.9.0 the controller set it only for the `node-sync` token scope, so master pushes from admin-token enrollments were ignored. `liftClientLifecycleInSettings` (`client_locks.go:239`) then sees the same mismatch every tick and marks the node dirty again. Introduced by `823db059` ("fix(inbounds): keep the stored client list and enable on inbound save"), which is in v3.9.0. Already fixed: `2ffc694a` on `main` / `dev-latest`. Not in v3.9.0, so unreleased. Duplicate of: None Evidence: `client_locks.go:276-278` (lift overrides node `enable` with the master row); `inbound_node.go:1443-1450` (marks dirty, logs the reported line); `inbound.go:1856-1858` (node keeps stored clients/enable when not a master push); `2ffc694a` diff to `controller/inbound.go:70` (`svc.FromNodeSync = scope == model.ApiScopeNodeSync || c.GetHeader(wirecodec.MasterPushHeader) != ""`) and `runtime/remote.go` (`req.Header.Set(wirecodec.MasterPushHeader, "1")`); `git tag --contains 823db059` → v3.9.0, `git tag --contains 2ffc694a` → only `dev-latest`. Not determined: That node 2 is enrolled with an `admin`-scope token. That is the condition this cause needs, and the report does not say. Also not settled: whether the visible enable/disable flipping is the same loop or a second effect of it. The token scope in step 1 above would settle the first point. _This reply was generated automatically; a maintainer may follow up._ <!-- claude-issue:analyst -->
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#4519
No description provided.