mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5869] [Bug]: Main panel cannot add inbound on port 80 for a specific node: "UNIQUE constraint failed: inbounds.port", but node's own panel works fine #4075
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#4075
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 @crossgg on GitHub (Jul 9, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5869
Describe the bug
When I try to add an inbound (with port 80) for a managed node from the main 3x-ui dashboard (i.e., in the node management section, selecting a node and creating an inbound for it), the operation fails with the error:
Something went wrong (UNIQUE constraint failed: inbounds.port)However, if I log in directly to that node's own independent 3x-ui panel and create the same inbound with port 80 (for itself), it succeeds without any error.
This indicates that the main panel's port conflict check is not taking the node identity into account, while the node's own panel correctly associates the inbound with its own node ID.
How to reproduce the problem
Prepare the environment: Set up a Main 3x-ui Panel (central management server) and at least one separate Managed Node Server (e.g., Node-B). Make sure Node-B is already added to the main panel's node list.
Create a conflict on the main panel: On the Main Panel, go to the "Inbounds" list and create an inbound that uses port 80 (this can be for the main server itself, or for another node, e.g., Node-A). Save it successfully. Now port 80 is globally occupied in the main panel's inbound records.
Attempt to add port 80 for a different node from the Main Panel: Still on the Main Panel, navigate to Nodes → select the Node-B (the managed node). Click "Add Inbound", set the port to 80, fill in any protocol (e.g., VLESS), and click save.
Observe the error on the Main Panel: The main panel immediately returns the error:
Something went wrong (UNIQUE constraint failed: inbounds.port)
Alternative attempt (success) on the Node's own panel: Now, directly access the Node-B's own independent 3x-ui panel (via its own IP/domain and panel port). Go to its "Inbounds" page, click "Add Inbound", set the port to 80 with the same protocol, and click save.
Observe success on the Node's panel: The inbound is created successfully without any error, even though port 80 is already used on the main panel or other nodes.
Expected behavior
The main panel should allow adding an inbound with port 80 for a specific managed node, provided that:
In other words, the uniqueness check for ports should be scoped per node (e.g., using a composite unique constraint on
(node_id, port)or(node_id, listen, port)), rather than a global check on theportcolumn alone. This would make the main panel's behavior consistent with that of each node's own panel, where the node's identity is implicitly known and correctly applied.Actual behavior
No response
Relevant logs
Screenshots
3x-ui version
3.4.2
Xray-core version
v26.6.27
How did you install 3x-ui?
install.sh script
Operating system
main panel:ubuntu 22.04 node panel:ubuntu 20.04
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
Chrome 149
Is the panel behind a reverse proxy or CDN?
None
Before submitting