mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5741] [Bug]: [ERR] Certificate files not found after installation #3991
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#3991
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 @skorphil on GitHub (Jul 2, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5741
Describe the bug
Cant get cert via sudo 3x-ui -> 20 -> 6
How to reproduce the problem
sudo 3x-ui206Expected behavior
No response
Actual behavior
Error at the end
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
Ubuntu 24 Minimal AArch
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 (Jul 2, 2026):
I traced this against the current
x-ui.shsource (menu20→6maps tossl_cert_issue_for_ip()). The flow there is:~/.acme.sh/acme.sh --issue -d <IP> --standalone --server letsencrypt --certificate-profile shortlived --days 6 --httpport <port> --force(x-ui.sh:1609-1617) — this is what succeeded and produced yourYour cert is in: /root/.acme.sh/<IP>_ecc/.../Certificate issued successfullylines.~/.acme.sh/acme.sh --installcert -d <IP> --key-file /root/cert/ip/privkey.pem --fullchain-file /root/cert/ip/fullchain.pem --reloadcmd \"systemctl restart x-ui ...\"(x-ui.sh:1634-1637) — this is supposed to copy the just-issued cert into/root/cert/ip/.x-ui.shthen checks that/root/cert/ip/fullchain.pemand/root/cert/ip/privkey.pemactually exist (x-ui.sh:1639-1647). That check is intentionally file-based rather than exit-code-based (see the comment atx-ui.sh:1632-1633) specifically because a failingreloadcmdalone can make--installcertreturn non-zero even though the files were copied fine. In your case the check still failed, which produced[ERR] Certificate files not found after installation— meaning step 2 genuinely did not create those two files, not just a false-positive exit code.The
It seems that you are using sudo...line is printed byacme.shitself (not 3x-ui code), and its position in your log — right where--installcertstarts — suggests that call is failing or exiting early in your environment. Your pasted log doesn't include whatever--installcertitself printed between that warning and the final[ERR]line, which would normally contain the actual reason.To pin this down, could you provide:
[ERR] Certificate files not found after installation(i.e. whatever--installcertprinted).ls -la /root/.acme.sh/<IP>_ecc/— to confirm the source.cer/.keyfiles acme.sh reported actually exist there.sudo 3x-ui, or already arootshell with a redundantsudo— i.e. is$SUDO_USERactually set to a different account in your session.~/.acme.sh/acme.sh --version.As a workaround to try in the meantime: open a real root shell first (
sudo -iorsu -) so$SUDO_USERis unset for the session, then runx-ui(withoutsudo) and retry option20→6.This reply was generated automatically by an AI agent; a maintainer may follow up.
@skorphil commented on GitHub (Jul 2, 2026):
3 with sudo
4. already provided
@MHSanaei commented on GitHub (Jul 2, 2026):
Fixed in
62f30390. Root cause: acme.sh guards every non-install command behind its sudo check — when a non-root user runs the panel scripts viasudo, it prints the sudo-wiki warning and exits before doing anything unlessFORCEis set. All our--issuecalls already passed--force(which is why issuance succeeded), but none of the--installcertcalls did, so installation aborted before copying the files and the script reported "Certificate files not found after installation". Every--installcertin x-ui.sh / install.sh / update.sh now passes--forceto match. Until the next release,sudo -ifirst and then runningx-uiworks around it.