[GH-ISSUE #673] beta.38 - nginx-ui wont start anymore #341

Closed
opened 2026-02-26 12:08:03 +03:00 by kerem · 7 comments
Owner

Originally created by @jiriteach on GitHub (Oct 28, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/673

Upgraded to beta.38 and the update hung.
Checked the service and it was stopped. Trying to restart - just errors.

How do I restart? I tried re-installing and no luck either.

root@moober:/home/administrator# systemctl status nginx-ui
× nginx-ui.service - Yet another WebUI for Nginx
     Loaded: loaded (/etc/systemd/system/nginx-ui.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Mon 2024-10-28 23:29:38 NZDT; 3min 7s ago
   Duration: 408ms
       Docs: https://github.com/0xJacky/nginx-ui
    Process: 51766 ExecStart=/usr/local/bin/nginx-ui -config /usr/local/etc/nginx-ui/app.ini (code=exited, status=1/FAILURE)
   Main PID: 51766 (code=exited, status=1/FAILURE)
        CPU: 516ms

Here is the log from /var/log/syslog

2024-10-28T23:29:37.601282+13:00 moober systemd[1]: Started nginx-ui.service - Yet another WebUI for Nginx.
2024-10-28T23:29:38.003156+13:00 moober nginx-ui[51777]: #015
2024-10-28T23:29:38.003233+13:00 moober nginx-ui[51777]: 2024/10/28 23:29:38 #033[31;1m/home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.9.12/model/model.go:73 #033[35;1mUNIQUE constraint failed: sites.path
2024-10-28T23:29:38.003253+13:00 moober nginx-ui[51777]: #033[0m#033[33m[0.269ms] #033[34;1m[rows:0]#033[0m CREATE UNIQUE INDEX `idx_sites_path` ON `sites`(`path`)
2024-10-28T23:29:38.003289+13:00 moober nginx-ui[51777]: 2024-10-28 23:29:38#011FATAL#011model/model.go:76#011UNIQUE constraint failed: sites.path
2024-10-28T23:29:38.009467+13:00 moober systemd[1]: nginx-ui.service: Main process exited, code=exited, status=1/FAILURE
2024-10-28T23:29:38.009556+13:00 moober systemd[1]: nginx-ui.service: Failed with result 'exit-code'.

Looks like the error -

2024-10-28T23:29:38.003289+13:00 moober nginx-ui[51777]: 2024-10-28 23:29:38#011FATAL#011model/model.go:76#011UNIQUE constraint failed: sites.path

Originally created by @jiriteach on GitHub (Oct 28, 2024). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/673 Upgraded to beta.38 and the update hung. Checked the service and it was stopped. Trying to restart - just errors. How do I restart? I tried re-installing and no luck either. ``` root@moober:/home/administrator# systemctl status nginx-ui × nginx-ui.service - Yet another WebUI for Nginx Loaded: loaded (/etc/systemd/system/nginx-ui.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Mon 2024-10-28 23:29:38 NZDT; 3min 7s ago Duration: 408ms Docs: https://github.com/0xJacky/nginx-ui Process: 51766 ExecStart=/usr/local/bin/nginx-ui -config /usr/local/etc/nginx-ui/app.ini (code=exited, status=1/FAILURE) Main PID: 51766 (code=exited, status=1/FAILURE) CPU: 516ms ``` Here is the log from /var/log/syslog ``` 2024-10-28T23:29:37.601282+13:00 moober systemd[1]: Started nginx-ui.service - Yet another WebUI for Nginx. 2024-10-28T23:29:38.003156+13:00 moober nginx-ui[51777]: #015 2024-10-28T23:29:38.003233+13:00 moober nginx-ui[51777]: 2024/10/28 23:29:38 #033[31;1m/home/runner/go/pkg/mod/github.com/uozi-tech/cosy@v1.9.12/model/model.go:73 #033[35;1mUNIQUE constraint failed: sites.path 2024-10-28T23:29:38.003253+13:00 moober nginx-ui[51777]: #033[0m#033[33m[0.269ms] #033[34;1m[rows:0]#033[0m CREATE UNIQUE INDEX `idx_sites_path` ON `sites`(`path`) 2024-10-28T23:29:38.003289+13:00 moober nginx-ui[51777]: 2024-10-28 23:29:38#011FATAL#011model/model.go:76#011UNIQUE constraint failed: sites.path 2024-10-28T23:29:38.009467+13:00 moober systemd[1]: nginx-ui.service: Main process exited, code=exited, status=1/FAILURE 2024-10-28T23:29:38.009556+13:00 moober systemd[1]: nginx-ui.service: Failed with result 'exit-code'. ``` Looks like the error - `2024-10-28T23:29:38.003289+13:00 moober nginx-ui[51777]: 2024-10-28 23:29:38#011FATAL#011model/model.go:76#011UNIQUE constraint failed: sites.path`
kerem 2026-02-26 12:08:03 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (Oct 28, 2024):

Hi @jiriteach, If you have an SQLite editor, open the database.db under /usr/local/etc/nginx-ui, clear the sites table, and restart the nginx-ui. Normally, this issue should not happend.

<!-- gh-comment-id:2441250528 --> @0xJacky commented on GitHub (Oct 28, 2024): Hi @jiriteach, If you have an SQLite editor, open the database.db under /usr/local/etc/nginx-ui, clear the sites table, and restart the nginx-ui. Normally, this issue should not happend.
Author
Owner

@jiriteach commented on GitHub (Oct 28, 2024):

Perfect - thanks. Looks like its worked. Will run some tests.

<!-- gh-comment-id:2441264479 --> @jiriteach commented on GitHub (Oct 28, 2024): Perfect - thanks. Looks like its worked. Will run some tests.
Author
Owner

@jiriteach commented on GitHub (Oct 28, 2024):

Re-opened this as it is a bug. The fix you mentioned above works and my main instance is working fine after clearing the sites table.

Trying on my backup instance going from beta.36 > beta.38. Stuck on ~ 80%. Performing core upgrade.

Screenshot 2024-10-29 at 00 18 10

systemctl status nginx-ui and its failed with the same errors as I posted above.

Its an almost replica of my main instance. Looks like I will have to clear the sites table on this one as well but I might just revert to a previous snapshot and can re-test when the bug is fixed.

<!-- gh-comment-id:2441299103 --> @jiriteach commented on GitHub (Oct 28, 2024): Re-opened this as it is a bug. The fix you mentioned above works and my main instance is working fine after clearing the sites table. Trying on my backup instance going from beta.36 > beta.38. Stuck on ~ 80%. Performing core upgrade. <img width="546" alt="Screenshot 2024-10-29 at 00 18 10" src="https://github.com/user-attachments/assets/725a94e2-e494-497b-95e8-fbbb03ee97ca"> systemctl status nginx-ui and its failed with the same errors as I posted above. Its an almost replica of my main instance. Looks like I will have to clear the sites table on this one as well but I might just revert to a previous snapshot and can re-test when the bug is fixed.
Author
Owner

@0xJacky commented on GitHub (Oct 28, 2024):

Yes, I added a unique constraint in github.com/0xJacky/nginx-ui@bb02d7be77/model/site.go (L5)
since beta.37.

If the sites table has more than one row with the same path, the db migration will fail, so you have to clear the table manaully.

<!-- gh-comment-id:2441310697 --> @0xJacky commented on GitHub (Oct 28, 2024): Yes, I added a unique constraint in https://github.com/0xJacky/nginx-ui/blob/bb02d7be77ba4c8131592b86ff99b4635f3178d2/model/site.go#L5 since beta.37. If the sites table has more than one row with the same path, the db migration will fail, so you have to clear the table manaully.
Author
Owner

@0xJacky commented on GitHub (Oct 28, 2024):

This problem may be caused by the soft delete introduced in the previous version, I'm sorry about that.

<!-- gh-comment-id:2441313169 --> @0xJacky commented on GitHub (Oct 28, 2024): This problem may be caused by the soft delete introduced in the previous version, I'm sorry about that.
Author
Owner

@jiriteach commented on GitHub (Oct 28, 2024):

No worries - is there any issue with clearing the sites table? Does it have any affect? I see all my sites look fine so clearing it didnt break anything?

<!-- gh-comment-id:2441316133 --> @jiriteach commented on GitHub (Oct 28, 2024): No worries - is there any issue with clearing the sites table? Does it have any affect? I see all my sites look fine so clearing it didnt break anything?
Author
Owner

@0xJacky commented on GitHub (Oct 28, 2024):

No worries - is there any issue with clearing the sites table? Does it have any affect? I see all my sites look fine so clearing it didnt break anything?

No side effects if the database is created in previous versions.

If you clear the database since beta.37, you will lose the category and the sync nodes settings of the site.

<!-- gh-comment-id:2441347077 --> @0xJacky commented on GitHub (Oct 28, 2024): > No worries - is there any issue with clearing the sites table? Does it have any affect? I see all my sites look fine so clearing it didnt break anything? No side effects if the database is created in previous versions. If you clear the database since beta.37, you will lose the category and the sync nodes settings of the site.
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#341
No description provided.