[GH-ISSUE #4508] Bug: UNIQUE constraint failed: clients.email #3076

Closed
opened 2026-10-31 20:29:55 +07:00 by bsakaguchi · 11 comments
Owner

Originally created by @hbjbozorgi on GitHub (May 23, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4508

Describe the bug

Hi
After upgrade to v 3.1, when i want to add client this error appeared:
Something went wrong (UNIQUE constraint failed: clients.email)

How to repeat the problem?

  1. open clients
  2. add client

Expected action

No response

Received action

No response

3x-ui Version

3.1.0

Xray-core Version

v26.5.9

Checklist

  • This bug report is written entirely in English.
  • This bug report is new and no one has reported it before me.
Originally created by @hbjbozorgi on GitHub (May 23, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4508 ### Describe the bug Hi After upgrade to v 3.1, when i want to add client this error appeared: Something went wrong (UNIQUE constraint failed: clients.email) ### How to repeat the problem? 1. open clients 2. add client ### Expected action _No response_ ### Received action _No response_ ### 3x-ui Version 3.1.0 ### Xray-core Version v26.5.9 ### Checklist - [x] This bug report is written entirely in English. - [x] This bug report is new and no one has reported it before me.
bsakaguchi 2026-10-31 20:29:55 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@routegg commented on GitHub (May 23, 2026):

When editing a client, a duplicate profile appears without any assigned inbound, while the modified profile drops to the bottom of the page as if it were a new one. To make everything work again, you need to manually delete the unassigned/duplicate profile

<!-- gh-comment-id:4526547459 --> @routegg commented on GitHub (May 23, 2026): When editing a client, a duplicate profile appears without any assigned inbound, while the modified profile drops to the bottom of the page as if it were a new one. To make everything work again, you need to manually delete the unassigned/duplicate profile
Author
Owner

@MHSanaei commented on GitHub (May 24, 2026):

need more info

<!-- gh-comment-id:4530016620 --> @MHSanaei commented on GitHub (May 24, 2026): need more info
Author
Owner

@hbjbozorgi commented on GitHub (May 24, 2026):

Hello Dear @MHSanaei

I was using version 3.0.2, and yesterday when version 3.1 was released, I updated the server. As the first step, I went to the user creation section and encountered the following error. I had no other choice but to downgrade the server back to the previous version.

Error message: Something went wrong (UNIQUE constraint failed: clients.email)

<!-- gh-comment-id:4530036099 --> @hbjbozorgi commented on GitHub (May 24, 2026): Hello Dear @MHSanaei I was using version 3.0.2, and yesterday when version 3.1 was released, I updated the server. As the first step, I went to the user creation section and encountered the following error. I had no other choice but to downgrade the server back to the previous version. Error message: Something went wrong (UNIQUE constraint failed: clients.email)
Author
Owner

@MHSanaei commented on GitHub (May 24, 2026):

more info means
logs
configs
database
...

<!-- gh-comment-id:4530040558 --> @MHSanaei commented on GitHub (May 24, 2026): more info means logs configs database ...
Author
Owner

@joseph7998miller-hash commented on GitHub (May 25, 2026):

This is related to one of my current issues. After updating to version 3.1, some clients created in version 3.0.1 didn't have any attached inbounds, so I tried to fix them manually. During this process, some clients wouldn't accept the changes and gave me the error message: UNIQUE constraint failed: clients.email (As I mentioned before, I also got this error when trying to edit the details of clients created in version 2.x and imported to 3.0.1).

I deleted the clients that had no inbounds and wouldn't let me attach new ones. Then, I tried editing the old 2.x clients again, and this time it worked. However, the clients I had deleted somehow recreated themselves. I repeated this deletion process 3 or 4 times. Now the database seems okay, except for a problem with the subscription links.

Every time I create a new client on mobile, the subscription link shows the send/ received data as 'infinite', but I don't have this problem when I switch to Desktop view. The subscription link issue also persists for the old clients, maybe this things are related maybe not.

<!-- gh-comment-id:4535522790 --> @joseph7998miller-hash commented on GitHub (May 25, 2026): This is related to one of my current issues. After updating to version 3.1, some clients created in version 3.0.1 didn't have any attached inbounds, so I tried to fix them manually. During this process, some clients wouldn't accept the changes and gave me the error message: UNIQUE constraint failed: clients.email (As I mentioned before, I also got this error when trying to edit the details of clients created in version 2.x and imported to 3.0.1). I deleted the clients that had no inbounds and wouldn't let me attach new ones. Then, I tried editing the old 2.x clients again, and this time it worked. However, the clients I had deleted somehow recreated themselves. I repeated this deletion process 3 or 4 times. Now the database seems okay, except for a problem with the subscription links. Every time I create a new client on mobile, the subscription link shows the send/ received data as 'infinite', but I don't have this problem when I switch to Desktop view. The subscription link issue also persists for the old clients, maybe this things are related maybe not.
Author
Owner

@PlanSK commented on GitHub (May 26, 2026):

I encountered this bug under different circumstances. I deploy the app via Docker. Everything works fine after the initial setup. However, any container restart corrupts the database, throwing this error in the logs. I specifically tested version 3.0.2, and the database handles restarts without any issues there.

<!-- gh-comment-id:4547067607 --> @PlanSK commented on GitHub (May 26, 2026): I encountered this bug under different circumstances. I deploy the app via Docker. Everything works fine after the initial setup. However, any container restart corrupts the database, throwing this error in the logs. I specifically tested version 3.0.2, and the database handles restarts without any issues there.
Author
Owner

@diduweiwu commented on GitHub (May 28, 2026):

Switch sqlite to pgsql will help solve this issue.
Good luck

<!-- gh-comment-id:4565439046 --> @diduweiwu commented on GitHub (May 28, 2026): Switch sqlite to pgsql will help solve this issue. Good luck
Author
Owner

@PlanSK commented on GitHub (May 28, 2026):

Switch sqlite to pgsql will help solve this issue. Good luck

I was just thinking about this today, thanks. I just wanted give more information about this issue.

<!-- gh-comment-id:4565587202 --> @PlanSK commented on GitHub (May 28, 2026): > Switch sqlite to pgsql will help solve this issue. Good luck I was just thinking about this today, thanks. I just wanted give more information about this issue.
Author
Owner

@MHSanaei commented on GitHub (May 28, 2026):

fixed
wait for next update

<!-- gh-comment-id:4566038228 --> @MHSanaei commented on GitHub (May 28, 2026): fixed wait for next update
Author
Owner

@hbjbozorgi commented on GitHub (May 28, 2026):

Hi Dear @MHSanaei
I updated to version 3.2, it's not fixed. Do you mean the newer version?

<!-- gh-comment-id:4569287711 --> @hbjbozorgi commented on GitHub (May 28, 2026): Hi Dear @MHSanaei I updated to version 3.2, it's not fixed. Do you mean the newer version?
Author
Owner

@MHSanaei commented on GitHub (May 29, 2026):

it fixed for new inbound but for your old inbound you just need to change the tag id for it

<!-- gh-comment-id:4569396503 --> @MHSanaei commented on GitHub (May 29, 2026): it fixed for new inbound but for your old inbound you just need to change the tag id for it
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#3076
No description provided.