[GH-ISSUE #5887] [Bug]: WireGuard export function for peer not working #4081

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

Originally created by @iamirh3 on GitHub (Jul 10, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5887

Describe the bug

wiregaurd export function for peer not work in last version v26.6.27

How to reproduce the problem

wiregaurd export function for peer not work in last version v26.6.27

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

26.6.27

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 22

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

  • 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 @iamirh3 on GitHub (Jul 10, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5887 ### Describe the bug wiregaurd export function for peer not work in last version v26.6.27 ### How to reproduce the problem wiregaurd export function for peer not work in last version v26.6.27 ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 26.6.27 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 22 ### 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 - [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:37:02 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jul 10, 2026):

This looks like one of several confirmed defects in WireGuard's new multi-client implementation, which shipped in v3.4.2 and has already had multiple fixes land on main that are not yet in any tagged release. Note: the "3x-ui version" field says 26.6.27 — per the v3.4.2 release notes ("bundled core bumped to xray-core v26.6.27"), that's the Xray-core version, not the panel version, so I'm treating this as 3x-ui v3.4.2 (the current latest release, and what install.sh installs).

Title: WireGuard per-client export/config generation and live peer sync have multiple correctness bugs in v3.4.2's new multi-client implementation

Severity: High

Category: Correctness

Why this matters: v3.4.2 reworked WireGuard inbounds from single-peer to full multi-client. Comparing v3.4.2...main, three defects in that rework were found and fixed afterward, none of which are in v3.4.2 or any tagged release:

  • f90e4a69 — the per-client WireGuard config shown/downloaded from the Clients page (ClientQrModal.tsx / ClientInfoModal.tsx, built by buildWireguardClientConfig in frontend/src/pages/clients/wireguardConfig.ts) used the master panel's hostname for Endpoint = instead of the hosting node's address, so an exported .conf/QR for a WireGuard inbound running on a managed sub-node pointed at the wrong server. This only affects multi-node setups (or an inbound using a non-default share-address strategy) — a plain standalone panel already fell back to the correct host.
  • cb5b3a80 — the live gRPC apply path ((*Inbound).GenXrayInboundConfig in internal/database/model/model.go, invoked by Local.AddInbound/UpdateInbound in internal/web/runtime/local.go) never converted the panel's settings.clients into the peers array xray-core's WireGuard inbound expects. Certain inbound-level edits push the WireGuard inbound back to the running Xray process with zero peers, disconnecting every client on that inbound until Xray is fully restarted. The exported .conf itself still looks correct (it's built from the database, not the live process), but the peer can't actually connect. Per the fix commit, this hit both node-managed inbounds edited from the master and "plain WireGuard inbound edits on a standalone panel."
  • d2efe9b0 — WireGuard clients were missing entirely from the Clash and JSON subscription outputs (only the raw subscription/QR path worked).

Recommendation: The fixes are already on main (v3.4.2 added an in-panel option to switch to the rolling dev channel from a stable build, Settings → General) but are not yet in a tagged release. As an immediate workaround, after adding or editing a WireGuard client, use "Restart Xray" on the panel's status card to force a full config regeneration, then re-export the peer's config. A maintainer may decide whether to backport these specific commits into a patch release — tagging @MHSanaei.

To confirm exactly which of the three this is, could you provide:

  1. The exact panel version shown by running x-ui on the server (top of the management menu) — 26.6.27 above is the Xray-core version, not the panel version.
  2. Where you click "export" — the Clients page (the per-client WireGuard config / QR / download button) or the Inbounds page ("Export All URLs")? And what actually happens: nothing appears, an empty/incomplete file, a file with an obviously wrong Endpoint, or a file that downloads fine but the peer just can't connect?
  3. Whether this panel manages any remote nodes (Nodes page), or is a single standalone panel.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4930736240 --> @github-actions[bot] commented on GitHub (Jul 10, 2026): This looks like one of several confirmed defects in WireGuard's new multi-client implementation, which shipped in v3.4.2 and has already had multiple fixes land on `main` that are not yet in any tagged release. Note: the "3x-ui version" field says `26.6.27` — per the v3.4.2 release notes ("bundled core bumped to xray-core v26.6.27"), that's the **Xray-core** version, not the panel version, so I'm treating this as 3x-ui v3.4.2 (the current latest release, and what `install.sh` installs). **Title:** WireGuard per-client export/config generation and live peer sync have multiple correctness bugs in v3.4.2's new multi-client implementation **Severity:** High **Category:** Correctness **Why this matters:** v3.4.2 reworked WireGuard inbounds from single-peer to full multi-client. Comparing `v3.4.2...main`, three defects in that rework were found and fixed afterward, none of which are in v3.4.2 or any tagged release: - `f90e4a69` — the per-client WireGuard config shown/downloaded from the Clients page (`ClientQrModal.tsx` / `ClientInfoModal.tsx`, built by `buildWireguardClientConfig` in `frontend/src/pages/clients/wireguardConfig.ts`) used the master panel's hostname for `Endpoint =` instead of the hosting node's address, so an exported `.conf`/QR for a WireGuard inbound running on a managed sub-node pointed at the wrong server. This only affects multi-node setups (or an inbound using a non-default share-address strategy) — a plain standalone panel already fell back to the correct host. - `cb5b3a80` — the live gRPC apply path (`(*Inbound).GenXrayInboundConfig` in `internal/database/model/model.go`, invoked by `Local.AddInbound`/`UpdateInbound` in `internal/web/runtime/local.go`) never converted the panel's `settings.clients` into the `peers` array xray-core's WireGuard inbound expects. Certain inbound-level edits push the WireGuard inbound back to the running Xray process with **zero peers**, disconnecting every client on that inbound until Xray is fully restarted. The exported `.conf` itself still looks correct (it's built from the database, not the live process), but the peer can't actually connect. Per the fix commit, this hit both node-managed inbounds edited from the master and "plain WireGuard inbound edits on a standalone panel." - `d2efe9b0` — WireGuard clients were missing entirely from the Clash and JSON subscription outputs (only the raw subscription/QR path worked). **Recommendation:** The fixes are already on `main` (v3.4.2 added an in-panel option to switch to the rolling dev channel from a stable build, Settings → General) but are not yet in a tagged release. As an immediate workaround, after adding or editing a WireGuard client, use "Restart Xray" on the panel's status card to force a full config regeneration, then re-export the peer's config. A maintainer may decide whether to backport these specific commits into a patch release — tagging @MHSanaei. To confirm exactly which of the three this is, could you provide: 1. The exact panel version shown by running `x-ui` on the server (top of the management menu) — `26.6.27` above is the Xray-core version, not the panel version. 2. Where you click "export" — the Clients page (the per-client WireGuard config / QR / download button) or the Inbounds page ("Export All URLs")? And what actually happens: nothing appears, an empty/incomplete file, a file with an obviously wrong `Endpoint`, or a file that downloads fine but the peer just can't connect? 3. Whether this panel manages any remote nodes (Nodes page), or is a single standalone panel. *This reply was generated automatically; a maintainer may follow up.*
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#4081
No description provided.