mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5963] [Bug]: Fallbacks are not replicated to Nodes. #4132
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#4132
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 @iv7777 on GitHub (Jul 15, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5963
Describe the bug
I have setup a couple Nodes in one main panel. When I change the Fallbacks in the main panel for a remote node, the settings do not syne down to the node. Check the remote note and the Fallbacks is empty. Setting the Fallbacks in the node does not sync up to the main panel either.
How to reproduce the problem
Expected behavior
Fallbacks are expected to synced between the main panel and the remote nodes.
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.5
Xray-core version
26.7.11
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu v24
Which parts of the panel are affected?
Frontend (UI / panel pages), Multi-node (sub-nodes)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
No response
Before submitting
@github-actions[bot] commented on GitHub (Jul 15, 2026):
Confirmed as a real defect: fallback rules do not cross the master↔node boundary in either direction, and the root cause is fully traceable in the current code.
Title: Fallback rules are excluded from both the master→node push and the node→master pull
Severity: Medium
Category: Correctness
Why this matters:
Fallbacks are not part of an inbound's
settingsJSON at rest — they live in a separateinbound_fallbackstable (model.InboundFallback,internal/database/model/model.go:933-945), whosemaster_id/child_idreference localinbounds.idrows. That table only gets merged into the actualsettings.fallbacksarray insideXrayService.GetXrayConfig(internal/web/service/xray.go:109, merge logic at lines 231-244 viaFallbackService.BuildFallbacksJSON) — the function that builds the config for the locally-run Xray-core process. That same function explicitly skips node-hosted inbounds a few lines earlier:So for any inbound assigned to a node, this merge never runs on the master.
setFallbacks(internal/web/controller/inbound.go:459-479) does persist your fallback rows to the master's owninbound_fallbackstable and callsxrayService.SetToNeedRestart()— but that only restarts the master's own local Xray process, which (per the skip above) never runs node inbounds anyway. The actual payload pushed to a node — built bywireInbound()ininternal/web/runtime/remote.go:744-774and used byAddInbound/UpdateInbound/ReconcileInbound— setssettingsstraight from the rawib.SettingsDB column and never callsBuildFallbacksJSON. So the rule is saved centrally but never transmitted to the node, regardless of when or how often a resync runs.FetchTrafficSnapshot(internal/web/runtime/remote.go:694-728) only fetchespanel/api/inbounds/list(again the rawsettingscolumn) plus online-client data. Host/TLS overrides do have a dedicated fetch (FetchHostGroups/panel/api/hosts/list), but there is no equivalent endpoint exposing a node's owninbound_fallbacksrows back to the master.This matches the reported repro exactly: fallbacks set on either side are invisible to the other.
Recommendation: Two separate fixes are needed, since
child_idis a foreign key local to whichever panel's database holds it and can't be shipped as-is to the other side:wireInbound(), resolve the master's fallback rows for that inbound (reusingFallbackService.BuildFallbacksJSON, which already resolves a child inbound to ahost:portdeststring) and merge the result into the outgoingsettingsJSON, mirroring whatGetXrayConfigalready does for locally-run inbounds.panel/api/hosts/list/FetchHostGroupsthat exposes the node's owninbound_fallbacksrows, and adopt it in the traffic-snapshot flow (FetchTrafficSnapshotplussetRemoteTrafficLockedininternal/web/service/inbound_node.go), translating the node's local child-inbound IDs to the master's corresponding central inbound IDs.A maintainer should decide which side is authoritative (master pushes only vs. genuine two-way merge) before implementing, since naive bidirectional sync can conflict if both panels are edited between polls.
Confidence: High for the root cause — traced end to end through the exact functions above on the current
mainbranch (matches the reported v3.5.0). The two-fix split above is a suggested approach, not a spec; a fix will only be made if @MHSanaei requests it by mentioning @claude.@MHSanaei
This reply was generated automatically; a maintainer may follow up.
@MHSanaei commented on GitHub (Jul 23, 2026):
Fixed in #6083. The node runtime payload now injects settings.fallbacks and the reconcile job fingerprints it, so inbound fallbacks replicate to nodes.