[GH-ISSUE #6291] [Bug]: Multi-node client loses its node inbounds after it runs out and is renewed (multi config becomes a single config) #4271

Closed
opened 2026-10-31 20:38:26 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ZedSoftOfficial on GitHub (Aug 23, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6291

Describe the bug

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

نسخه 3.6.0

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.6.0

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

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 @ZedSoftOfficial on GitHub (Aug 23, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6291 ### Describe the bug سلام وقت بخیر وقتی کانفیگ مولتی داریم تموم میشه تک کانفیگ میشه یعنی انیباند های نود هارو از روی کانفیگ تمدید برمیداره و مولتی نیست دیگه این باگ رو کسی دیده؟ نسخه 3.6.0 ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.6.0 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system 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:38:26 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 23, 2026):

سلام. بله، این یک باگ واقعی در نسخهٔ ۳.۶.۰ است و علت اصلی‌اش دو روز بعد از انتشار v3.6.0 روی شاخهٔ main رفع شده، ولی هنوز در هیچ نسخهٔ رسمی منتشر نشده — فعلاً فقط از کانال Dev (dev-latest) قابل دریافت است. توضیح دقیق زنجیره در ادامه.

چه اتفاقی در ۳.۶.۰ می‌افتد (تأیید‌شده روی سورس تگ v3.6.0)

۱. وقتی حجم یا تاریخ کلاینت تمام می‌شود، disableInvalidClients آن را غیرفعال می‌کند و برای اینباندِ نود، تنظیمات کامل اینباند را با enable=false به نود پوش می‌کند (internal/web/service/inbound_disable.go:273-287). تا اینجا کلاینت روی نود باقی است، فقط غیرفعال.

۲. هر بار که نود config_dirty باشد، جاب سینک نود ReconcileNode را صدا می‌زند (internal/web/job/node_traffic_sync_job.go:368) و payload آن با buildRuntimeInboundForAPI ساخته می‌شود (internal/web/service/inbound_node.go:132). کامنت بالای همان خط در ۳.۶.۰ خودش این را می‌گوید:

// Reconcile with the same runtime-built payload interactive pushes
// send (disabled clients filtered, settings.fallbacks injected) so
// fingerprints line up and fallback edits actually reach the node.

۳. آن سازنده هر کلاینت غیرفعال را از payload بیرون می‌اندازد (internal/web/service/inbound.go:1646):

if enable, exists := enableMap[email]; exists && !enable {
    continue
}

۴. نود این payload را در دیتابیس خودش می‌نویسد، پس کلاینتِ تمام‌شده از اینباند نود پاک می‌شود و دیگر در اسنپ‌شات نود گزارش نمی‌شود.

۵. در سینک بعدی، پنل مرکزی همان حذف را آینه می‌کند: تنظیمات اینباند مرکزی از روی اسنپ‌شات نود بازنویسی می‌شود (inbound_node.go:618، updates["settings"] = adoptedSettings) و لینک‌های client_inbounds از روی چیزی که نود گزارش کرده بازسازی می‌شوند (inbound_node.go:974 → ClientService.SyncInbound).

۶. نتیجه دقیقاً همان چیزی است که شما دیده‌اید: اگر کلاینت روی یک اینباند لوکال هم باشد، رکوردش می‌ماند ولی اینباندهای نود از آن جدا می‌شوند ⇒ کانفیگ مولتی «تک‌کانفیگ» می‌شود. اگر کلاینت فقط روی اینباندهای نود بوده باشد، خود رکورد کلاینت حذف می‌شود (inbound_node.go:1005). تمدید بعدی هم فقط همان اینباند باقی‌مانده را دوباره فعال می‌کند.

وضعیت رفع

کامیت 5bc81dfd — «fix(node): stop the node sync from deleting clients it never meant to» (۱ اوت ۲۰۲۶). متن خود کامیت همین سناریو را توصیف می‌کند: «A client that hit its quota or expiry was disabled, then destroyed on both panels a few seconds later.»

روی main پوش به نود حالا با buildInboundForNodePush ساخته می‌شود (internal/web/service/inbound_node.go:131) که کلاینت غیرفعال را حذف نمی‌کند؛ کامنت بالای آن (inbound.go:1688): «A node mirrors this payload into its own DB, so every client must survive: filtering one out makes the node delete it, and the master then mirrors that.» و تست TestNodePushKeepsDisabledClientsLocalPushStripsThem (internal/web/service/node_push_payload_test.go:34) آن را قفل کرده است.

این اصلاح در هیچ ریلیز شماره‌داری نیست: v3.6.0 روی کامیت c377dca2 (۳۰ ژوئیه ۲۰۲۶) است و کامیت رفع دو روز بعدتر آمده؛ git tag --contains 5bc81dfd فقط dev-latest را برمی‌گرداند و internal/config/version روی main هنوز 3.6.0 است. برای گرفتن بیلد dev:

x-ui update-dev

(x-ui.sh:169 — این یک پیش‌انتشارِ per-commit است نه نسخهٔ پایدار؛ قبلش از /etc/x-ui/x-ui.db بکاپ بگیرید.)

یک نکتهٔ مهم

یک نقص دومِ هنوز باز با ظاهر بسیار شبیه وجود دارد: #6228 — تاریخ انقضایی که نود گزارش می‌کند بدون هیچ مقایسه‌ای روی ردیف مشترک client_traffics مستر نوشته می‌شود (internal/web/service/inbound_node.go:908 روی main)، که می‌تواند کلاینتِ تازه تمدیدشده را دوباره منقضی کند. اگر بعد از رفتن روی dev-latest باز هم همین را دیدید، به احتمال زیاد آن یکی است و بهتر است در #6228 دنبال شود.

برای اینکه بشود دقیقاً همین گزارش را دنبال کرد

گزارش شما لاگ و جزئیات ندارد، پس نمی‌شود قطعی گفت کدام‌یک از این دو مسیر را می‌بینید. این چهار مورد آن را روشن می‌کند:

  1. تمدید را چطور انجام می‌دهید — تمدید خودکار (چرخهٔ ریست/reset) یا تغییر دستی تاریخ انقضا / ریست ترافیک از پنل؟ این دو مسیر کد متفاوتی دارند.
  2. بلافاصله بعد از اینکه کانفیگ «تک» شد، در پنل مرکزی: خود اینباند نود سر جایش هست و فقط کلاینت از settings.clients آن حذف شده، یا کل ردیف اینباند هم رفته؟
  3. لاگ پنل مرکزی از لحظهٔ اتمام تا حدود ۲۰ دقیقه بعد (x-ui log یا journalctl -u x-ui -n 500 --no-pager)، مخصوصاً خطوطی که با setRemoteTraffic شروع می‌شوند و عبارت‌های no longer reports inbound و reap. لطفاً به‌صورت متن، نه تصویر — تصویر اینجا قابل خواندن نیست.
  4. نسخهٔ 3x-ui روی خودِ نودها (فرم فقط نسخهٔ پنل مرکزی را گرفته است).

عنوان issue خالی بود ([Bug]:)؛ آن را به شرح مشکل خودتان تغییر دادم تا در جست‌وجو پیدا شود.


Verdict: Already fixed
Severity: High
Confidence: Medium
Root cause: InboundService.ReconcileNode (v3.6.0 internal/web/service/inbound_node.go:132) builds the node push with buildRuntimeInboundForAPI, which drops every client whose client_traffics.enable is false (internal/web/service/inbound.go:1646). A node stores that payload in its own DB, so a quota/expiry-disabled client is deleted there; the next snapshot merge mirrors the deletion back into the master — inbound settings overwritten at inbound_node.go:618, client_inbounds links rebuilt at inbound_node.go:974, and the client record hard-deleted when nothing is left attached (inbound_node.go:1005). Trigger: a client attached to node inbounds hits its quota or expiry while, or before, the node is config_dirty (internal/web/job/node_traffic_sync_job.go:368). Introduced by the shared-builder choice, not a single commit.
Already fixed: 5bc81dfd "fix(node): stop the node sync from deleting clients it never meant to" (2026-08-01) splits the builder — buildInboundForNodePush (inbound.go:1690) keeps disabled clients and ReconcileNode now uses it (inbound_node.go:131); pinned by TestNodePushKeepsDisabledClientsLocalPushStripsThem (node_push_payload_test.go:34). NOT in any numbered release: v3.6.0 = c377dca2 (2026-07-30), git tag --contains 5bc81dfd → dev-latest only, internal/config/version on main still 3.6.0.
Duplicate of: Related: #6247 (closed, same root cause, manual-disable trigger), #6257 (open, same family), #6228 (open, second defect still on main: node-reported expiry overwrites the master's shared row at inbound_node.go:908)
Evidence: v3.6.0 inbound_node.go:128-133 "Reconcile with the same runtime-built payload interactive pushes send (disabled clients filtered…)"; v3.6.0 inbound.go:1646 if enable, exists := enableMap[email]; exists && !enable { continue }; v3.6.0 inbound_disable.go:283 rt.UpdateInbound(...) (the disable push itself keeps the client, so the strip is the only deleting path); v3.6.0 inbound_node.go:618 updates["settings"] = adoptedSettings; v3.6.0 inbound_node.go:974 SyncInbound; v3.6.0 inbound_node.go:1005 Delete(&model.ClientRecord{}); main inbound.go:1688-1690 "A node mirrors this payload into its own DB, so every client must survive…"; commit message of 5bc81dfd.
Not determined: Whether this reporter is hitting the fixed strip path or the still-open #6228 expiry-merge path — no logs, no DB state and no statement of manual vs. automatic renewal were supplied. Running dev-latest and checking whether the node inbounds still disappear after a renewal settles it.

این پاسخ به‌صورت خودکار تولید شده است؛ ممکن است یکی از نگه‌دارندگان بعداً پیگیری کند.

<!-- gh-comment-id:5388057257 --> @github-actions[bot] commented on GitHub (Aug 23, 2026): سلام. بله، این یک باگ واقعی در نسخهٔ ۳.۶.۰ است و علت اصلی‌اش **دو روز بعد از انتشار v3.6.0** روی شاخهٔ `main` رفع شده، ولی هنوز در هیچ نسخهٔ رسمی منتشر نشده — فعلاً فقط از کانال Dev (`dev-latest`) قابل دریافت است. توضیح دقیق زنجیره در ادامه. ### چه اتفاقی در ۳.۶.۰ می‌افتد (تأیید‌شده روی سورس تگ `v3.6.0`) ۱. وقتی حجم یا تاریخ کلاینت تمام می‌شود، `disableInvalidClients` آن را غیرفعال می‌کند و برای اینباندِ نود، تنظیمات کامل اینباند را با `enable=false` به نود پوش می‌کند (`internal/web/service/inbound_disable.go:273-287`). تا اینجا کلاینت روی نود باقی است، فقط غیرفعال. ۲. هر بار که نود `config_dirty` باشد، جاب سینک نود `ReconcileNode` را صدا می‌زند (`internal/web/job/node_traffic_sync_job.go:368`) و payload آن با `buildRuntimeInboundForAPI` ساخته می‌شود (`internal/web/service/inbound_node.go:132`). کامنت بالای همان خط در ۳.۶.۰ خودش این را می‌گوید: ```go // Reconcile with the same runtime-built payload interactive pushes // send (disabled clients filtered, settings.fallbacks injected) so // fingerprints line up and fallback edits actually reach the node. ``` ۳. آن سازنده هر کلاینت غیرفعال را از payload بیرون می‌اندازد (`internal/web/service/inbound.go:1646`): ```go if enable, exists := enableMap[email]; exists && !enable { continue } ``` ۴. نود این payload را در **دیتابیس خودش** می‌نویسد، پس کلاینتِ تمام‌شده از اینباند نود پاک می‌شود و دیگر در اسنپ‌شات نود گزارش نمی‌شود. ۵. در سینک بعدی، پنل مرکزی همان حذف را آینه می‌کند: تنظیمات اینباند مرکزی از روی اسنپ‌شات نود بازنویسی می‌شود (`inbound_node.go:618`، `updates["settings"] = adoptedSettings`) و لینک‌های `client_inbounds` از روی چیزی که نود گزارش کرده بازسازی می‌شوند (`inbound_node.go:974` → `ClientService.SyncInbound`). ۶. نتیجه دقیقاً همان چیزی است که شما دیده‌اید: اگر کلاینت روی یک اینباند لوکال هم باشد، رکوردش می‌ماند ولی اینباندهای نود از آن جدا می‌شوند ⇒ کانفیگ مولتی «تک‌کانفیگ» می‌شود. اگر کلاینت فقط روی اینباندهای نود بوده باشد، خود رکورد کلاینت حذف می‌شود (`inbound_node.go:1005`). تمدید بعدی هم فقط همان اینباند باقی‌مانده را دوباره فعال می‌کند. ### وضعیت رفع کامیت `5bc81dfd` — «fix(node): stop the node sync from deleting clients it never meant to» (۱ اوت ۲۰۲۶). متن خود کامیت همین سناریو را توصیف می‌کند: *«A client that hit its quota or expiry was disabled, then destroyed on both panels a few seconds later.»* روی `main` پوش به نود حالا با `buildInboundForNodePush` ساخته می‌شود (`internal/web/service/inbound_node.go:131`) که کلاینت غیرفعال را حذف نمی‌کند؛ کامنت بالای آن (`inbound.go:1688`): *«A node mirrors this payload into its own DB, so every client must survive: filtering one out makes the node delete it, and the master then mirrors that.»* و تست `TestNodePushKeepsDisabledClientsLocalPushStripsThem` (`internal/web/service/node_push_payload_test.go:34`) آن را قفل کرده است. این اصلاح در هیچ ریلیز شماره‌داری نیست: `v3.6.0` روی کامیت `c377dca2` (۳۰ ژوئیه ۲۰۲۶) است و کامیت رفع دو روز بعدتر آمده؛ `git tag --contains 5bc81dfd` فقط `dev-latest` را برمی‌گرداند و `internal/config/version` روی `main` هنوز `3.6.0` است. برای گرفتن بیلد dev: ```bash x-ui update-dev ``` (`x-ui.sh:169` — این یک پیش‌انتشارِ per-commit است نه نسخهٔ پایدار؛ قبلش از `/etc/x-ui/x-ui.db` بکاپ بگیرید.) ### یک نکتهٔ مهم یک نقص دومِ **هنوز باز** با ظاهر بسیار شبیه وجود دارد: #6228 — تاریخ انقضایی که نود گزارش می‌کند بدون هیچ مقایسه‌ای روی ردیف مشترک `client_traffics` مستر نوشته می‌شود (`internal/web/service/inbound_node.go:908` روی `main`)، که می‌تواند کلاینتِ تازه تمدیدشده را دوباره منقضی کند. اگر بعد از رفتن روی `dev-latest` باز هم همین را دیدید، به احتمال زیاد آن یکی است و بهتر است در #6228 دنبال شود. ### برای اینکه بشود دقیقاً همین گزارش را دنبال کرد گزارش شما لاگ و جزئیات ندارد، پس نمی‌شود قطعی گفت کدام‌یک از این دو مسیر را می‌بینید. این چهار مورد آن را روشن می‌کند: 1. تمدید را چطور انجام می‌دهید — تمدید خودکار (چرخهٔ ریست/`reset`) یا تغییر دستی تاریخ انقضا / ریست ترافیک از پنل؟ این دو مسیر کد متفاوتی دارند. 2. بلافاصله بعد از اینکه کانفیگ «تک» شد، در پنل مرکزی: خود اینباند نود سر جایش هست و فقط کلاینت از `settings.clients` آن حذف شده، یا کل ردیف اینباند هم رفته؟ 3. لاگ پنل مرکزی از لحظهٔ اتمام تا حدود ۲۰ دقیقه بعد (`x-ui log` یا `journalctl -u x-ui -n 500 --no-pager`)، مخصوصاً خطوطی که با `setRemoteTraffic` شروع می‌شوند و عبارت‌های `no longer reports inbound` و `reap`. لطفاً به‌صورت متن، نه تصویر — تصویر اینجا قابل خواندن نیست. 4. نسخهٔ 3x-ui روی خودِ نودها (فرم فقط نسخهٔ پنل مرکزی را گرفته است). عنوان issue خالی بود (`[Bug]:`)؛ آن را به شرح مشکل خودتان تغییر دادم تا در جست‌وجو پیدا شود. --- Verdict: Already fixed Severity: High Confidence: Medium Root cause: `InboundService.ReconcileNode` (v3.6.0 `internal/web/service/inbound_node.go:132`) builds the node push with `buildRuntimeInboundForAPI`, which drops every client whose `client_traffics.enable` is false (`internal/web/service/inbound.go:1646`). A node stores that payload in its own DB, so a quota/expiry-disabled client is deleted there; the next snapshot merge mirrors the deletion back into the master — inbound settings overwritten at `inbound_node.go:618`, `client_inbounds` links rebuilt at `inbound_node.go:974`, and the client record hard-deleted when nothing is left attached (`inbound_node.go:1005`). Trigger: a client attached to node inbounds hits its quota or expiry while, or before, the node is `config_dirty` (`internal/web/job/node_traffic_sync_job.go:368`). Introduced by the shared-builder choice, not a single commit. Already fixed: `5bc81dfd` "fix(node): stop the node sync from deleting clients it never meant to" (2026-08-01) splits the builder — `buildInboundForNodePush` (`inbound.go:1690`) keeps disabled clients and `ReconcileNode` now uses it (`inbound_node.go:131`); pinned by `TestNodePushKeepsDisabledClientsLocalPushStripsThem` (`node_push_payload_test.go:34`). NOT in any numbered release: `v3.6.0` = `c377dca2` (2026-07-30), `git tag --contains 5bc81dfd` → `dev-latest` only, `internal/config/version` on `main` still `3.6.0`. Duplicate of: Related: #6247 (closed, same root cause, manual-disable trigger), #6257 (open, same family), #6228 (open, second defect still on `main`: node-reported expiry overwrites the master's shared row at `inbound_node.go:908`) Evidence: v3.6.0 `inbound_node.go:128-133` "Reconcile with the same runtime-built payload interactive pushes send (disabled clients filtered…)"; v3.6.0 `inbound.go:1646` `if enable, exists := enableMap[email]; exists && !enable { continue }`; v3.6.0 `inbound_disable.go:283` `rt.UpdateInbound(...)` (the disable push itself keeps the client, so the strip is the only deleting path); v3.6.0 `inbound_node.go:618` `updates["settings"] = adoptedSettings`; v3.6.0 `inbound_node.go:974` `SyncInbound`; v3.6.0 `inbound_node.go:1005` `Delete(&model.ClientRecord{})`; `main` `inbound.go:1688-1690` "A node mirrors this payload into its own DB, so every client must survive…"; commit message of `5bc81dfd`. Not determined: Whether this reporter is hitting the fixed strip path or the still-open #6228 expiry-merge path — no logs, no DB state and no statement of manual vs. automatic renewal were supplied. Running `dev-latest` and checking whether the node inbounds still disappear after a renewal settles it. *این پاسخ به‌صورت خودکار تولید شده است؛ ممکن است یکی از نگه‌دارندگان بعداً پیگیری کند.* <!-- claude-issue:analyst -->
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#4271
No description provided.