mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5806] [Bug]: Failed Fresh Install: PostgreSQL Connection Failed and Fail2ban installation Failed #4038
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#4038
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 @Masterain98 on GitHub (Jul 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5806
Describe the bug
I'm installing the latest version on a Rocky Linux 9 server, and got two issues that makes 3x-ui failed to start:
This might be the same error with #4876, but it happens again now.
Here are console output:
How to reproduce the problem
Use the default install command to install 3x-ui, use default PostgreSQL installation and choose IP certificate.
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.4.2
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
Rocky Linux 9.2
Which parts of the panel are affected?
Install / upgrade script
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
No — direct access
Before submitting
@github-actions[bot] commented on GitHub (Jul 5, 2026):
Both symptoms are confirmed, separate bugs in the current
install.sh/x-ui.sh(v3.4.2), not something specific to your server.1. PostgreSQL "Ident authentication failed"
install_postgres_local()ininstall.sh(around line 183) creates the random PostgreSQL role/database and builds a TCP DSN (postgres://<user>:<pass>@127.0.0.1:5432/xui?sslmode=disable), but it never touchespg_hba.conf. On RHEL-family distros (Rocky, AlmaLinux, RHEL, Fedora),postgresql-setup --initdbships a defaultpg_hba.confwhere TCP connections useidentauth, which checks the OS username against the Postgres role name — this always fails for a randomly generated role name, regardless of password. Debian/Ubuntu defaults usemd5/peer, so the same installer works fine there, which is why this doesn't show up universally.This is the same root cause as #4876, which was closed as fixed, but the fix does not appear to be present in the current source —
install_postgres_local()still has nopg_hba.confhandling. It looks like it has resurfaced (or the earlier fix never actually landed).Workaround until this is patched, on the affected server:
2. Fail2ban install failing ("No match for argument: fail2ban")
setup_fail2ban_iplimit()inx-ui.sh(around line 2288) runs, for thefedora | amzn | virtuozzo | rhel | almalinux | rocky | olgroup:with no EPEL setup first.
fail2banis not shipped in Rocky Linux's BaseOS/AppStream/Extras repos (as your log'sMetadata cache createdoutput shows) — it only exists in EPEL. The siblingcentosbranch of the same function does runyum install epel-release -ybefore installing on CentOS 7, but that EPEL step is missing for the rest of the RHEL family (Rocky/Alma/RHEL/Fedora/etc.), so it fails there.Workaround:
(
x-ui setup-fail2banre-runs the same routine and will pick up the now-installedfail2ban-client.)Neither of these affects the panel binary itself — once PostgreSQL auth is fixed (issue 1), the panel will start; issue 2 only disables the IP Limit feature until
fail2ban-clientis present.This reply was generated automatically by an issue-triage assistant; a maintainer may follow up.