mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5605] [Bug]: Creating any load balancer causes a crash. #3913
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#3913
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 @sc16me on GitHub (Jun 27, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5605
Describe the bug
Creating any load balancer results in an error. This issue has been reproduced on two servers running versions 3.4.0 and 3.4.1.
2026/06/27 10:28:01 ERROR - X-UI: Failure in running xray-core:exit status 23
2026/06/27 10:28:01 ERROR - XRAY: Failed to start: main: failed to create server > core: not all dependencies are resolved.
How to reproduce the problem
Create any load balancer and restart Xray.
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.4.1
Xray-core version
26.6.22
How did you install 3x-ui?
install.sh script
Operating system
Debian 13
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
@github-actions[bot] commented on GitHub (Jun 27, 2026):
There are two distinct causes here that can both produce the same error:
core: not all dependencies are resolved.Cause 1 — panel bug: empty
fallbackTagserialized as""When a balancer is created or edited without selecting a fallback outbound, the panel persists
"fallbackTag": ""to the Xray config template (seefrontend/src/pages/xray/balancers/BalancersTab.tsx, line 161:fallbackTag: form.fallbackTag || ''). Xray-core treats""as a reference to an outbound with an empty tag, which does not exist, and fails to start. This is a code defect in the frontend: thefallbackTagfield should be omitted from the serialized config entirely when it is empty, consistent with how theBalancerObjectSchemadeclares it (z.string().optional()) and with what valid minimal fixtures look like (seefrontend/src/test/golden/fixtures/balancer/random-minimal.json, which has nofallbackTagat all). This bug would cause any balancer saved without an explicit fallback to crash Xray.Cause 2 — non-existent outbound tags in your specific config
Your reported balancer includes:
Xray-core requires
fallbackTagto be an exact match to a registered outbound handler tag. If no outbound with the tag"warp"exists in the generated config'soutboundsarray, xray fails at startup with the samenot all dependencies are resolvederror. Theselectorfield uses prefix matching at runtime and does not cause a startup failure if nothing matches, butfallbackTagis a hard startup dependency.Workaround
To unblock yourself immediately:
"direct"if you have a direct outbound)."opera-proxy", or change the selector to prefix-match an outbound that does exist.If editing via the panel is not possible because Xray won't start, you can open the stored template directly: go to Xray Settings → JSON Editor (or Xray Config Template in the panel), find the
routing.balancersarray, correct thefallbackTagvalue (or remove the key entirely), and save.If you need to confirm the exact outbound tags available in the generated config, the Xray Settings page shows all configured outbounds; alternatively, the
/panel/api/xray/getConfigendpoint returns the full generated config.This reply was generated automatically; a maintainer may follow up.
@sc16me commented on GitHub (Jun 27, 2026):
If I create the OverProxy balancer without specifying a fallback, everything works. As soon as I add any fallback, it causes an error—even when I set it to direct. Of course, the direct outbound exists.
After adding it, the configuration looks like this:
@MHSanaei commented on GitHub (Jun 27, 2026):
Root cause
When a load balancer sets a
fallbackTag, xray-core'srandom/roundRobinstrategy requires anObservatoryfeature —RandomStrategy/RoundRobinStrategy.InjectContextcallsRequireFeatures(Observatory)whenever the fallback is non-empty. The panel was not emitting anobservatory/burstObservatorysection for these strategies, so xray-core aborted startup with:The reported config (the default
randomstrategy withfallbackTag: warp) hits exactly this path. Balancers without afallbackTag, andleastPing/leastLoad(which already got an observer), were unaffected.Fix
The panel now creates a burst observatory automatically for
random/roundRobinbalancers that declare afallbackTag, and the observer is strictly requirement-driven — clearing the lastfallbackTag(or removing the strategy that needed it) drops the observer again instead of leaving a dead section.Fixed in
797b08cd.