[GH-ISSUE #1017] UNIQUE constraint failed on sites.path when initializing database #6314

Closed
opened 2026-03-01 17:11:06 +03:00 by kerem · 3 comments
Owner

Originally created by @YinHeng89 on GitHub (May 7, 2025).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1017


Title: UNIQUE constraint failed on sites.path when initializing database

Description:

I encountered the following error when starting the application:

nginx-ui  | 2025/05/07 14:31:19 /home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.21.1/model/model.go:75 UNIQUE constraint failed: sites.path
nginx-ui  | [0.994ms] [rows:0] CREATE UNIQUE INDEX `idx_sites_path` ON `sites`(`path`)
nginx-ui  | 2025-05-07 14:31:19 FATAL   model/model.go:78       UNIQUE constraint failed: sites.path

This occurs during the attempt to create a UNIQUE index on the path column of the sites table, and the operation fails due to existing duplicate values in that column.


Originally created by @YinHeng89 on GitHub (May 7, 2025). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/1017 --- ### **Title: UNIQUE constraint failed on `sites.path` when initializing database** #### **Description:** I encountered the following error when starting the application: ``` nginx-ui | 2025/05/07 14:31:19 /home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.21.1/model/model.go:75 UNIQUE constraint failed: sites.path nginx-ui | [0.994ms] [rows:0] CREATE UNIQUE INDEX `idx_sites_path` ON `sites`(`path`) nginx-ui | 2025-05-07 14:31:19 FATAL model/model.go:78 UNIQUE constraint failed: sites.path ``` This occurs during the attempt to create a **UNIQUE index** on the `path` column of the `sites` table, and the operation fails due to existing duplicate values in that column. ---
kerem 2026-03-01 17:11:06 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (May 7, 2025):

I am sorry that the auto migration has this issue. I have fixed it in fbc800f and released a new rc.6 version. Please re-pull the image if you are using Docker.

<!-- gh-comment-id:2857450707 --> @0xJacky commented on GitHub (May 7, 2025): I am sorry that the auto migration has this issue. I have fixed it in fbc800f and released a new rc.6 version. Please re-pull the image if you are using Docker.
Author
Owner

@Neshura87 commented on GitHub (May 12, 2025):

Issue unfortunately persists with rc.7

May 12 15:03:52 nginx nginx-ui[1111]: 
May 12 15:03:52 nginx nginx-ui[1111]: 2025/05/12 15:03:52 /home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.21.1/model/model.go:75 UNIQUE constraint failed: sites.path
May 12 15:03:52 nginx nginx-ui[1111]: [0.557ms] [rows:0] CREATE UNIQUE INDEX `idx_sites_path` ON `sites`(`path`)
May 12 15:03:52 nginx nginx-ui[1111]: 2025-05-12 15:03:52        FATAL        model/model.go:78        UNIQUE constraint failed: sites.path
May 12 15:03:52 nginx systemd[1]: nginx-ui.service: Main process exited, code=exited, status=1/FAILURE
<!-- gh-comment-id:2872495025 --> @Neshura87 commented on GitHub (May 12, 2025): Issue unfortunately persists with rc.7 ``` May 12 15:03:52 nginx nginx-ui[1111]: May 12 15:03:52 nginx nginx-ui[1111]: 2025/05/12 15:03:52 /home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.21.1/model/model.go:75 UNIQUE constraint failed: sites.path May 12 15:03:52 nginx nginx-ui[1111]: [0.557ms] [rows:0] CREATE UNIQUE INDEX `idx_sites_path` ON `sites`(`path`) May 12 15:03:52 nginx nginx-ui[1111]: 2025-05-12 15:03:52 FATAL model/model.go:78 UNIQUE constraint failed: sites.path May 12 15:03:52 nginx systemd[1]: nginx-ui.service: Main process exited, code=exited, status=1/FAILURE ```
Author
Owner

@0xJacky commented on GitHub (May 12, 2025):

Hi @YinHeng89 @Neshura87, please reinstall the new rc.7 (v2.0.0-rc.7-patch.3), it should resolve the problem. I have tested on my environment.

<!-- gh-comment-id:2872591749 --> @0xJacky commented on GitHub (May 12, 2025): Hi @YinHeng89 @Neshura87, please reinstall the new rc.7 (v2.0.0-rc.7-patch.3), it should resolve the problem. I have tested on my environment.
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
starred/nginx-ui#6314
No description provided.