mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5078] [Bug]: Adding a Fallback to another Inbound changes the Fallback's Subscription IP and port #3575
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#3575
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 @herotm on GitHub (Jun 8, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5078
Describe the bug
I added a Fallback to a Inbound, went to update my subscription on my app, then realized the Fallback's ip and port was changed to the original one.
How to reproduce the problem
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?
Docker / Docker Compose
Operating system
Ubuntu 26.04
Which parts of the panel are affected?
Subscription (share links / Clash / JSON)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 8, 2026):
Thanks for the report. I traced how the subscription generator handles fallback children in the current code (v3.2.8).
What the code does
sub/subService.go—projectThroughFallbackMaster()— runs on every inbound before its subscription link is generated. It looks up theinbound_fallbackstable for a matchingchild_id = <inbound.Id>row and, if found, replaces the child'sListen,Port, and TLS/security stream settings with the master's values.Crucially, it only does this when the child inbound's
Listenfield is "internal only" (listenIsInternalOnly, lines 99-107):127.0.0.1,::1, etc.@or/"", i.e. wildcard / all interfaces) → projection does NOT happen — the child advertises its own port/address.So whether the fallback subscription is rewritten depends entirely on what the child inbound's Listen field is set to.
Why this matters for your setup
When you use the panel's fallback feature,
BuildFallbacksJSON(web/service/fallback.golines 130-134) writes the Xray config with the fallback destination set to127.0.0.1:<child_port>whenever the child's Listen is empty or0.0.0.0. This is correct for Xray — the parent forwards traffic internally. However, the child's storedListenin the database is not modified by adding a fallback.Subscription projection only fires when the stored
Listenis a loopback or socket address. If your child inbound has an explicitListen = 127.0.0.1, it cannot be reached directly by external clients — so showing the master's address and port in the subscription is the intended behavior.To narrow down the actual bug
Please share the following:
0.0.0.0,127.0.0.1, or something else)If the child's Listen is empty or a public address and the subscription is still being rewritten to the master's port, that would be a genuine bug in the guard logic and we'd want to dig into the exact Xray/DB state.
@routegg commented on GitHub (Jun 9, 2026):
fallback is not working
@MHSanaei commented on GitHub (Jun 11, 2026):
Fixed in
2b4e199a. Subscription output now only projects an inbound through a fallback master when that inbound listens on an internal-only address (loopback or a unix socket). Inbounds bound to a public/wildcard address advertise their own port and security settings again, so adding a fallback that points at another inbound no longer rewrites that inbound''s subscription IP/port. The fix will be in the next release.