Describe the bug
After install, if you delete the install user, any changes to the "settings" table, such as trying to install a new license key fails with no message visible to the user making the change. Server logs emit a clear message.
To Reproduce
Steps to reproduce the behavior:
- After installation create a second user and assign them Administrator.
- Log out and log in as that second user.
- Delete the first user that was used for installation.
- Go under Settings to License and Edit your existing license.
- Click "Submit"
Currently the button appears to not work. If you look in your browser's network console you will see an API call to /settings fail with a 500 server error. Checking server logs reveals the error
Aug 25 12:44:50 ____ defguard[1328191]: 2026-08-25T12:44:50.564892Z ERROR http_request{method=PATCH path=/api/v1/settings}: defguard_core::handlers: message=Database error: error returned from database: insert or update on table "settings" violates foreign key constraint "fk_default_admin" [2.0.2 Ubuntu 22.4.0 aarch64]
Expected behavior
There should be a couple expected behaviors.
- You should not be able to delete the Install user if it is referenced by another table. Step 2 above should have thrown an error preventing me from deleting the user.
- Clicking "Submit" when changing the license key should show a message if there was an error.
Version information
- Defguard Core version: v2.0.2
- Ubuntu 22.04.5 LTS
- Firefox 153.0.1
Describe the bug
After install, if you delete the install user, any changes to the "settings" table, such as trying to install a new license key fails with no message visible to the user making the change. Server logs emit a clear message.
To Reproduce
Steps to reproduce the behavior:
Currently the button appears to not work. If you look in your browser's network console you will see an API call to /settings fail with a 500 server error. Checking server logs reveals the error
Aug 25 12:44:50 ____ defguard[1328191]: 2026-08-25T12:44:50.564892Z ERROR http_request{method=PATCH path=/api/v1/settings}: defguard_core::handlers: message=Database error: error returned from database: insert or update on table "settings" violates foreign key constraint "fk_default_admin" [2.0.2 Ubuntu 22.4.0 aarch64]
Expected behavior
There should be a couple expected behaviors.
Version information