[GH-ISSUE #5189] [Bug]: Subscription JSON output doesn't contain the client UUID #3642

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

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

Describe the bug

By default, the format of the vless outbounds is like this:

  "outbounds" : [
    {
      "protocol" : "vless",
      "settings" : {
        "vnext" : [
          {
            "address" : "YOUR_SERVER_ADDRESS",
            "port" : YOUR_INBOUND_PORT,
            "users" : [
              {
                "encryption" : "none",
                "id" : "YOUR_CLIENT_UUID"
              }
            ]
          }
        ]
      },
      rest of content...

But in the new version, the output of the subscription (JSON only) is like below:

  "outbounds" : [
    {
      "protocol" : "vless",
      "settings" : {
        "address" : "YOUR_SERVER_ADDRESS",
        "port" : YOUR_INBOUND_PORT
      },
      rest of content...

The vnext object has been accidentally removed from the returned object, resulting in clients being unable to connect to the server with their JSON subscription...

How to reproduce the problem

  1. Get a subscription (JSON) link for one of your clients, which is linked to a vless inbound.
  2. Try to import it into any app that supports subscriptions (I used Streisand).
  3. Update your subscription to import new links from the link.
  4. Your app probably shows you an error message related to the invalid format of the returned config. If nothing shows, please try viewing the imported links in JSON format and check the mentioned issue.

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.3.0

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

Which parts of the panel are affected?

Subscription (share links / Clash / JSON)

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 @ArshiaDadras on GitHub (Jun 10, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5189 ### Describe the bug By default, the format of the vless outbounds is like this: ``` "outbounds" : [ { "protocol" : "vless", "settings" : { "vnext" : [ { "address" : "YOUR_SERVER_ADDRESS", "port" : YOUR_INBOUND_PORT, "users" : [ { "encryption" : "none", "id" : "YOUR_CLIENT_UUID" } ] } ] }, rest of content... ``` But in the new version, the output of the subscription (JSON only) is like below: ``` "outbounds" : [ { "protocol" : "vless", "settings" : { "address" : "YOUR_SERVER_ADDRESS", "port" : YOUR_INBOUND_PORT }, rest of content... ``` The `vnext` object has been accidentally removed from the returned object, resulting in clients being unable to connect to the server with their JSON subscription... ### How to reproduce the problem 1. Get a subscription (JSON) link for one of your clients, which is linked to a vless inbound. 2. Try to import it into any app that supports subscriptions (I used Streisand). 3. Update your subscription to import new links from the link. 4. Your app probably shows you an error message related to the invalid format of the returned config. If nothing shows, please try viewing the imported links in JSON format and check the mentioned issue. ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.3.0 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### Which parts of the panel are affected? Subscription (share links / Clash / JSON) ### 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:33:54 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Thanks for the detailed report. I've traced this to its source.

Root cause

PR #4912 (merged 2026-06-04, shipped in v3.3.0) deliberately changed the JSON subscription format. The stated goal was to support the modern xray finalmask/fragment API. As a side-effect, the generator was changed to emit a flat outbound settings object for every protocol:

Protocol Old format New format (v3.3.0+)
VLESS settings.vnext[].users[].id settings.id (flat)
VMess settings.vnext[].users[].id settings.id (flat)
Trojan/Shadowsocks settings.servers[].password settings.password (flat)

The relevant code is in internal/sub/json_service.go at genVless() (line 323) and genVnext() (line 297). The unit tests in internal/sub/json_service_test.go (TestSubJsonServiceVlessFlattened, TestSubJsonServiceVmessFlattened, TestSubJsonServiceServerFlattened) explicitly assert this flat shape is correct and that vnext/servers are not present.

The PR commit note reads:

"Note: this is a breaking change — JSON subscriptions now require a recent xray client on the consumer side."

What this means in practice

The flat format is intended for recent xray-core builds (the project now tracks a 2026 xray-core, see go.mod). Clients that parse the JSON subscription as a standard xray outbound config — including the version of Streisand you're using — expect the traditional nested vnext/users structure and will reject the flat shape.

Workarounds while this is unresolved

  1. Standard (URI) subscription — Use /sub/<subid> instead of /json/<subid>. This generates plain vless://… / vmess://… / trojan://… URIs which all clients understand. Streisand supports this format (the subscription page's Streisand deeplink already points there).

  2. Import a hand-edited config — Take the JSON output, wrap the flat settings back into the vnext/users structure manually, and paste it directly into the client.

What needs to change

The flat format needs to be validated against the xray-core version bundled with this panel. If the flat format is not actually parseable by any released xray binary, genVless and genVnext should be reverted to use vnext[{address, port, users:[{id, encryption, flow}]}] and genServer to use servers[{address, port, password}]. A PR restoring the nested structure would fix all affected clients.

<!-- gh-comment-id:4674863415 --> @github-actions[bot] commented on GitHub (Jun 10, 2026): Thanks for the detailed report. I've traced this to its source. ## Root cause PR [#4912](https://github.com/MHSanaei/3x-ui/pull/4912) (merged 2026-06-04, shipped in v3.3.0) deliberately changed the JSON subscription format. The stated goal was to support the modern xray `finalmask`/fragment API. As a side-effect, the generator was changed to emit a **flat** outbound settings object for every protocol: | Protocol | Old format | New format (v3.3.0+) | |---|---|---| | VLESS | `settings.vnext[].users[].id` | `settings.id` (flat) | | VMess | `settings.vnext[].users[].id` | `settings.id` (flat) | | Trojan/Shadowsocks | `settings.servers[].password` | `settings.password` (flat) | The relevant code is in `internal/sub/json_service.go` at `genVless()` (line 323) and `genVnext()` (line 297). The unit tests in `internal/sub/json_service_test.go` (`TestSubJsonServiceVlessFlattened`, `TestSubJsonServiceVmessFlattened`, `TestSubJsonServiceServerFlattened`) explicitly assert this flat shape is correct and that `vnext`/`servers` are **not** present. The PR commit note reads: > *"Note: this is a breaking change — JSON subscriptions now require a recent xray client on the consumer side."* ## What this means in practice The flat format is intended for **recent xray-core builds** (the project now tracks a 2026 xray-core, see `go.mod`). Clients that parse the JSON subscription as a standard xray outbound config — including the version of **Streisand** you're using — expect the traditional nested `vnext`/`users` structure and will reject the flat shape. ## Workarounds while this is unresolved 1. **Standard (URI) subscription** — Use `/sub/<subid>` instead of `/json/<subid>`. This generates plain `vless://…` / `vmess://…` / `trojan://…` URIs which all clients understand. Streisand supports this format (the subscription page's Streisand deeplink already points there). 2. **Import a hand-edited config** — Take the JSON output, wrap the flat settings back into the `vnext`/`users` structure manually, and paste it directly into the client. ## What needs to change The flat format needs to be validated against the xray-core version bundled with this panel. If the flat format is not actually parseable by any released xray binary, `genVless` and `genVnext` should be reverted to use `vnext[{address, port, users:[{id, encryption, flow}]}]` and `genServer` to use `servers[{address, port, password}]`. A PR restoring the nested structure would fix all affected clients.
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#3642
No description provided.