[GH-ISSUE #5500] [Bug]: #3840

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

Originally created by @barbod1123-bit on GitHub (Jun 23, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5500

Describe the bug

Man, the panel really has a bug.
When you disable an inbound, the configs connected to that inbound still keep working. You have to restart the core for them to actually get disconnected.

How to reproduce the problem

.

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.3.1

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?

No response

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 @barbod1123-bit on GitHub (Jun 23, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5500 ### Describe the bug Man, the panel really has a bug. When you disable an inbound, the configs connected to that inbound still keep working. You have to restart the core for them to actually get disconnected. ### How to reproduce the problem . ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.3.1 ### 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? _No response_ ### 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:19 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

This behavior is confirmed against the current source (v3.3.1). Disabling an inbound does take immediate effect for new connection attempts, but does not terminate existing established connections. Here is why.

When you toggle the enable switch off, SetInboundEnable() in internal/web/service/inbound.go (lines 884–948) does the following in order:

  1. Marks the inbound enable = false in the database.
  2. Calls rt.DelInbound(), which invokes XrayAPI.DelInbound() (internal/xray/api.go, lines 159–170). This sends a RemoveInboundRequest to xray-core over its local gRPC socket.
  3. Returns without triggering a full xray restart (lines 935–936 return needRestart = false when the gRPC call succeeds).

The xray-core gRPC RemoveInbound call does exactly what its name says: it removes the inbound handler from xray's runtime, so the port stops accepting new connections immediately. However, it has no mechanism to forcibly close connections that were already established before the call was made. Those connections are held open by existing goroutines inside the xray process and will keep running until either the remote peer disconnects or xray is restarted.

This is a constraint of the xray-core handler API, not a panel-side oversight: there is no "drain and close all sessions for inbound X" gRPC call available.

Current behavior summary

Action New connections Existing connections
Inbound disabled via UI Rejected immediately Remain active
Xray restart N/A All terminated

Workaround

Restart xray-core from the panel (Settings → Restart Xray) or via the management menu (x-ui → Restart xray). This terminates all active sessions for the disabled inbound at the cost of briefly interrupting all other inbounds as well.

A similar report covering both inbound disabling and traffic-limit enforcement was filed as #4119 (v2.9.3). Addressing this fully would require either a periodic cleanup pass that calls the IP-limit/kick mechanism against sessions belonging to disabled inbounds, or a restart path triggered on disable — both would have trade-offs for other active users.


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

<!-- gh-comment-id:4778582348 --> @github-actions[bot] commented on GitHub (Jun 23, 2026): This behavior is confirmed against the current source (v3.3.1). Disabling an inbound does take immediate effect for **new** connection attempts, but does not terminate **existing** established connections. Here is why. When you toggle the enable switch off, `SetInboundEnable()` in `internal/web/service/inbound.go` (lines 884–948) does the following in order: 1. Marks the inbound `enable = false` in the database. 2. Calls `rt.DelInbound()`, which invokes `XrayAPI.DelInbound()` (`internal/xray/api.go`, lines 159–170). This sends a `RemoveInboundRequest` to xray-core over its local gRPC socket. 3. Returns **without** triggering a full xray restart (lines 935–936 return `needRestart = false` when the gRPC call succeeds). The xray-core gRPC `RemoveInbound` call does exactly what its name says: it removes the inbound handler from xray's runtime, so the port stops accepting new connections immediately. However, it has no mechanism to forcibly close connections that were already established before the call was made. Those connections are held open by existing goroutines inside the xray process and will keep running until either the remote peer disconnects or xray is restarted. This is a constraint of the xray-core handler API, not a panel-side oversight: there is no "drain and close all sessions for inbound X" gRPC call available. **Current behavior summary** | Action | New connections | Existing connections | |---|---|---| | Inbound disabled via UI | Rejected immediately | Remain active | | Xray restart | N/A | All terminated | **Workaround** Restart xray-core from the panel (Settings → Restart Xray) or via the management menu (`x-ui` → Restart xray). This terminates all active sessions for the disabled inbound at the cost of briefly interrupting all other inbounds as well. A similar report covering both inbound disabling and traffic-limit enforcement was filed as #4119 (v2.9.3). Addressing this fully would require either a periodic cleanup pass that calls the IP-limit/kick mechanism against sessions belonging to disabled inbounds, or a restart path triggered on disable — both would have trade-offs for other active users. --- *This reply was generated automatically; a maintainer may follow up.*
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#3840
No description provided.