mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5829] [Bug]: Pressing Enter for default ACME port shows an incorrect error message #4049
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#4049
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 @dimadr on GitHub (Jul 6, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5829
Describe the bug
When issuing a TLS certificate, the installer asks:
If the user simply presses Enter to accept the default port, the script displays:
The behavior is correct (port 80 is used), but the message is misleading.
Accepting the default value is a normal workflow and should not be reported as an error.
How to reproduce the problem
The installer uses port 80 but prints:
Expected behavior
Pressing Enter should accept the default port without showing an error.
Expected output could be:
[INF] Will use port: 80
or:
[INF] Using default port: 80
Actual behavior
Pressing Enter accepts the default port 80, but the installer prints an error message:
[ERR] Your input is invalid, will use default port 80.
This is misleading because empty input means accepting the default value.
Relevant logs
Screenshots
3x-ui version
3.4.2
Xray-core version
26.6.27
How did you install 3x-ui?
install.sh script
Operating system
Debian 13.5
Which parts of the panel are affected?
Other
Browser (only if it is a UI bug)
Not applicable
Is the panel behind a reverse proxy or CDN?
No — direct access
Before submitting
@github-actions[bot] commented on GitHub (Jul 6, 2026):
Confirmed in the source. The port-validation check treats an empty response (pressing Enter to accept the default) the same as an out-of-range number.
In
x-ui.sh,ssl_cert_issue():When
WebPortis empty, bash's arithmetic comparison evaluates the empty string as0, so${WebPort} -lt 1is true and theLOGE([ERR]) branch fires even though nothing invalid was entered — the pre-setWebPort=80default was simply left untouched. The fix used for the rest of the port ultimately works, just the message is wrong.The same pattern exists in two other places with the identical prompt and check:
install.sh:681-685(prompt_or_default WebPort ..., then the same-gt/-ltcheck)update.sh:500-504(plainread -rp, same check)All three would need the guard to distinguish "empty input" (accept default, log as info) from "non-numeric or out-of-range input" (log as error), e.g. by checking
[[ -z "${WebPort}" ]]separately before the numeric range check.This is a cosmetic/log-message issue only — the resulting port (80) is correct in all cases.
This reply was generated automatically. A maintainer may follow up with further questions or feedback.