[GH-ISSUE #4759] [Bug]: does not allow multiple clients to be assigned the same subscription ID after updating from version 3.2.0 to 3.2.5 #3299

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

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

Describe the bug

after updating from version 3.2.0 to 3.2.5:

When editing an existing client and changing their subscription ID to an existing one, the dashboard display:
Something went wrong (Duplicate subId: qqxyd619p6gok03a )

Add Bulk feature does not work if you enter a Subscription ID:
1 created, 2 failed — subId already in use: dpg1nsgivxxisvz7

How to reproduce the problem

  1. Open the "Clients" page
  2. click "more"
  3. click "add bulk"
  4. select inbounds
  5. set number of clients = 3
  6. click the refresh button in Subscription ID
  7. click "create"

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.2.5

Xray-core version

No response

How did you install 3x-ui?

Other (please describe in the bug body)

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 @Aitamij on GitHub (Jun 1, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4759 ### Describe the bug after updating from version 3.2.0 to 3.2.5: When editing an existing client and changing their subscription ID to an existing one, the dashboard display: Something went wrong (Duplicate subId: qqxyd619p6gok03a ) Add Bulk feature does not work if you enter a Subscription ID: 1 created, 2 failed — subId already in use: dpg1nsgivxxisvz7 ### How to reproduce the problem 1. Open the "Clients" page 2. click "more" 3. click "add bulk" 4. select inbounds 5. set number of clients = 3 6. click the refresh button in Subscription ID 7. click "create" ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.2.5 ### Xray-core version _No response_ ### How did you install 3x-ui? Other (please describe in the bug body) ### 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:31:28 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Thanks for the detailed report. This is a real bug introduced in v3.2.5 when subscription ID uniqueness was enforced.

Root cause — Bulk Add

In ClientBulkAddModal.tsx (line 154), the subId from the form is applied to every client in the batch:

subId: form.subId || RandomUtil.randomLowerAndNum(16),

When you click the refresh button, a single random ID is generated and stored in form.subId. Every client in the loop then gets that same value. Since v3.2.5 now rejects a subId that is already in use, only the first client is created and the rest fail.

Workaround (until a fix is released)

Leave the Subscription ID field empty when using Bulk Add. The code falls back to RandomUtil.randomLowerAndNum(16) — but because the expression is evaluated inside the .map(), each client receives its own freshly generated unique ID. The bug only triggers when you manually set (or refresh) the field before creating.

Edit-client behaviour

The "Duplicate subId" error when editing a client is intentional — two different clients cannot share the same subscription ID in v3.2.5. If you were relying on shared subscription IDs across clients, that use-case is no longer supported.

Fix needed

The payloads.map() in the bulk create path should always generate a fresh subId per client regardless of what is in the form field, or the form field should be treated as a prefix rather than a literal value.

<!-- gh-comment-id:4591988411 --> @github-actions[bot] commented on GitHub (Jun 1, 2026): Thanks for the detailed report. This is a real bug introduced in v3.2.5 when subscription ID uniqueness was enforced. **Root cause — Bulk Add** In `ClientBulkAddModal.tsx` (line 154), the `subId` from the form is applied to *every* client in the batch: ```js subId: form.subId || RandomUtil.randomLowerAndNum(16), ``` When you click the refresh button, a single random ID is generated and stored in `form.subId`. Every client in the loop then gets that **same** value. Since v3.2.5 now rejects a `subId` that is already in use, only the first client is created and the rest fail. **Workaround (until a fix is released)** Leave the **Subscription ID** field **empty** when using Bulk Add. The code falls back to `RandomUtil.randomLowerAndNum(16)` — but because the expression is evaluated *inside* the `.map()`, each client receives its own freshly generated unique ID. The bug only triggers when you manually set (or refresh) the field before creating. **Edit-client behaviour** The "Duplicate subId" error when editing a client is intentional — two different clients cannot share the same subscription ID in v3.2.5. If you were relying on shared subscription IDs across clients, that use-case is no longer supported. **Fix needed** The `payloads.map()` in the bulk create path should always generate a fresh `subId` per client regardless of what is in the form field, or the form field should be treated as a prefix rather than a literal value.
Author
Owner

@Aitamij commented on GitHub (Jun 1, 2026):

I have configured client-name-based routing rules on a server in my country. Based on the client’s name, the system selects the appropriate outbound server to send the request to one of the foreign servers using one of the protocols.

How can I now enable a single subscription to connect to different foreign servers?

I understand the protocols; I can configure them in both inbound and outbound routing, and a client with an inbound VLESS connection will send traffic to an outbound VLESS connection.

It used to work like this:
For a single subscribed user, three clients were loaded, for example:
client_FI_vless, client_FI_Hysteria, client_SE_vless
and thus, when connecting, for example, via client_FI_Hysteria,
the server in my country would receive requests via the Hysteria protocol and forward them to the server in Finland via the Hysteria protocol.

How can I implement similar logic now, since setting the same subscription is no longer supported?

<!-- gh-comment-id:4592167529 --> @Aitamij commented on GitHub (Jun 1, 2026): I have configured client-name-based routing rules on a server in my country. Based on the client’s name, the system selects the appropriate outbound server to send the request to one of the foreign servers using one of the protocols. How can I now enable a single subscription to connect to different foreign servers? I understand the protocols; I can configure them in both inbound and outbound routing, and a client with an inbound VLESS connection will send traffic to an outbound VLESS connection. It used to work like this: For a single subscribed user, three clients were loaded, for example: client_FI_vless, client_FI_Hysteria, client_SE_vless and thus, when connecting, for example, via client_FI_Hysteria, the server in my country would receive requests via the Hysteria protocol and forward them to the server in Finland via the Hysteria protocol. How can I implement similar logic now, since setting the same subscription is no longer supported?
Author
Owner

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

Sub should be unique for each client

<!-- gh-comment-id:4592546901 --> @MHSanaei commented on GitHub (Jun 1, 2026): Sub should be unique for each client
Author
Owner

@rezakhosh78 commented on GitHub (Jun 1, 2026):

Hello dear Mr. Sanai, I have the same problem. Sometimes it is really necessary to use a common subscription id. If possible, in future versions like versions before 3.2.5, please provide this possibility.
When we use a node, we add several inbounds; sometimes it is necessary to have different traffic than the rest of the inbounds for a client. So either we need to use a different client name(email) with a sub-id or there is another way to specify for a user who uses a node and several inbounds whether the traffic of the inbounds he uses should be calculated together or separately and with different traffic.

<!-- gh-comment-id:4594831096 --> @rezakhosh78 commented on GitHub (Jun 1, 2026): Hello dear Mr. Sanai, I have the same problem. Sometimes it is really necessary to use a common subscription id. If possible, in future versions like versions before 3.2.5, please provide this possibility. When we use a node, we add several inbounds; sometimes it is necessary to have different traffic than the rest of the inbounds for a client. So either we need to use a different client name(email) with a sub-id or there is another way to specify for a user who uses a node and several inbounds whether the traffic of the inbounds he uses should be calculated together or separately and with different traffic.
Author
Owner

@chuck852 commented on GitHub (Jun 1, 2026):

Sub should be unique for each client

This change breaks an important routing/cascade use case.

Before v3.2.5 it was possible to have:

client-a / subId=user1 / same inbound :443 -> route by user=email to outboundTag A
client-b / subId=user1 / same inbound :443 -> route by user=email to outboundTag B

This allowed one subscription to contain multiple cascade options while keeping a single VLESS TCP RAW inbound on port 443.

The new recommended model "attach existing client to multiple inbounds" does not replace this use case, because routing can only distinguish these links by inboundTag, which requires separate inbounds. But for VLESS TCP RAW on port 443 it is not possible to create multiple equivalent inbounds on the same IP:port.

So this is not only a Duplicate subId validation issue. It is a regression for subscription-based cascade routing by user/email within the same inbound.

Expected:
Allow multiple clients to share one subId, or introduce another stable subscription grouping field separate from unique client identity.

<!-- gh-comment-id:4594987694 --> @chuck852 commented on GitHub (Jun 1, 2026): > Sub should be unique for each client This change breaks an important routing/cascade use case. Before v3.2.5 it was possible to have: client-a / subId=user1 / same inbound :443 -> route by user=email to outboundTag A client-b / subId=user1 / same inbound :443 -> route by user=email to outboundTag B This allowed one subscription to contain multiple cascade options while keeping a single VLESS TCP RAW inbound on port 443. The new recommended model "attach existing client to multiple inbounds" does not replace this use case, because routing can only distinguish these links by inboundTag, which requires separate inbounds. But for VLESS TCP RAW on port 443 it is not possible to create multiple equivalent inbounds on the same IP:port. So this is not only a Duplicate subId validation issue. It is a regression for subscription-based cascade routing by user/email within the same inbound. Expected: Allow multiple clients to share one subId, or introduce another stable subscription grouping field separate from unique client identity.
Author
Owner

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

not possible

<!-- gh-comment-id:4595692219 --> @MHSanaei commented on GitHub (Jun 1, 2026): not possible
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#3299
No description provided.