[GH-ISSUE #5605] [Bug]: Creating any load balancer causes a crash. #3913

Closed
opened 2026-10-31 20:35:51 +07:00 by bsakaguchi · 3 comments
Owner

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.

    "balancers": [
      {
        "tag": "OverProxy",
        "selector": [
          "opera-proxy"
        ],
        "fallbackTag": "warp"
      }
    ]

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

  • 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 @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. ``` "balancers": [ { "tag": "OverProxy", "selector": [ "opera-proxy" ], "fallbackTag": "warp" } ] ``` 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 ```shell ``` ### 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 - [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:35:51 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@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 fallbackTag serialized as ""

When a balancer is created or edited without selecting a fallback outbound, the panel persists "fallbackTag": "" to the Xray config template (see frontend/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: the fallbackTag field should be omitted from the serialized config entirely when it is empty, consistent with how the BalancerObjectSchema declares it (z.string().optional()) and with what valid minimal fixtures look like (see frontend/src/test/golden/fixtures/balancer/random-minimal.json, which has no fallbackTag at 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:

{
  "tag": "OverProxy",
  "selector": ["opera-proxy"],
  "fallbackTag": "warp"
}

Xray-core requires fallbackTag to be an exact match to a registered outbound handler tag. If no outbound with the tag "warp" exists in the generated config's outbounds array, xray fails at startup with the same not all dependencies are resolved error. The selector field uses prefix matching at runtime and does not cause a startup failure if nothing matches, but fallbackTag is a hard startup dependency.

Workaround

To unblock yourself immediately:

  1. In the panel UI, go to Xray Settings → Balancers, open the balancer for editing, and either:
    • Remove the fallback tag (clear the Fallback field), or
    • Set it to an outbound tag that actually exists in your Xray Settings → Outbounds list (e.g. "direct" if you have a direct outbound).
  2. Ensure at least one outbound in your template has a tag that starts with "opera-proxy", or change the selector to prefix-match an outbound that does exist.
  3. Save and restart Xray.

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.balancers array, correct the fallbackTag value (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/getConfig endpoint returns the full generated config.


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

<!-- gh-comment-id:4816134308 --> @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 `fallbackTag` serialized as `""`** When a balancer is created or edited without selecting a fallback outbound, the panel persists `"fallbackTag": ""` to the Xray config template (see `frontend/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: the `fallbackTag` field should be omitted from the serialized config entirely when it is empty, consistent with how the `BalancerObjectSchema` declares it (`z.string().optional()`) and with what valid minimal fixtures look like (see `frontend/src/test/golden/fixtures/balancer/random-minimal.json`, which has no `fallbackTag` at 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: ```json { "tag": "OverProxy", "selector": ["opera-proxy"], "fallbackTag": "warp" } ``` Xray-core requires `fallbackTag` to be an exact match to a registered outbound handler tag. If no outbound with the tag `"warp"` exists in the generated config's `outbounds` array, xray fails at startup with the same `not all dependencies are resolved` error. The `selector` field uses prefix matching at runtime and does not cause a startup failure if nothing matches, but `fallbackTag` is a hard startup dependency. **Workaround** To unblock yourself immediately: 1. In the panel UI, go to **Xray Settings → Balancers**, open the balancer for editing, and either: - Remove the fallback tag (clear the Fallback field), or - Set it to an outbound tag that actually exists in your **Xray Settings → Outbounds** list (e.g. `"direct"` if you have a direct outbound). 2. Ensure at least one outbound in your template has a tag that starts with `"opera-proxy"`, or change the selector to prefix-match an outbound that does exist. 3. Save and restart Xray. 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.balancers` array, correct the `fallbackTag` value (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/getConfig` endpoint returns the full generated config. --- *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@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:

"balancers": [
  {
    "fallbackTag": "direct",
    "selector": [
      "opera-proxy"
    ],
    "tag": "OverProxy"
  }
]
<!-- gh-comment-id:4816332998 --> @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: ``` "balancers": [ { "fallbackTag": "direct", "selector": [ "opera-proxy" ], "tag": "OverProxy" } ] ```
Author
Owner

@MHSanaei commented on GitHub (Jun 27, 2026):

Root cause

When a load balancer sets a fallbackTag, xray-core's random/roundRobin strategy requires an Observatory feature — RandomStrategy/RoundRobinStrategy.InjectContext calls RequireFeatures(Observatory) whenever the fallback is non-empty. The panel was not emitting an observatory/burstObservatory section for these strategies, so xray-core aborted startup with:

core: not all dependencies are resolved

The reported config (the default random strategy with fallbackTag: warp) hits exactly this path. Balancers without a fallbackTag, and leastPing/leastLoad (which already got an observer), were unaffected.

Fix

The panel now creates a burst observatory automatically for random/roundRobin balancers that declare a fallbackTag, and the observer is strictly requirement-driven — clearing the last fallbackTag (or removing the strategy that needed it) drops the observer again instead of leaving a dead section.

Fixed in 797b08cd.

<!-- gh-comment-id:4816490442 --> @MHSanaei commented on GitHub (Jun 27, 2026): **Root cause** When a load balancer sets a `fallbackTag`, xray-core's `random`/`roundRobin` strategy requires an `Observatory` feature — `RandomStrategy`/`RoundRobinStrategy.InjectContext` calls `RequireFeatures(Observatory)` whenever the fallback is non-empty. The panel was not emitting an `observatory`/`burstObservatory` section for these strategies, so xray-core aborted startup with: ``` core: not all dependencies are resolved ``` The reported config (the default `random` strategy with `fallbackTag: warp`) hits exactly this path. Balancers without a `fallbackTag`, and `leastPing`/`leastLoad` (which already got an observer), were unaffected. **Fix** The panel now creates a burst observatory automatically for `random`/`roundRobin` balancers that declare a `fallbackTag`, and the observer is strictly requirement-driven — clearing the last `fallbackTag` (or removing the strategy that needed it) drops the observer again instead of leaving a dead section. Fixed in 797b08cd.
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#3913
No description provided.