Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beta.38 - nginx-ui wont start anymore #673

Closed
jiriteach opened this issue Oct 28, 2024 · 7 comments
Closed

beta.38 - nginx-ui wont start anymore #673

jiriteach opened this issue Oct 28, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@jiriteach
Copy link

jiriteach commented Oct 28, 2024

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

@jiriteach jiriteach added the bug Something isn't working label Oct 28, 2024
@0xJacky
Copy link
Owner

0xJacky commented 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.

@jiriteach
Copy link
Author

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

@jiriteach
Copy link
Author

jiriteach commented 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.

@0xJacky
Copy link
Owner

0xJacky commented Oct 28, 2024

Yes, I added a unique constraint in

Path string `json:"path" gorm:"uniqueIndex"`

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.

@0xJacky
Copy link
Owner

0xJacky commented Oct 28, 2024

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

@jiriteach
Copy link
Author

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?

@0xJacky
Copy link
Owner

0xJacky commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants