[GH-ISSUE #5892] [Bug]: Load Balancer ignores configured outbounds and randomly uses other outbounds / لود بالانسر اوت‌باندهای تعریف‌شده را نادیده می‌گیرد و از اوت‌باندهای دیگر استف… #4085

Closed
opened 2026-10-31 20:37:04 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @montiego on GitHub (Jul 10, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5892

Describe the bug

English

Title

Load Balancer ignores configured outbounds and randomly uses other outbounds

Description

I found an issue with the Load Balancer.

I created a Load Balancer and explicitly assigned only a specific set of outbounds to it. However, after running for some time, the Load Balancer unexpectedly starts using other outbounds that were not assigned to it.

Expected behavior:

  • The Load Balancer should only select from the outbounds explicitly configured in its outbound list.

Actual behavior:

  • It occasionally ignores the configured outbound list and routes traffic through other outbounds that are not part of the Load Balancer configuration.

This causes incorrect routing and makes the Load Balancer unreliable.

Please investigate whether this is a bug in the Load Balancer implementation.


فارسی

عنوان

لود بالانسر اوت‌باندهای تعریف‌شده را نادیده می‌گیرد و از اوت‌باندهای دیگر استفاده می‌کند

توضیحات

یک مشکل در بخش Load Balancer وجود دارد.

برای Load Balancer فقط چند Outbound مشخص تعریف کرده‌ام، اما بعد از مدتی مشاهده می‌کنم که به جای استفاده از همان Outboundهای تعریف‌شده، از Outboundهای دیگری که اصلاً داخل Load Balancer قرار نداده‌ام استفاده می‌کند.

رفتار مورد انتظار:

  • Load Balancer فقط باید از Outboundهایی که به آن اختصاص داده شده‌اند استفاده کند.

رفتار فعلی:

  • گاهی اوقات لیست Outboundهای تعریف‌شده را نادیده می‌گیرد و ترافیک را از Outboundهای دیگری که در Load Balancer تعریف نشده‌اند عبور می‌دهد.

این موضوع باعث می‌شود مسیریابی اشتباه انجام شود و Load Balancer قابل اعتماد نباشد.

لطفاً بررسی کنید که آیا این مورد یک باگ در پیاده‌سازی Load Balancer است یا خیر.

How to reproduce the problem

English

Title

Load Balancer ignores configured outbounds and randomly uses other outbounds

Description

I found an issue with the Load Balancer.

I created a Load Balancer and explicitly assigned only a specific set of outbounds to it. However, after running for some time, the Load Balancer unexpectedly starts using other outbounds that were not assigned to it.

Expected behavior:

  • The Load Balancer should only select from the outbounds explicitly configured in its outbound list.

Actual behavior:

  • It occasionally ignores the configured outbound list and routes traffic through other outbounds that are not part of the Load Balancer configuration.

This causes incorrect routing and makes the Load Balancer unreliable.

Please investigate whether this is a bug in the Load Balancer implementation.


فارسی

عنوان

لود بالانسر اوت‌باندهای تعریف‌شده را نادیده می‌گیرد و از اوت‌باندهای دیگر استفاده می‌کند

توضیحات

یک مشکل در بخش Load Balancer وجود دارد.

برای Load Balancer فقط چند Outbound مشخص تعریف کرده‌ام، اما بعد از مدتی مشاهده می‌کنم که به جای استفاده از همان Outboundهای تعریف‌شده، از Outboundهای دیگری که اصلاً داخل Load Balancer قرار نداده‌ام استفاده می‌کند.

رفتار مورد انتظار:

  • Load Balancer فقط باید از Outboundهایی که به آن اختصاص داده شده‌اند استفاده کند.

رفتار فعلی:

  • گاهی اوقات لیست Outboundهای تعریف‌شده را نادیده می‌گیرد و ترافیک را از Outboundهای دیگری که در Load Balancer تعریف نشده‌اند عبور می‌دهد.

این موضوع باعث می‌شود مسیریابی اشتباه انجام شود و Load Balancer قابل اعتماد نباشد.

لطفاً بررسی کنید که آیا این مورد یک باگ در پیاده‌سازی Load Balancer است یا خیر.

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.4.2 - dev

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 24

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 @montiego on GitHub (Jul 10, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5892 ### Describe the bug ## English ### Title **Load Balancer ignores configured outbounds and randomly uses other outbounds** ### Description I found an issue with the Load Balancer. I created a Load Balancer and explicitly assigned only a specific set of outbounds to it. However, after running for some time, the Load Balancer unexpectedly starts using other outbounds that were **not** assigned to it. Expected behavior: * The Load Balancer should only select from the outbounds explicitly configured in its outbound list. Actual behavior: * It occasionally ignores the configured outbound list and routes traffic through other outbounds that are not part of the Load Balancer configuration. This causes incorrect routing and makes the Load Balancer unreliable. Please investigate whether this is a bug in the Load Balancer implementation. --- ## فارسی ### عنوان **لود بالانسر اوت‌باندهای تعریف‌شده را نادیده می‌گیرد و از اوت‌باندهای دیگر استفاده می‌کند** ### توضیحات یک مشکل در بخش Load Balancer وجود دارد. برای Load Balancer فقط چند Outbound مشخص تعریف کرده‌ام، اما بعد از مدتی مشاهده می‌کنم که به جای استفاده از همان Outboundهای تعریف‌شده، از Outboundهای دیگری که اصلاً داخل Load Balancer قرار نداده‌ام استفاده می‌کند. **رفتار مورد انتظار:** * Load Balancer فقط باید از Outboundهایی که به آن اختصاص داده شده‌اند استفاده کند. **رفتار فعلی:** * گاهی اوقات لیست Outboundهای تعریف‌شده را نادیده می‌گیرد و ترافیک را از Outboundهای دیگری که در Load Balancer تعریف نشده‌اند عبور می‌دهد. این موضوع باعث می‌شود مسیریابی اشتباه انجام شود و Load Balancer قابل اعتماد نباشد. لطفاً بررسی کنید که آیا این مورد یک باگ در پیاده‌سازی Load Balancer است یا خیر. ### How to reproduce the problem ## English ### Title **Load Balancer ignores configured outbounds and randomly uses other outbounds** ### Description I found an issue with the Load Balancer. I created a Load Balancer and explicitly assigned only a specific set of outbounds to it. However, after running for some time, the Load Balancer unexpectedly starts using other outbounds that were **not** assigned to it. Expected behavior: * The Load Balancer should only select from the outbounds explicitly configured in its outbound list. Actual behavior: * It occasionally ignores the configured outbound list and routes traffic through other outbounds that are not part of the Load Balancer configuration. This causes incorrect routing and makes the Load Balancer unreliable. Please investigate whether this is a bug in the Load Balancer implementation. --- ## فارسی ### عنوان **لود بالانسر اوت‌باندهای تعریف‌شده را نادیده می‌گیرد و از اوت‌باندهای دیگر استفاده می‌کند** ### توضیحات یک مشکل در بخش Load Balancer وجود دارد. برای Load Balancer فقط چند Outbound مشخص تعریف کرده‌ام، اما بعد از مدتی مشاهده می‌کنم که به جای استفاده از همان Outboundهای تعریف‌شده، از Outboundهای دیگری که اصلاً داخل Load Balancer قرار نداده‌ام استفاده می‌کند. **رفتار مورد انتظار:** * Load Balancer فقط باید از Outboundهایی که به آن اختصاص داده شده‌اند استفاده کند. **رفتار فعلی:** * گاهی اوقات لیست Outboundهای تعریف‌شده را نادیده می‌گیرد و ترافیک را از Outboundهای دیگری که در Load Balancer تعریف نشده‌اند عبور می‌دهد. این موضوع باعث می‌شود مسیریابی اشتباه انجام شود و Load Balancer قابل اعتماد نباشد. لطفاً بررسی کنید که آیا این مورد یک باگ در پیاده‌سازی Load Balancer است یا خیر. ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.4.2 - dev ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 24 ### 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:37:04 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jul 10, 2026):

This is very likely not a code defect, but a consequence of how balancer selector matching works: entries in a balancer's selector array are matched as tag prefixes against outbound tags by Xray-core, not as exact tags. 3x-ui does not enforce or convert this to exact matching anywhere in the stack.

Confirmed in the source

  • The Selector field in the Add/Edit Balancer dialog (frontend/src/pages/xray/balancers/BalancerFormModal.tsx:241-247) is a free-form Select in mode="tags" — you can pick an existing outbound tag or type any string, and it is stored verbatim in the selector array (frontend/src/schemas/routing.ts:74: selector: z.array(z.string()).min(1)). Neither the frontend nor the backend validates that these strings are exact, unique outbound tags; the array is passed straight through into the saved Xray config's routing.balancers[].selector, with no additional processing in internal/xray or internal/web/service.
  • The panel's own documentation states this directly: "A balancer groups outbounds by a selector (tag prefixes, including the wildcard pools from outbound subscriptions)" (docs/content/docs/en/operations/outbounds-routing.mdx:132-134).
  • The same page documents the effect on Outbound subscriptions (server pools): "Imported outbounds get stable tags: the same server keeps the same tag across refreshes, so exact-tag routing/balancer selectors stay pinned — while prefix/wildcard selectors (e.g. hk-*) automatically pick up new servers as the pool changes" (lines 103-105).
  • The backend has a matching design comment in internal/web/service/outbound_subscription.go:522-559 ("Tag stability strategy... important for balancers and routing"): an exact-tag selector stays pinned to one server, but "if you use a prefix/wildcard selector..., then any new servers that the subscription later returns will automatically be eligible for that balancer on the next Xray reload."
  • The repo's own test fixture for a random balancer (frontend/src/test/golden/fixtures/balancer/random-minimal.json) models selector as ["proxy-"] — a prefix, not a full tag — which is the pattern the codebase itself expects.

Why this produces exactly the symptom described

If any outbound tag elsewhere in your config happens to start with one of the strings in this balancer's selector (e.g. your selector is "server-1" but you also have an unrelated outbound tagged "server-10" or "server-1-backup"), Xray-core treats that outbound as a member of the balancer too, even though the panel's form never suggested it as a match. If the outbounds come from an Outbound Subscription and your selector is (or resembles) a prefix, new servers pulled in by later subscription refreshes silently join the balancer as well — which lines up with the "after running for some time" part of your report, since that only happens on the next refresh/reload, not at creation time.

How to check this yourself

  • Go to Xray Configs → Balancers. The Selector column shows exactly the strings you configured. Hover the Live Target column for this row — its tooltip lists the outbound(s) Xray-core currently reports as selected for the balancer (from RoutingService.GetBalancerInfo, internal/xray/api.go:260-283). A tag there that you never put in Selector confirms a prefix overlap.
  • Confirm the Override dropdown for that row is empty, not orange — a manually set override (internal/web/service/xray.go:907-929) forces one specific outbound and is a separate, admin-triggered feature, unrelated to strategy selection.
  • Check the full outbounds list in Xray Settings for any tag that starts with one of this balancer's selector strings.

What would help confirm this

  1. The exact selector array of the affected balancer, plus the full list of outbound tags in your Xray config (tags only are enough, no need for hosts/credentials).
  2. Whether the outbounds involved come from an Outbound Subscription (Xray Configs → Outbound Subscriptions), and if so its tagPrefix.
  3. What the Live Target tooltip shows next time the unexpected outbound is used.

If your selector strings turn out to be exact, non-overlapping tags with no subscription involved and Xray-core is still adding outbounds you did not configure, that would point to a genuine bug and is worth a follow-up with the details above — this is why the issue is being kept open rather than closed.

A smaller, related gap: unlike the Fallback field, which has an explanatory hint (fallbackBalancerHint, internal/web/translation/en-US.json:1875), the Selector field has no hint text about this prefix-matching behavior, so it is easy to trip over even for careful users. That would be a reasonable UX improvement (a short hint, or a warning when two selector entries overlap as prefixes), separate from the underlying routing behavior itself, which is inherited from Xray-core.

@MHSanaei tagging for visibility.


نسخه فارسی

به احتمال زیاد این یک باگ در کد نیست، بلکه نتیجه‌ی نحوه‌ی تطبیق فیلد selector در Balancer است: مقادیری که در آرایه‌ی selector یک بالانسر قرار می‌دهید توسط Xray-core به‌صورت پیشوند (prefix) روی تگ outbound تطبیق داده می‌شوند، نه به‌صورت تطبیق دقیق و کامل. 3x-ui در هیچ لایه‌ای این را به تطبیق دقیق تبدیل نمی‌کند.

آنچه در سورس کد تایید شد

فیلد Selector در دیالوگ افزودن/ویرایش Balancer
(frontend/src/pages/xray/balancers/BalancerFormModal.tsx:241-247)
یک Select آزاد در حالت tags است؛ می‌توانید یک تگ موجود را انتخاب کنید یا هر رشته‌ای تایپ کنید، و همان مقدار عیناً در آرایه‌ی selector ذخیره می‌شود
(frontend/src/schemas/routing.ts:74).
نه فرانت‌اند و نه بک‌اند این رشته‌ها را به‌عنوان تگ‌های دقیق و یکتا اعتبارسنجی نمی‌کنند؛ این آرایه عیناً وارد بخش
routing.balancers[].selector
کانفیگ ذخیره‌شده‌ی Xray می‌شود.

مستندات خود پروژه هم همین را می‌گوید:
«A balancer groups outbounds by a selector (tag prefixes, including the wildcard pools from outbound subscriptions)»
(docs/content/docs/en/operations/outbounds-routing.mdx:132-134).
همین صفحه درباره‌ی Outbound Subscriptions می‌گوید تگ‌های exact در selector همیشه به همان سرور ثابت می‌مانند، اما selectorهای prefix/wildcard (مثل hk-*) با هر رفرش، سرورهای جدیدی که subscription برمی‌گرداند را هم به‌طور خودکار وارد بالانسر می‌کنند (همان فایل، خطوط 103-105). کامنت طراحی در
internal/web/service/outbound_subscription.go:522-559
دقیقاً همین رفتار را برای بالانسرهای متکی به Subscription توضیح می‌دهد.

چرا این دقیقاً همان رفتاری‌ست که گزارش کرده‌اید

اگر تگ هر outbound دیگری در کانفیگ شما با یکی از رشته‌های selector این بالانسر شروع شود (مثلاً selector شما "server-1" است ولی outbound دیگری به نام "server-10" یا "server-1-backup" هم دارید)، Xray-core آن را هم عضو همین بالانسر در نظر می‌گیرد. اگر از Outbound Subscription استفاده می‌کنید و selector شما شبیه یک prefix است، سرورهای جدیدی که در رفرش‌های بعدی subscription اضافه می‌شوند هم به‌طور خودکار به بالانسر ملحق می‌شوند؛ این دقیقاً با بخش «بعد از مدتی» در گزارش شما هم‌خوانی دارد، چون این اتفاق فقط در رفرش/ریلود بعدی رخ می‌دهد، نه در لحظه‌ی ساخت بالانسر.

چطور خودتان بررسی کنید

به بخش Xray Configs → Balancers بروید. ستون Selector دقیقاً همان رشته‌هایی را نشان می‌دهد که تعریف کرده‌اید. روی ستون Live Target همین ردیف نگه دارید؛ tooltip آن outboundهایی که Xray-core در حال حاضر واقعاً عضو این بالانسر گزارش می‌دهد را نشان می‌دهد. اگر تگی در آن tooltip دیدید که در Selector اضافه نکرده‌اید، یعنی تطبیق prefix رخ داده است. همچنین مطمئن شوید ستون Override همین ردیف خالی است، نه نارنجی؛ override یک قابلیت جدا و دستی است
(internal/web/service/xray.go:907-929)
و ربطی به انتخاب استراتژی ندارد.

برای تایید نهایی به این موارد نیاز است

۱. آرایه‌ی دقیق selector بالانسر مورد نظر و لیست کامل تگ‌های outbound در کانفیگ شما (فقط تگ‌ها کافی است).
۲. اینکه آیا outboundهای درگیر از یک Outbound Subscription می‌آیند یا نه، و در صورت استفاده، مقدار tagPrefix آن.
۳. مقداری که ستون Live Target دفعه‌ی بعد که این اتفاق افتاد نشان می‌دهد.

اگر مشخص شد رشته‌های selector شما دقیق و بدون همپوشانی هستند، از Subscription هم استفاده نمی‌کنید، و بازهم Xray-core outboundهای خارج از تعریف را انتخاب می‌کند، آن‌وقت واقعاً جای بررسی بیشتر دارد؛ به همین دلیل این ایشو به‌جای بسته‌شدن، باز نگه داشته می‌شود.

@MHSanaei برای اطلاع تگ شد.


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

<!-- gh-comment-id:4933642353 --> @github-actions[bot] commented on GitHub (Jul 10, 2026): This is very likely not a code defect, but a consequence of how balancer `selector` matching works: entries in a balancer's `selector` array are matched as **tag prefixes** against outbound tags by Xray-core, not as exact tags. 3x-ui does not enforce or convert this to exact matching anywhere in the stack. **Confirmed in the source** - The Selector field in the Add/Edit Balancer dialog (`frontend/src/pages/xray/balancers/BalancerFormModal.tsx:241-247`) is a free-form `Select` in `mode="tags"` — you can pick an existing outbound tag or type any string, and it is stored verbatim in the `selector` array (`frontend/src/schemas/routing.ts:74`: `selector: z.array(z.string()).min(1)`). Neither the frontend nor the backend validates that these strings are exact, unique outbound tags; the array is passed straight through into the saved Xray config's `routing.balancers[].selector`, with no additional processing in `internal/xray` or `internal/web/service`. - The panel's own documentation states this directly: "A balancer groups outbounds by a selector (tag prefixes, including the wildcard pools from outbound subscriptions)" (`docs/content/docs/en/operations/outbounds-routing.mdx:132-134`). - The same page documents the effect on **Outbound subscriptions** (server pools): "Imported outbounds get stable tags: the same server keeps the same tag across refreshes, so exact-tag routing/balancer selectors stay pinned — while prefix/wildcard selectors (e.g. `hk-*`) automatically pick up new servers as the pool changes" (lines 103-105). - The backend has a matching design comment in `internal/web/service/outbound_subscription.go:522-559` ("Tag stability strategy... important for balancers and routing"): an exact-tag selector stays pinned to one server, but "if you use a *prefix/wildcard* selector..., then any *new* servers that the subscription later returns will automatically be eligible for that balancer on the next Xray reload." - The repo's own test fixture for a `random` balancer (`frontend/src/test/golden/fixtures/balancer/random-minimal.json`) models `selector` as `["proxy-"]` — a prefix, not a full tag — which is the pattern the codebase itself expects. **Why this produces exactly the symptom described** If any outbound tag elsewhere in your config happens to start with one of the strings in this balancer's `selector` (e.g. your selector is `"server-1"` but you also have an unrelated outbound tagged `"server-10"` or `"server-1-backup"`), Xray-core treats that outbound as a member of the balancer too, even though the panel's form never suggested it as a match. If the outbounds come from an **Outbound Subscription** and your selector is (or resembles) a prefix, new servers pulled in by later subscription refreshes silently join the balancer as well — which lines up with the "after running for some time" part of your report, since that only happens on the next refresh/reload, not at creation time. **How to check this yourself** - Go to **Xray Configs → Balancers**. The **Selector** column shows exactly the strings you configured. Hover the **Live Target** column for this row — its tooltip lists the outbound(s) Xray-core currently reports as selected for the balancer (from `RoutingService.GetBalancerInfo`, `internal/xray/api.go:260-283`). A tag there that you never put in Selector confirms a prefix overlap. - Confirm the **Override** dropdown for that row is empty, not orange — a manually set override (`internal/web/service/xray.go:907-929`) forces one specific outbound and is a separate, admin-triggered feature, unrelated to strategy selection. - Check the full `outbounds` list in Xray Settings for any tag that starts with one of this balancer's selector strings. **What would help confirm this** 1. The exact `selector` array of the affected balancer, plus the full list of outbound tags in your Xray config (tags only are enough, no need for hosts/credentials). 2. Whether the outbounds involved come from an Outbound Subscription (Xray Configs → Outbound Subscriptions), and if so its `tagPrefix`. 3. What the **Live Target** tooltip shows next time the unexpected outbound is used. If your selector strings turn out to be exact, non-overlapping tags with no subscription involved and Xray-core is still adding outbounds you did not configure, that would point to a genuine bug and is worth a follow-up with the details above — this is why the issue is being kept open rather than closed. A smaller, related gap: unlike the Fallback field, which has an explanatory hint (`fallbackBalancerHint`, `internal/web/translation/en-US.json:1875`), the Selector field has no hint text about this prefix-matching behavior, so it is easy to trip over even for careful users. That would be a reasonable UX improvement (a short hint, or a warning when two selector entries overlap as prefixes), separate from the underlying routing behavior itself, which is inherited from Xray-core. @MHSanaei tagging for visibility. --- **نسخه فارسی** به احتمال زیاد این یک باگ در کد نیست، بلکه نتیجه‌ی نحوه‌ی تطبیق فیلد `selector` در Balancer است: مقادیری که در آرایه‌ی `selector` یک بالانسر قرار می‌دهید توسط Xray-core به‌صورت **پیشوند (prefix)** روی تگ outbound تطبیق داده می‌شوند، نه به‌صورت تطبیق دقیق و کامل. 3x-ui در هیچ لایه‌ای این را به تطبیق دقیق تبدیل نمی‌کند. **آنچه در سورس کد تایید شد** فیلد Selector در دیالوگ افزودن/ویرایش Balancer (`frontend/src/pages/xray/balancers/BalancerFormModal.tsx:241-247`) یک `Select` آزاد در حالت `tags` است؛ می‌توانید یک تگ موجود را انتخاب کنید یا هر رشته‌ای تایپ کنید، و همان مقدار عیناً در آرایه‌ی `selector` ذخیره می‌شود (`frontend/src/schemas/routing.ts:74`). نه فرانت‌اند و نه بک‌اند این رشته‌ها را به‌عنوان تگ‌های دقیق و یکتا اعتبارسنجی نمی‌کنند؛ این آرایه عیناً وارد بخش `routing.balancers[].selector` کانفیگ ذخیره‌شده‌ی Xray می‌شود. مستندات خود پروژه هم همین را می‌گوید: «A balancer groups outbounds by a selector (tag prefixes, including the wildcard pools from outbound subscriptions)» (`docs/content/docs/en/operations/outbounds-routing.mdx:132-134`). همین صفحه درباره‌ی Outbound Subscriptions می‌گوید تگ‌های exact در selector همیشه به همان سرور ثابت می‌مانند، اما selectorهای prefix/wildcard (مثل `hk-*`) با هر رفرش، سرورهای جدیدی که subscription برمی‌گرداند را هم به‌طور خودکار وارد بالانسر می‌کنند (همان فایل، خطوط 103-105). کامنت طراحی در `internal/web/service/outbound_subscription.go:522-559` دقیقاً همین رفتار را برای بالانسرهای متکی به Subscription توضیح می‌دهد. **چرا این دقیقاً همان رفتاری‌ست که گزارش کرده‌اید** اگر تگ هر outbound دیگری در کانفیگ شما با یکی از رشته‌های `selector` این بالانسر شروع شود (مثلاً selector شما `"server-1"` است ولی outbound دیگری به نام `"server-10"` یا `"server-1-backup"` هم دارید)، Xray-core آن را هم عضو همین بالانسر در نظر می‌گیرد. اگر از Outbound Subscription استفاده می‌کنید و selector شما شبیه یک prefix است، سرورهای جدیدی که در رفرش‌های بعدی subscription اضافه می‌شوند هم به‌طور خودکار به بالانسر ملحق می‌شوند؛ این دقیقاً با بخش «بعد از مدتی» در گزارش شما هم‌خوانی دارد، چون این اتفاق فقط در رفرش/ریلود بعدی رخ می‌دهد، نه در لحظه‌ی ساخت بالانسر. **چطور خودتان بررسی کنید** به بخش **Xray Configs → Balancers** بروید. ستون **Selector** دقیقاً همان رشته‌هایی را نشان می‌دهد که تعریف کرده‌اید. روی ستون **Live Target** همین ردیف نگه دارید؛ tooltip آن outboundهایی که Xray-core در حال حاضر واقعاً عضو این بالانسر گزارش می‌دهد را نشان می‌دهد. اگر تگی در آن tooltip دیدید که در Selector اضافه نکرده‌اید، یعنی تطبیق prefix رخ داده است. همچنین مطمئن شوید ستون **Override** همین ردیف خالی است، نه نارنجی؛ override یک قابلیت جدا و دستی است (`internal/web/service/xray.go:907-929`) و ربطی به انتخاب استراتژی ندارد. **برای تایید نهایی به این موارد نیاز است** ۱. آرایه‌ی دقیق `selector` بالانسر مورد نظر و لیست کامل تگ‌های outbound در کانفیگ شما (فقط تگ‌ها کافی است). ۲. اینکه آیا outboundهای درگیر از یک Outbound Subscription می‌آیند یا نه، و در صورت استفاده، مقدار `tagPrefix` آن. ۳. مقداری که ستون Live Target دفعه‌ی بعد که این اتفاق افتاد نشان می‌دهد. اگر مشخص شد رشته‌های selector شما دقیق و بدون همپوشانی هستند، از Subscription هم استفاده نمی‌کنید، و بازهم Xray-core outboundهای خارج از تعریف را انتخاب می‌کند، آن‌وقت واقعاً جای بررسی بیشتر دارد؛ به همین دلیل این ایشو به‌جای بسته‌شدن، باز نگه داشته می‌شود. @MHSanaei برای اطلاع تگ شد. --- *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@MHSanaei commented on GitHub (Jul 11, 2026):

Closing as expected behavior: a balancer's selector entries are matched by Xray-core as tag prefixes, not exact tags — an outbound tagged server-10 is a member of a balancer whose selector says server-1, and prefix/wildcard selectors automatically pick up new servers added by an Outbound Subscription refresh (which matches the "after running for some time" part of the report). This is inherited from Xray-core's routing engine, not a panel defect.

To verify on your setup: Xray Configs → Balancers → hover the Live Target column — the tooltip lists what the core actually selected; check that no other outbound tag starts with one of your selector strings, and make your selectors full exact tags if you don't want pool behavior.

If your selectors are exact, non-overlapping tags with no subscription involved and an unlisted outbound still gets picked, please reopen with the balancer's selector array plus the full outbound tag list.

<!-- gh-comment-id:4948566236 --> @MHSanaei commented on GitHub (Jul 11, 2026): Closing as expected behavior: a balancer's `selector` entries are matched by Xray-core as **tag prefixes**, not exact tags — an outbound tagged `server-10` is a member of a balancer whose selector says `server-1`, and prefix/wildcard selectors automatically pick up new servers added by an Outbound Subscription refresh (which matches the "after running for some time" part of the report). This is inherited from Xray-core's routing engine, not a panel defect. To verify on your setup: Xray Configs → Balancers → hover the **Live Target** column — the tooltip lists what the core actually selected; check that no other outbound tag *starts with* one of your selector strings, and make your selectors full exact tags if you don't want pool behavior. If your selectors are exact, non-overlapping tags with no subscription involved and an unlisted outbound still gets picked, please reopen with the balancer's selector array plus the full outbound tag list.
bsakaguchi changed title from [GH-ISSUE #5892] [Bug]: Load Balancer ignores configured outbounds and randomly uses other outbounds / لود بالانسر اوت‌باندهای تعریف‌شده را نادیده می‌گیرد و از اوت‌باندهای دیگر استف… to [GH-ISSUE #5892] [Bug]: Load Balancer ignores configured outbounds and randomly uses other outbounds / لود بالانسر اوت‌باندهای تعریف‌شده را نادیده می‌گیرد و از اوت‌باندهای دیگر استف… 2026-11-07 20:38:21 +07:00
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#4085
No description provided.