[GH-ISSUE #5548] [Bug]: Installed the latest 3X-UI, can't use it and found there's an extra ':' symbol #3873

Closed
opened 2026-10-31 20:35:33 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @qq79115085 on GitHub (Jun 25, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5548

Describe the bug

[Bug]: Installed the latest 3X-UI, can't use it and found there's an extra ':' symbol
Username: Z5JiU03UKS
Password: 8g3BGZ82No
Port:
WebBasePath: yQbbt2qYLuq9TCxwS4
Database: SQLite (/etc/x-ui/x-ui.db)
Access URL: https://www.xxxx.com:/yQbbt2qYLuq9TCxwS4
API Token: bnWWibVf9SGIM18jp2Il4WeMnL0ukM60kcZMJoaPSuxwm9IU

How to reproduce the problem

Installed the latest 3X-UI, can't use it and found there's an extra ':' symbol

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.4.0

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04 64 Bit

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 @qq79115085 on GitHub (Jun 25, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5548 ### Describe the bug [Bug]: Installed the latest 3X-UI, can't use it and found there's an extra ':' symbol Username: Z5JiU03UKS Password: 8g3BGZ82No Port: WebBasePath: yQbbt2qYLuq9TCxwS4 Database: SQLite (/etc/x-ui/x-ui.db) Access URL: https://www.xxxx.com:/yQbbt2qYLuq9TCxwS4 API Token: bnWWibVf9SGIM18jp2Il4WeMnL0ukM60kcZMJoaPSuxwm9IU ### How to reproduce the problem Installed the latest 3X-UI, can't use it and found there's an extra ':' symbol ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.4.0 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 64 Bit ### 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:33 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

The stray : in the Access URL is caused by a bug in install.sh that leaves config_port empty when the installer cannot apply settings.

Root cause

During interactive installation, lines 1155–1163 of install.sh ask whether you want to customise the panel port. If you answer y and then press Enter without typing a port number, the shell variable config_port stays empty. The installer then runs:

x-ui setting -username "..." -password "..." -port "" -webBasePath "..."

The setting subcommand is declared with flag.NewFlagSet("setting", flag.ExitOnError) (main.go:541) and -port is registered as IntVar (main.go:561). Go's flag package cannot parse "" as an integer; with ExitOnError it calls os.Exit(2) immediately — before updateSetting is ever reached. Because install.sh does not check the exit code of that command, the script continues, displays the locally-generated credential variables, and constructs the Access URL as:

${SSL_SCHEME}://${SSL_HOST}:${config_port}/${config_webBasePath}

With an empty config_port this produces https://www.xxxx.com:/yQbbt2qYLuq9TCxwS4 — a URL no browser or client will parse correctly.

Actual database state

Because the x-ui setting command exited before writing anything, the database was never updated. It retains factory defaults:

Setting Value
Port 2053 (default, internal/web/service/setting.go:38)
Username admin
Password admin
WebBasePath (empty)

The TLS certificate was configured: the x-ui cert command inside ssl_cert_issue runs as a separate invocation and succeeds regardless of the settings failure.

How to recover

Open the panel at the default port with the default credentials:

https://<your-domain>:2053/

Log in with admin / admin. Once inside, go to Panel Settings to set a secure username, password, port, and WebBasePath. Alternatively use the CLI:

# Check actual stored values
x-ui setting -show true

# Apply new values in one command (replace values as desired)
x-ui setting -username "newuser" -password "newpassword" -port 54321 -webBasePath "randomstring18chars"

# Restart the service to pick up the port change
systemctl restart x-ui

Bug summary

  • install.sh line 1158 does not validate the user-entered port (empty or non-numeric values are accepted silently).
  • install.sh line 1166 does not check the exit code of x-ui setting, so a flag-parse failure is invisible.
  • install.sh line 1192 constructs the URL unconditionally with :${config_port}, producing a malformed URL when the variable is empty.

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

<!-- gh-comment-id:4795495231 --> @github-actions[bot] commented on GitHub (Jun 25, 2026): The stray `:` in the Access URL is caused by a bug in `install.sh` that leaves `config_port` empty when the installer cannot apply settings. **Root cause** During interactive installation, lines 1155–1163 of `install.sh` ask whether you want to customise the panel port. If you answer `y` and then press Enter without typing a port number, the shell variable `config_port` stays empty. The installer then runs: ``` x-ui setting -username "..." -password "..." -port "" -webBasePath "..." ``` The `setting` subcommand is declared with `flag.NewFlagSet("setting", flag.ExitOnError)` (main.go:541) and `-port` is registered as `IntVar` (main.go:561). Go's flag package cannot parse `""` as an integer; with `ExitOnError` it calls `os.Exit(2)` immediately — before `updateSetting` is ever reached. Because `install.sh` does not check the exit code of that command, the script continues, displays the locally-generated credential variables, and constructs the Access URL as: ``` ${SSL_SCHEME}://${SSL_HOST}:${config_port}/${config_webBasePath} ``` With an empty `config_port` this produces `https://www.xxxx.com:/yQbbt2qYLuq9TCxwS4` — a URL no browser or client will parse correctly. **Actual database state** Because the `x-ui setting` command exited before writing anything, the database was never updated. It retains factory defaults: | Setting | Value | |---|---| | Port | 2053 (default, `internal/web/service/setting.go:38`) | | Username | `admin` | | Password | `admin` | | WebBasePath | *(empty)* | The TLS certificate **was** configured: the `x-ui cert` command inside `ssl_cert_issue` runs as a separate invocation and succeeds regardless of the settings failure. **How to recover** Open the panel at the default port with the default credentials: ``` https://<your-domain>:2053/ ``` Log in with `admin` / `admin`. Once inside, go to **Panel Settings** to set a secure username, password, port, and WebBasePath. Alternatively use the CLI: ```bash # Check actual stored values x-ui setting -show true # Apply new values in one command (replace values as desired) x-ui setting -username "newuser" -password "newpassword" -port 54321 -webBasePath "randomstring18chars" # Restart the service to pick up the port change systemctl restart x-ui ``` **Bug summary** - `install.sh` line 1158 does not validate the user-entered port (empty or non-numeric values are accepted silently). - `install.sh` line 1166 does not check the exit code of `x-ui setting`, so a flag-parse failure is invisible. - `install.sh` line 1192 constructs the URL unconditionally with `:${config_port}`, producing a malformed URL when the variable is empty. *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@qq79115085 commented on GitHub (Jun 25, 2026):

Sorry, my bad. It's fixed and installed successfully, but I found that I always have to reinstall 3X-UI.

<!-- gh-comment-id:4795601090 --> @qq79115085 commented on GitHub (Jun 25, 2026): Sorry, my bad. It's fixed and installed successfully, but I found that I always have to reinstall 3X-UI.
Author
Owner

@w3struk commented on GitHub (Jun 25, 2026):

Sorry, my bad. It's fixed and installed successfully, but I found that I always have to reinstall 3X-UI.

please close issue

<!-- gh-comment-id:4795763799 --> @w3struk commented on GitHub (Jun 25, 2026): > Sorry, my bad. It's fixed and installed successfully, but I found that I always have to reinstall 3X-UI. please close issue
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#3873
No description provided.