mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4909] [Bug]: Connection Refused After Fresh Reinstall and Clean 3X-UI Installation #3433
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#3433
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 @alinasrollahzadeh405-sudo on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4909
Describe the bug
Hello,
I am experiencing a recurring issue with 3X-UI.
Server information:
Problem:
After some time, I can no longer access the panel in the browser and receive a "Connection Refused" error.
To troubleshoot, I completely rebuilt the VPS and reinstalled Ubuntu and 3X-UI from scratch. However, the same problem occurred again after the clean installation.
Additional notes:
I would appreciate any suggestions on how to diagnose this issue or determine whether it is related to 3X-UI, Xray, or panel services.
Thank you.
How to reproduce the problem
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.2.7
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
ubuntu22.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 4, 2026):
Thanks for the detailed report. "Connection Refused" means nothing is listening on the panel port — the
x-uiprocess itself has stopped or never restarted. This is distinct from a firewall drop (which shows as a timeout). Here is a structured way to diagnose it the next time it happens, based on how the service is wired in this repo.Step 1 — Check the service state immediately when it fails
The most important line is the
Active:field. You will see one of:active (running)failed (Result: start-limit-hit)failed (Result: exit-code)inactive (dead)systemctl stop)Step 2 — Read the actual crash reason
This shows
log.Fatalfoutput frommain.goand any Go panic stack traces. Please paste this output in a follow-up comment — it is the single most useful piece of information for diagnosing the root cause.Step 3 — Check for OOM kills
Many cheap VPS instances with 512 MB–1 GB RAM run out of memory under combined Xray + panel load. The kernel OOM killer silently terminates the process and leaves a kernel log message:
If you see lines like
Out of memory: Kill process ... (x-ui), this is the cause.Step 4 — Check the start-limit situation
The service file (
x-ui.service.debian) hasRestart=on-failurewith noStartLimitIntervalSecoverride, so systemd applies its default (5 restart attempts per 10 seconds). If x-ui crashes faster than that, the unit enters the permanentfailedstate and will not restart automatically until you run:This would also explain why "Update Menu" sometimes appeared to fix the issue — rerunning any management command that calls
systemctl restartcan work from the failed state in some systemd versions.Step 5 — Confirm the port is actually in use (or not)
When the issue is active, check whether anything is listening on port 2053 (the default panel port):
If nothing appears, x-ui is not running. If something else appears, there is a port conflict.
What to share here
To identify the root cause please provide the output of these commands while the panel is inaccessible:
systemctl status x-uijournalctl -u x-ui -n 100 --no-pagerdmesg | grep -iE "killed|oom" | tail -20ss -tlnp | grep 2053free -h)x-ui→ option to show settings, orjournalctl -u x-ui | grep -i xray | head -5)With those details the actual failure path should be clear.