[GH-ISSUE #5120] [Bug]: مشکل اوت های درون سابسکریپشن اوتباند #3600

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

Originally created by @godimaxD on GitHub (Jun 9, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5120

Describe the bug

ساب با موفقیت اضافه شده ولی هنگام پینگ گرفتن از کانفیگ های ساب این رو میگه:
Probe timed out — outbound did not become reachable

کانفیگ ها به صورت دستی و دونه دونه اضافه میشن مشکلی ندارن

How to reproduce the problem

  1. outbound page
  2. add sub
  3. http ping from sub configs

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.3.0

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 22

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 @godimaxD on GitHub (Jun 9, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5120 ### Describe the bug ساب با موفقیت اضافه شده ولی هنگام پینگ گرفتن از کانفیگ های ساب این رو میگه: Probe timed out — outbound did not become reachable کانفیگ ها به صورت دستی و دونه دونه اضافه میشن مشکلی ندارن ### How to reproduce the problem 1. outbound page 2. add sub 3. http ping from sub configs ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.3.0 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 22 ### 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:33:37 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jun 9, 2026):

این یک باگ واقعی در پنل است — علت آن را پیدا کردیم.


ریشه مشکل

وقتی روی دکمه پینگ (HTTP probe) یک اوت‌باند سابسکریپشن کلیک می‌کنید، فرانت‌اند در فایل frontend/src/hooks/useXraySetting.ts (خط ~۲۸۰) یک لیست از اوت‌باندها به بک‌اند ارسال می‌کند:

allOutbounds: JSON.stringify(templateSettingsRef.current?.outbounds || [])

این لیست فقط شامل اوت‌باندهایی است که دستی در قالب Xray (template) اضافه شده‌اند (مثلاً freedom، blocked)، نه اوت‌باندهایی که از سابسکریپشن آمده‌اند.

در بک‌اند (web/service/outbound.go، تابع testOutboundHTTP)، اوت‌باند تست‌شونده فقط در صورتی به لیست اضافه می‌شود که لیست کاملاً خالی باشد:

if len(allOutbounds) == 0 {
    allOutbounds = []any{testOutbound}
}

اما چون تمپلت Xray معمولاً حداقل یک freedom و یک blackhole دارد، allOutbounds خالی نیست — و اوت‌باند سابسکریپشن هیچ‌وقت به لیست اضافه نمی‌شود.

در نتیجه، تابع createTestConfig یک کانفیگ Xray آزمایشی می‌سازد که فقط حاوی اوت‌باندهای دستی است، اما burstObservatory می‌خواهد تگ اوت‌باند سابسکریپشن (مثلاً sub1-server1) را پروب کند — چون این تگ در لیست اوت‌باندها وجود ندارد، هیچ پاسخی نمی‌آید و پس از ۱۲ ثانیه خطای زیر نمایش داده می‌شود:

Probe timed out — outbound did not become reachable


چرا اوت‌باند دستی کار می‌کند؟

اوت‌باندهایی که دستی اضافه می‌کنید، بخشی از تمپلت هستند؛ پس تگشان در allOutbounds موجود است و پروب موفق می‌شود. اوت‌باندهای سابسکریپشن جدا ذخیره می‌شوند و در allOutbounds ارسال‌شده از فرانت‌اند نیستند.


راه‌حل موقت

تا زمان رفع باگ، برای تست اوت‌باندهای سابسکریپشن از حالت TCP به جای HTTP استفاده کنید (اگر پروتکل TCP-based است):

  • روی تاگل کنار دکمه‌های پینگ، حالت را از HTTP به TCP بگذارید.
  • پروب TCP مستقیماً به host:port اوت‌باند وصل می‌شود و به xray موقت نیاز ندارد، پس از این باگ متأثر نمی‌شود.

توجه: پروب TCP فقط اثبات می‌کند که پورت باز است، نه اینکه پروتکل پراکسی کار می‌کند. برای پروتکل‌های UDP مثل Hysteria/WireGuard، TCP probe امکان‌پذیر نیست و همچنان HTTP probe نیاز است.


اطلاعات تکمیلی (برای تیم توسعه)

  • فایل باگ: web/service/outbound.go — تابع testOutboundHTTP (~خط ۳۵۴)
  • فیکس: قبل از ساخت تست‌کانفیگ، بررسی شود که آیا تگ اوت‌باند تست‌شونده در allOutbounds هست؛ اگر نه، آن را اضافه کند.
// Ensure the tested outbound is always in the pool
tagPresent := false
for _, ob := range allOutbounds {
    if m, ok := ob.(map[string]any); ok {
        if t, _ := m["tag"].(string); t == outboundTag {
            tagPresent = true
            break
        }
    }
}
if \!tagPresent {
    allOutbounds = append(allOutbounds, testOutbound)
}
<!-- gh-comment-id:4657906593 --> @github-actions[bot] commented on GitHub (Jun 9, 2026): **این یک باگ واقعی در پنل است — علت آن را پیدا کردیم.** --- ## ریشه مشکل وقتی روی دکمه پینگ (HTTP probe) یک اوت‌باند سابسکریپشن کلیک می‌کنید، فرانت‌اند در فایل `frontend/src/hooks/useXraySetting.ts` (خط ~۲۸۰) یک لیست از اوت‌باندها به بک‌اند ارسال می‌کند: ```js allOutbounds: JSON.stringify(templateSettingsRef.current?.outbounds || []) ``` این لیست فقط شامل اوت‌باندهایی است که **دستی** در قالب Xray (template) اضافه شده‌اند (مثلاً `freedom`، `blocked`)، **نه** اوت‌باندهایی که از سابسکریپشن آمده‌اند. در بک‌اند (`web/service/outbound.go`، تابع `testOutboundHTTP`)، اوت‌باند تست‌شونده فقط در صورتی به لیست اضافه می‌شود که لیست **کاملاً خالی** باشد: ```go if len(allOutbounds) == 0 { allOutbounds = []any{testOutbound} } ``` اما چون تمپلت Xray معمولاً حداقل یک `freedom` و یک `blackhole` دارد، `allOutbounds` خالی نیست — و اوت‌باند سابسکریپشن **هیچ‌وقت** به لیست اضافه نمی‌شود. در نتیجه، تابع `createTestConfig` یک کانفیگ Xray آزمایشی می‌سازد که فقط حاوی اوت‌باندهای دستی است، اما `burstObservatory` می‌خواهد تگ اوت‌باند سابسکریپشن (مثلاً `sub1-server1`) را پروب کند — چون این تگ در لیست اوت‌باندها وجود ندارد، هیچ پاسخی نمی‌آید و پس از ۱۲ ثانیه خطای زیر نمایش داده می‌شود: > **Probe timed out — outbound did not become reachable** --- ## چرا اوت‌باند دستی کار می‌کند؟ اوت‌باندهایی که دستی اضافه می‌کنید، بخشی از تمپلت هستند؛ پس تگشان در `allOutbounds` موجود است و پروب موفق می‌شود. اوت‌باندهای سابسکریپشن جدا ذخیره می‌شوند و در `allOutbounds` ارسال‌شده از فرانت‌اند نیستند. --- ## راه‌حل موقت تا زمان رفع باگ، برای تست اوت‌باندهای سابسکریپشن از **حالت TCP** به جای HTTP استفاده کنید (اگر پروتکل TCP-based است): - روی تاگل کنار دکمه‌های پینگ، حالت را از `HTTP` به `TCP` بگذارید. - پروب TCP مستقیماً به `host:port` اوت‌باند وصل می‌شود و به xray موقت نیاز ندارد، پس از این باگ متأثر نمی‌شود. > **توجه:** پروب TCP فقط اثبات می‌کند که پورت باز است، نه اینکه پروتکل پراکسی کار می‌کند. برای پروتکل‌های UDP مثل Hysteria/WireGuard، TCP probe امکان‌پذیر نیست و همچنان HTTP probe نیاز است. --- ## اطلاعات تکمیلی (برای تیم توسعه) - **فایل باگ:** `web/service/outbound.go` — تابع `testOutboundHTTP` (~خط ۳۵۴) - **فیکس:** قبل از ساخت تست‌کانفیگ، بررسی شود که آیا تگ اوت‌باند تست‌شونده در `allOutbounds` هست؛ اگر نه، آن را اضافه کند. ```go // Ensure the tested outbound is always in the pool tagPresent := false for _, ob := range allOutbounds { if m, ok := ob.(map[string]any); ok { if t, _ := m["tag"].(string); t == outboundTag { tagPresent = true break } } } if \!tagPresent { allOutbounds = append(allOutbounds, testOutbound) } ```
Author
Owner

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

Fixed in 0bed5522.

Root cause: HTTP-pinging a subscription outbound always timed out because the frontend only sends the template outbounds as allOutbounds. Subscription outbounds are injected at runtime and aren't part of that list, so xray's burstObservatory had no outbound matching the tag to probe — it never reported alive and the probe timed out. Manually-added configs worked because they are in the template list.

Fix: the HTTP probe now appends the outbound under test whenever its tag is missing from allOutbounds (instead of only when the list is empty), so the probe always has a target while preserving the template outbounds that back dialerProxy chains.

<!-- gh-comment-id:4659027245 --> @MHSanaei commented on GitHub (Jun 9, 2026): Fixed in 0bed5522. **Root cause:** HTTP-pinging a subscription outbound always timed out because the frontend only sends the *template* outbounds as `allOutbounds`. Subscription outbounds are injected at runtime and aren't part of that list, so xray's `burstObservatory` had no outbound matching the tag to probe — it never reported `alive` and the probe timed out. Manually-added configs worked because they are in the template list. **Fix:** the HTTP probe now appends the outbound under test whenever its tag is missing from `allOutbounds` (instead of only when the list is empty), so the probe always has a target while preserving the template outbounds that back dialerProxy chains.
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#3600
No description provided.