Skip to content

Bug #78

Description

@FarshadAghili07

Bug: New Xray client connections don't work until the container is manually restarted
Version: v1.5.0
Component: Xray (VLESS-Reality) — user/connection management
Description
When adding a new Xray connection to a non-admin user via Users → (link icon) → Add connection → Create new connection, the panel successfully:
Writes the new client (id, flow, email) into /opt/amnezia/xray/server.json inside the amnezia-xray container
Generates a valid vless:// config (correct pbk, sni, sid, flow, etc.) that the user can import into the Amnezia client
However, the running Xray process does not pick up the new client. The client can complete the initial Reality/TLS handshake (the server responds, and apps show "Connected"), but no actual traffic passes through — it appears the new client ID doesn't exist from the live process's point of view, even though it's present in the on-disk server.json.
Restarting the container manually resolves it immediately:
Bash
After the restart, the exact same (unmodified) config the user already had works correctly.
Reproduction steps
Add an existing linked server (installed via the official Amnezia app) to the panel.
Go to Users, create a non-admin user.
Click the link icon next to the user → Add connection → Operation Type: Create new connection → Server: (your server) → Protocol: Xray.
Copy the generated vless:// link into an Amnezia client and connect.
Observe: handshake succeeds / client shows "Connected", but no data is transferred (sites don't load, curl/myip tests time out).
Run sudo docker restart amnezia-xray on the server.
Reconnect with the same config — it now works correctly.
Additional context
Confirmed the new client is present in server.json on disk immediately after creation (docker exec amnezia-xray cat /opt/amnezia/xray/server.json), so the write path is correct.
server.json includes an api block with HandlerService enabled, and an api inbound on 127.0.0.1:10085, suggesting the panel is intended to hot-update Xray via the gRPC API rather than requiring a restart — but this hot-update does not appear to take effect for newly created user connections.
Related: when first attempting to add a connection for a user (before any manual restart), the panel returned this explicit error:
Error: Xray runtime API is not available for hot user updates. The server config was upgraded, but the container must be restarted once to enable HandlerService. Restart the Xray container manually and try again.
This suggests the panel is aware the hot-update mechanism isn't always available, but after that one restart, subsequent new users still silently fail to receive live updates (no error shown) until another manual restart.
A separate, likely related bug: adding a new WireGuard connection via the same "Add connection" dialog fails immediately with:
Error: WireGuardManager.add_client() takes 3 positional arguments but 5 were given
Expected behavior
Newly created Xray (and WireGuard) client connections for non-admin users should work immediately after creation, without requiring a manual docker restart amnezia-xray.
Environment
Ubuntu 22.04 (AWS EC2)
Panel installed via Method 1 (git clone + venv), v1.5.0
Server was originally provisioned via the official Amnezia mobile app, then linked to the panel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions