[GH-ISSUE #4817] [Bug]: Panel state: Not Installed on docker runs #3349

Closed
opened 2026-10-31 20:31:49 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @abz-the-jit on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4817

Describe the bug

when using docker to run the app and exec to container for eg x-ui restart-xray its hit us with "[ERR] Please install the panel first"

Image

app is working but we cant use docker exec

How to reproduce the problem

use the docker for running the app
run x-ui restart-xray with docker exec

Expected behavior

let it run . dont show error?

Actual behavior

i

Relevant logs


Screenshots

Image

3x-ui version

3.2.6

Xray-core version

No response

How did you install 3x-ui?

Docker / Docker Compose

Operating system

windows

Which parts of the panel are affected?

Docker image

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 @abz-the-jit on GitHub (Jun 2, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4817 ### Describe the bug when using docker to run the app and exec to container for eg x-ui restart-xray its hit us with "[ERR] Please install the panel first" <img width="421" height="86" alt="Image" src="https://github.com/user-attachments/assets/05ed7494-77c4-4d54-9e57-5cd35b690138" /> app is working but we cant use docker exec ### How to reproduce the problem use the docker for running the app run x-ui restart-xray with docker exec ### Expected behavior let it run . dont show error? ### Actual behavior i ### Relevant logs ```shell ``` ### Screenshots <img width="348" height="368" alt="Image" src="https://github.com/user-attachments/assets/1dd149fe-f1ae-4d82-9322-ec4f4dbed9c3" /> ### 3x-ui version 3.2.6 ### Xray-core version _No response_ ### How did you install 3x-ui? Docker / Docker Compose ### Operating system windows ### Which parts of the panel are affected? Docker image ### 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:31:49 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Thanks for the clear report!

Root cause: The x-ui CLI script (x-ui.sh) uses check_status() to verify the panel is installed by looking for a systemd service file (x-ui.service) or Alpine's /etc/init.d/x-ui. In a Docker container neither of these exists — the panel runs directly as a process — so every CLI command hits the "Please install the panel first" guard.

This has been reported before (#1944, #4225) but was never resolved, so tracking it as a bug is the right call.

Workarounds until this is fixed:

  1. Restart Xray from the web UI — go to the panel dashboard and use the restart button there.
  2. Restart the whole container — this also restarts Xray:
    docker restart <container_name>
    
  3. Send SIGHUP / use the API directly inside the container — if you need finer control, you can use the panel's API endpoints from within the container rather than the x-ui shell menu.

Suggested fix (for contributors): check_status() should detect a Docker environment (e.g. check for /.dockerenv or the DOCKER env var) and fall back to checking whether the x-ui process is running (pgrep -x x-ui) instead of looking for a service file.

<!-- gh-comment-id:4603739611 --> @github-actions[bot] commented on GitHub (Jun 2, 2026): Thanks for the clear report\! **Root cause:** The `x-ui` CLI script (`x-ui.sh`) uses `check_status()` to verify the panel is installed by looking for a **systemd service file** (`x-ui.service`) or Alpine's `/etc/init.d/x-ui`. In a Docker container neither of these exists — the panel runs directly as a process — so every CLI command hits the \"Please install the panel first\" guard. This has been reported before (#1944, #4225) but was never resolved, so tracking it as a bug is the right call. **Workarounds until this is fixed:** 1. **Restart Xray from the web UI** — go to the panel dashboard and use the restart button there. 2. **Restart the whole container** — this also restarts Xray: ``` docker restart <container_name> ``` 3. **Send SIGHUP / use the API directly inside the container** — if you need finer control, you can use the panel's API endpoints from within the container rather than the `x-ui` shell menu. **Suggested fix (for contributors):** `check_status()` should detect a Docker environment (e.g. check for `/.dockerenv` or the `DOCKER` env var) and fall back to checking whether the `x-ui` process is running (`pgrep -x x-ui`) instead of looking for a service file.
Author
Owner

@MHSanaei commented on GitHub (Jun 2, 2026):

Fixed: the x-ui CLI now detects when it runs inside a container and manages the panel via its process and Unix signals instead of systemd/OpenRC.

  • check_status derives state from the running /app/x-ui process (no service file needed), so commands are no longer blocked by "Please install the panel first".
  • x-ui restart-xray sends SIGUSR1 and x-ui restart sends SIGHUP + SIGUSR1 to the panel process.
  • start/stop/enable/disable print Docker-appropriate guidance.

Verified end-to-end against a freshly built image: restart-xray cycles the xray PID, restart restarts the panel servers in-process while the web port stays up, and the menu shows "Panel state: Running".

<!-- gh-comment-id:4606294104 --> @MHSanaei commented on GitHub (Jun 2, 2026): Fixed: the `x-ui` CLI now detects when it runs inside a container and manages the panel via its process and Unix signals instead of systemd/OpenRC. - `check_status` derives state from the running `/app/x-ui` process (no service file needed), so commands are no longer blocked by "Please install the panel first". - `x-ui restart-xray` sends SIGUSR1 and `x-ui restart` sends SIGHUP + SIGUSR1 to the panel process. - `start/stop/enable/disable` print Docker-appropriate guidance. Verified end-to-end against a freshly built image: `restart-xray` cycles the xray PID, `restart` restarts the panel servers in-process while the web port stays up, and the menu shows "Panel state: Running".
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#3349
No description provided.