mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5266] [Bug]: No UI to clear tgBotProxy after panelProxy removal in v3.3.1 — Telegram bot fails when SOCKS5 is disabled #3688
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#3688
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 @SergioSHA1 on GitHub (Jun 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5266
Describe the bug
After upgrading to v3.3.1, the Telegram bot stops working when the local SOCKS5 proxy is taken offline — even with panelOutbound configured and enabled.
The root cause: v3.3.1 removed the Panel Proxy URL field from the UI, but the old value persists in the database under tgBotProxy. There is now no way to clear it through the interface. The bot reads tgBotProxy directly (via GetTgBotProxy() in tgbot.go) and dials the stale SOCKS5 address — panelOutbound is not considered by the bot at all.
SELECT key, value FROM settings
WHERE key IN ('panelProxy', 'tgBotProxy', 'panelOutbound');
panelProxy | socks5://127.0.0.1:9051 ← stale, not cleaned up by migration
tgBotProxy | socks5://127.0.0.1:9051 ← bot still uses this; no UI to clear it
panelOutbound | ← set, but not used by the bot
How to reproduce the problem
Before upgrading: set Panel Proxy URL = socks5://127.0.0.1:9051 and Telegram Bot Proxy = socks5://127.0.0.1:9051.
Upgrade to v3.3.1.
Configure panelOutbound in Settings → Outbound tab.
Disable the local SOCKS5 proxy on the server.
Observe: Telegram bot stops responding.
Expected behavior
Migration to v3.3.1 should clear tgBotProxy and panelProxy if Panel Proxy URL was removed from the UI.
Either: the bot should route through panelOutbound, or a dedicated Telegram Bot Proxy field should remain in the Settings UI so users can clear it manually.
Actual behavior
"Telegram bot stops responding immediately after SOCKS5 proxy is disabled. No errors in the panel UI — the bot simply goes offline."
No response
Relevant logs
Screenshots
3x-ui version
3.3.1
Xray-core version
26.6.1
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 22.04
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 13, 2026):
The bug is confirmed against the v3.3.1 source. Here is exactly what is happening and how to recover.
What changed across versions
tgBotProxyfield in Telegram settings tabpanelProxytext field in General settingstgBotProxyfield removed; bot fell back topanelProxypanelOutbound(Xray outbound tag picker)What the bot does now (confirmed in
internal/web/service/tgbot/tgbot.go:232–244)tgBotProxyfrom the database viaGetTgBotProxy().tgBotProxyis empty, falls back toPanelEgressProxyURL(), which resolves the loopback SOCKS5 bridge that the panel injects into Xray whenpanelOutboundis configured.Because your database still contains
tgBotProxy = socks5://127.0.0.1:9051(set before the upgrade), step 2 is never reached. The bot dials the dead address. YourpanelOutboundsetting is valid but is bypassed while that stale value is present.Why the value was not cleared on upgrade
There is no migration step in
internal/database/db.go(runSeeders) that clearstgBotProxyorpanelProxywhen upgrading to v3.3.1. Both keys are left as-is in the database.panelProxyis now a dead key — no code in the current backend reads it (entity.AllSettinghas nopanelProxyfield andinternal/web/service/setting.gohas noGetPanelProxyfunction).Immediate workaround
Clear the stale value directly in the database, then restart the panel:
After the restart,
GetTgBotProxy()returns"", the fallback toPanelEgressProxyURL()fires, and the bot routes through the loopback SOCKS5 bridge for your configuredpanelOutboundtag. Ensure Xray is running at that point; if it is not,PanelEgressProxyURL()logs a warning and falls back to a direct connection until the next bot restart.Proper fix
A one-time migration seeder in
internal/database/db.go(runSeeders) that clearstgBotProxyandpanelProxyon the first run after upgrade would prevent this for all existing users. Separately, restoring atgBotProxyinput infrontend/src/pages/settings/TelegramTab.tsx— even blank on fresh installs — would let users clear or override the proxy from the UI without touching the database directly.This reply was generated automatically; a maintainer may follow up.
@MHSanaei commented on GitHub (Jun 13, 2026):
Fixed in
9a8247fa. Added a one-off migration that clears the legacypanelProxy/tgBotProxysettings on upgrade, so a staletgBotProxyvalue no longer masks thepanelOutboundegress fallback. The Telegram bot now falls back to the panel outbound when no dedicated bot proxy is set.