[GH-ISSUE #5501] [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. #3842

Closed
opened 2026-10-31 20:35:20 +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/5501

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?

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 @barbod1123-bit on GitHub (Jun 23, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5501 ### 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? 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:35:20 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

The behavior is confirmed in the source: disabling an inbound removes its listener from Xray but does not terminate connections that were already established before the toggle.

What the panel actually does (verified in source)

When you toggle an inbound off, SetInboundEnable in internal/web/service/inbound.go:884 calls rt.DelInbound(), which issues a gRPC RemoveInbound call to the running Xray process (internal/xray/api.go:158-170). That call removes the inbound listener — new connections to that port/address will be refused — but the Xray gRPC RemoveInbound API has no mechanism to forcibly close already-established connections. Those sessions survive at the OS networking layer until they close naturally (client disconnects, idle timeout, NAT expiry, etc.).

Why a restart terminates them

Restarting the Xray child process closes all file descriptors, which hard-terminates every established connection. That is the only current path to immediate disconnection of active sessions.

Workaround

From the panel's Settings page there is a "Restart Xray" button, or you can run:

x-ui restart-xray

This terminates all active connections in addition to applying the disable.

Root cause

This is a limitation of the Xray-core gRPC HandlerService.RemoveInbound RPC, not a panel logic error. Addressing it within 3x-ui would require either:

  • always performing a full Xray restart on inbound disable (disrupts all other users), or
  • Xray-core exposing a per-connection or per-inbound kill API (not currently available).

A related report for the same underlying behavior was filed as #4119.

One piece of information that would help narrow scope: the Xray-core version in use (visible in the panel footer or via cat /usr/local/x-ui/bin/xray-linux-* | head — or the panel Settings page shows the version). Different Xray builds occasionally change gRPC API semantics.

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

<!-- gh-comment-id:4778597512 --> @github-actions[bot] commented on GitHub (Jun 23, 2026): The behavior is confirmed in the source: disabling an inbound removes its listener from Xray but does **not** terminate connections that were already established before the toggle. **What the panel actually does (verified in source)** When you toggle an inbound off, `SetInboundEnable` in `internal/web/service/inbound.go:884` calls `rt.DelInbound()`, which issues a gRPC `RemoveInbound` call to the running Xray process (`internal/xray/api.go:158-170`). That call removes the inbound listener — new connections to that port/address will be refused — but the Xray gRPC `RemoveInbound` API has no mechanism to forcibly close already-established connections. Those sessions survive at the OS networking layer until they close naturally (client disconnects, idle timeout, NAT expiry, etc.). **Why a restart terminates them** Restarting the Xray child process closes all file descriptors, which hard-terminates every established connection. That is the only current path to immediate disconnection of active sessions. **Workaround** From the panel's **Settings** page there is a "Restart Xray" button, or you can run: ```bash x-ui restart-xray ``` This terminates all active connections in addition to applying the disable. **Root cause** This is a limitation of the Xray-core gRPC `HandlerService.RemoveInbound` RPC, not a panel logic error. Addressing it within 3x-ui would require either: - always performing a full Xray restart on inbound disable (disrupts all other users), or - Xray-core exposing a per-connection or per-inbound kill API (not currently available). A related report for the same underlying behavior was filed as #4119. One piece of information that would help narrow scope: the Xray-core version in use (visible in the panel footer or via `cat /usr/local/x-ui/bin/xray-linux-* | head` — or the panel Settings page shows the version). Different Xray builds occasionally change gRPC API semantics. *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#3842
No description provided.