mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5465] [Bug]: v3.3.1 VLESS fallback settings are not saved and do not work. #3823
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#3823
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 @IDontKnower on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5465
Describe the bug
Saving fallback rules didn't appeared in settings json for inbound.
And the opposite, adding fallback settings directly to json didn't appeared in ui inbound wizard.
How to reproduce the problem
Expected behavior
After saving inbound, config has fallbacks section with saved fallback
Actual behavior
After saving, fallback setting didn't appeared in json, fallback didn't work, all traffic goes to vless

Relevant logs
Screenshots
No response
3x-ui version
3.3.1
Xray-core version
26.6.1
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04.4 LTS
Which parts of the panel are affected?
Xray config generation
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
No — direct access
Before submitting
@IDontKnower commented on GitHub (Jun 21, 2026):
https://github.com/MHSanaei/3x-ui/issues/4639
https://github.com/MHSanaei/3x-ui/issues/4748
@github-actions[bot] commented on GitHub (Jun 21, 2026):
Investigated in source (v3.3.1 / main branch). The behavior you are seeing is caused by a design change in the fallback storage architecture introduced in v3.1.0, combined with a point of confusion about which JSON the UI shows.
How fallbacks work in v3.x
Fallbacks are no longer stored inside the inbound's
settings.fallbacksJSON field. Since v3.1.0 they live in a dedicatedinbound_fallbacksdatabase table. Two separate components touch them:inbound_fallbackstable viaGET/POST /panel/api/inbounds/{id}/fallbacks. This is the correct UI for managing fallbacks.settingscolumn of the inbound record — it does not display fallbacks, because they are not stored there.The Xray config is generated at restart time by injecting rows from the
inbound_fallbackstable into the finalsettings.fallbacksarray. The settings JSON stored in the database intentionally omits fallbacks; they are merged in dynamically.This means:
fallbacksin the Advanced tab JSON → does not populate the FallbacksCard. The FallbacksCard reads the table, not the settings JSON. Manual JSON edits tofallbackswill survive a form re-save only until the FallbacksCard has any entries, at which point the table takes precedence. The Advanced editor is not the correct place to manage fallbacks.How to verify the fallback actually saved
After saving in the inbound editor:
dest: 9443), the database write succeeded.XUI_BIN_FOLDER; the default relative to the x-ui binary isbin/config.json.)If the FallbacksCard is empty after reopening
The database write may have failed silently. Open the browser developer tools (F12 → Network tab), reproduce the save, and look for the
POST /panel/api/inbounds/{id}/fallbacksrequest. Check its response body for an error message.Note on VLESS + REALITY + fallbacks
The panel code (
inbound_protocol.go:streamSupportsFallbacks) confirms that REALITY security is eligible for fallbacks alongside TLS. The FallbacksCard will appear and save correctly for VLESS/TCP/REALITY. However, for the fallback to actually route traffic, something must be listening on the destination port (9443 in your example). If nothing is listening there, connections will fail at the network layer rather than being routed by Xray. Xray's fallback fires for non-VLESS traffic on the inbound port and forwards it to the configureddest; the receiving service on that port is outside the panel's control.Summary of the two observations
fallbacksafter FallbacksCard savefallbacksto the Advanced JSON doesn't appear in FallbacksCardPOST /panel/api/inbounds/{id}/fallbackscall may be failingIf you can confirm (1) whether the FallbacksCard is empty when you reopen the inbound, and (2) the contents of the
POST …/fallbacksnetwork response from the browser dev tools, that will pinpoint whether the issue is a save failure or an expectation mismatch.This reply was generated automatically; a maintainer may follow up.
@IDontKnower commented on GitHub (Jun 21, 2026):
Confirm that fallback settings are injected in config.json after x-ui restart
Start caddy with config
which works with sni curl
But trying to curl 443 on xray get me tls issue
In x-ui error.log have this
2026/06/21 16:00:38.322616 [Info] transport/internet/tcp: REALITY: processed invalid connection from 127.0.0.1:51178: server name mismatch: cz-xray-datacheap-1.duckdns.org@IDontKnower commented on GitHub (Jun 21, 2026):
Update caddy config (previous one with error and didn't obtain certificate)
Allow 9443 port in ufw to check direct connect to caddy
Check direct connect to caddy
Check connect through xray
Xray error log
part of config.json with fallbacks
@MHSanaei commented on GitHub (Jun 21, 2026):
Thanks for the very thorough testing — the
config.jsondump and the Caddy setup make this easy to diagnose. Short version: the fallback is being saved and injected correctly. What you're hitting is how REALITY handles non-REALITY traffic, which is expectedxray-corebehavior, not a panel bug.Let me separate the two things you observed.
1. Fallbacks not showing in the Advanced JSON — expected
Since v3.1.0 fallbacks are not stored in the inbound's
settingscolumn. They live in a dedicatedinbound_fallbackstable and are merged intosettings.fallbacksonly at config-generation time. So:settingscolumn, which intentionally never containsfallbacks.Your
config.jsonalready proves the save + injection worked:That row went table → generated config exactly as designed.
2. The fallback "doesn't route traffic" — this is REALITY, not a bug
This is the important part, and it corrects the earlier automated reply (which described TLS fallback behavior — REALITY is different).
REALITY intercepts the TLS handshake at the transport layer, before the VLESS proxy ever sees the connection. There are three possible outcomes:
Valid REALITY client → REALITY decrypts and hands the stream to VLESS. Only here, if the inner stream is not valid VLESS, does the VLESS
fallbackslist fire.Non-REALITY client, SNI matches
serverNames→ REALITY transparently relays the connection to the camouflage target (realitySettings.target/dest) so the probe sees the borrowed certificate. The VLESSfallbacksare not consulted.Non-REALITY client, SNI not in
serverNames→ REALITY rejects the connection. That is exactly your log line:A
curl/browser is never a valid REALITY client, so it can only ever land in case 2 or 3 — it can never reach the VLESSfallbacksentry at127.0.0.1:9443. That fallback only catches traffic that has already authenticated as REALITY+VLESS and then carries non-VLESS data, which an external probe cannot produce.So the fallback is wired correctly; it just isn't reachable the way the test expects.
One more note on your second test:
cz-xray-datacheap-1.duckdns.orgresolves to the server's own IP (45.151.183.140), so the request goes out throughfreedomand loops back into the server's own REALITY inbound — that's why you seeproxy/freedom: dialing to ... 45.151.183.140:443right before the mismatch. That's a routing loop, not the fallback firing.What to do instead
curl/a browser), use TLS with a real certificate + fallbacks. That's the classic VLESS-fallback setup, and the Fallbacks card works the same way for it.target+serverNamesinrealitySettings, not the VLESSfallbackslist. Point those at the site you want probes to see.This is working as designed rather than a panel bug, but happy to dig further if your setup differs from the above. Thanks again for the detailed write-up.