[GH-ISSUE #4932] [Bug]: After the update, the panel files disappeared. #3452

Closed
opened 2026-10-31 20:32:31 +07:00 by bsakaguchi · 1 comment
Owner

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

Describe the bug

While updating my nodes from version 3.2.0 to 3.2.7, I lost full access to the node. It turned out that during the update, all files from the /usr/local/x-ui/ folder were deleted. The only solution was to run the installation script and restart the x-ui service.

How to reproduce the problem

I don't know, maybe the script crashed or the GitHub servers didn't give me the new version.

Expected behavior

the panel will update and launch

Actual behavior

The panel stopped and the panel files disappeared

Relevant logs

It was last night (04.06) at about 2am (GMT +3) there are no logs anymore, only warnings from xray

Screenshots

No response

3x-ui version

3.2.7

Xray-core version

v26.6.1

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 24.04

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

  • 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 @Maybeoff on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4932 ### Describe the bug While updating my nodes from version 3.2.0 to 3.2.7, I lost full access to the node. It turned out that during the update, all files from the /usr/local/x-ui/ folder were deleted. The only solution was to run the installation script and restart the x-ui service. ### How to reproduce the problem I don't know, maybe the script crashed or the GitHub servers didn't give me the new version. ### Expected behavior the panel will update and launch ### Actual behavior The panel stopped and the panel files disappeared ### Relevant logs ```shell It was last night (04.06) at about 2am (GMT +3) there are no logs anymore, only warnings from xray ``` ### Screenshots _No response_ ### 3x-ui version 3.2.7 ### Xray-core version v26.6.1 ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 24.04 ### 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 - [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:32:31 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Thank you for the report. I've traced through the update script to understand what likely happened.

What the update script does

When you run x-ui update, it calls update.sh, which does the following before extracting the new version:

  1. Downloads the new tarball to /usr/local/x-ui-linux-amd64.tar.gz
  2. Stops the service and removes the systemd unit file
  3. Removes individual files from /usr/local/x-ui/: the x-ui binary, x-ui.sh, bin/xray-linux-amd64, and the service files

Then it extracts the new tarball and re-installs everything.

Where it can silently break

The critical extraction step in update.sh (line 875) is:

tar zxvf x-ui-linux-$(arch).tar.gz > /dev/null 2>&1

Because output is redirected to /dev/null, a failed extraction produces no visible error. The tarball is then deleted on the very next line regardless. If tar fails here — due to a corrupted or truncated download, a disk-space shortage, or an SSH session being interrupted mid-run — the old binaries are already gone and the new ones were never written. This matches what you observed.

Your database is safe

The database and all your inbound/client configuration live in /etc/x-ui/x-ui.db. Neither the update script nor the install script ever touches /etc/x-ui/. Only x-ui uninstall removes that directory. Your data was never at risk.

What you did was correct

Re-running bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) and restarting the service is exactly the right recovery step. The installer detects that credentials and config already exist and preserves them.

Suggestions to prevent this in future

Run long-running admin commands inside a terminal multiplexer so an SSH disconnect cannot kill the script mid-way:

tmux new -s update
x-ui update

If you ever see the panel fail to start after an update, check whether /usr/local/x-ui/x-ui and /usr/local/x-ui/bin/xray-linux-amd64 still exist — if either is missing, re-run the install script.

The underlying bug

Silently suppressing tar errors during the update (redirecting them to /dev/null) means a failed extraction leaves the system in this broken half-updated state with no warning. Errors at that step should not be discarded.

<!-- gh-comment-id:4626375709 --> @github-actions[bot] commented on GitHub (Jun 4, 2026): Thank you for the report. I've traced through the update script to understand what likely happened. **What the update script does** When you run `x-ui update`, it calls `update.sh`, which does the following before extracting the new version: 1. Downloads the new tarball to `/usr/local/x-ui-linux-amd64.tar.gz` 2. Stops the service and removes the systemd unit file 3. Removes individual files from `/usr/local/x-ui/`: the `x-ui` binary, `x-ui.sh`, `bin/xray-linux-amd64`, and the service files Then it extracts the new tarball and re-installs everything. **Where it can silently break** The critical extraction step in `update.sh` (line 875) is: ```bash tar zxvf x-ui-linux-$(arch).tar.gz > /dev/null 2>&1 ``` Because output is redirected to `/dev/null`, a failed extraction produces no visible error. The tarball is then deleted on the very next line regardless. If `tar` fails here — due to a corrupted or truncated download, a disk-space shortage, or an SSH session being interrupted mid-run — the old binaries are already gone and the new ones were never written. This matches what you observed. **Your database is safe** The database and all your inbound/client configuration live in `/etc/x-ui/x-ui.db`. Neither the update script nor the install script ever touches `/etc/x-ui/`. Only `x-ui uninstall` removes that directory. Your data was never at risk. **What you did was correct** Re-running `bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)` and restarting the service is exactly the right recovery step. The installer detects that credentials and config already exist and preserves them. **Suggestions to prevent this in future** Run long-running admin commands inside a terminal multiplexer so an SSH disconnect cannot kill the script mid-way: ```bash tmux new -s update x-ui update ``` If you ever see the panel fail to start after an update, check whether `/usr/local/x-ui/x-ui` and `/usr/local/x-ui/bin/xray-linux-amd64` still exist — if either is missing, re-run the install script. **The underlying bug** Silently suppressing `tar` errors during the update (redirecting them to `/dev/null`) means a failed extraction leaves the system in this broken half-updated state with no warning. Errors at that step should not be discarded.
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#3452
No description provided.