[GH-ISSUE #2041] Hosts of a deleted user break the host list #1475

Open
opened 2026-02-26 07:31:13 +03:00 by kerem · 18 comments
Owner

Originally created by @v3ss0n on GitHub (May 5, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2041

Re-issued #1038 Because it is not fixed , and owner of that issue is not reopening .

This annoying bug breaks NPM rendering anyone unable to change , very bad for production environment.
Please consider looking into it.

Originally created by @v3ss0n on GitHub (May 5, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2041 Re-issued #1038 Because it is not fixed , and owner of that issue is not reopening . This annoying bug breaks NPM rendering anyone unable to change , very bad for production environment. Please consider looking into it.
Author
Owner

@damianog commented on GitHub (May 28, 2022):

I can confirm this issue, after deleting an old admin user I get the error: Cannot read properties of null (reading 'avatar')

image

@v3ss0n have you got a solution to restore the Hosts list?

<!-- gh-comment-id:1140276883 --> @damianog commented on GitHub (May 28, 2022): I can confirm this issue, after deleting an old admin user I get the error: Cannot read properties of null (reading 'avatar') ![image](https://user-images.githubusercontent.com/2786682/170830172-3b312a5a-d356-4b33-a61a-1f6558a77722.png) @v3ss0n have you got a solution to restore the Hosts list?
Author
Owner

@v3ss0n commented on GitHub (May 28, 2022):

Only way is to go in and fix using SQL.

<!-- gh-comment-id:1140288073 --> @v3ss0n commented on GitHub (May 28, 2022): Only way is to go in and fix using SQL.
Author
Owner

@damianog commented on GitHub (May 28, 2022):

OK I managed to enable the user by:
update user set is_deleted = 0 where is_deleted = 1;
in mysql db

So the issue depend on the avatar icon on the host list?
image

The one with red spot is the undeleted user now only disabled.

@jc21 I whant to delete a secondary administrator user, but there are some proxy-host owned by this one.
How could I change the owner than?

<!-- gh-comment-id:1140297693 --> @damianog commented on GitHub (May 28, 2022): OK I managed to enable the user by: update user set is_deleted = 0 where is_deleted = 1; in mysql db So the issue depend on the avatar icon on the host list? ![image](https://user-images.githubusercontent.com/2786682/170835102-338fc221-4bd3-476b-9bfd-fe9e0f4ce96b.png) The one with red spot is the undeleted user now only disabled. @jc21 I whant to delete a secondary administrator user, but there are some proxy-host owned by this one. How could I change the owner than?
Author
Owner

@danielclough commented on GitHub (Jun 15, 2022):

I was able to reset the user by:

  1. entering database
  2. using db
  3. UPDATE user SET is_deleted=1;
  4. wait for restart (or manually restart)
  5. UPDATE user SET is_deleted=0;
  6. wait for restart (or manually restart)
  7. log in

Upon logging in the deleted user is back along with their hosts.

There is probably a better way.

<!-- gh-comment-id:1156023056 --> @danielclough commented on GitHub (Jun 15, 2022): I was able to reset the user by: 1. entering database 2. using db 3. `UPDATE user SET is_deleted=1;` 4. wait for restart (or manually restart) 5. `UPDATE user SET is_deleted=0;` 6. wait for restart (or manually restart) 7. log in Upon logging in the deleted user is back along with their hosts. There is probably a better way.
Author
Owner

@v3ss0n commented on GitHub (Jun 15, 2022):

Thats shouldn't be the way , its a critical bug. We need a fix.

<!-- gh-comment-id:1156973207 --> @v3ss0n commented on GitHub (Jun 15, 2022): Thats shouldn't be the way , its a critical bug. We need a fix.
Author
Owner

@wbloos commented on GitHub (Jun 24, 2022):

I was able to reset the user by:

1. entering database

2. using db

3. `UPDATE user SET is_deleted=1;`

4. wait for restart (or manually restart)

5. `UPDATE user SET is_deleted=0;`

6. wait for restart (or manually restart)

7. log in

Upon logging in the deleted user is back along with their hosts.

There is probably a better way.

That is dangerous, because it will restore the admin user with the default username and password!! (admin@example.com/changeme)

<!-- gh-comment-id:1165343352 --> @wbloos commented on GitHub (Jun 24, 2022): > I was able to reset the user by: > > 1. entering database > > 2. using db > > 3. `UPDATE user SET is_deleted=1;` > > 4. wait for restart (or manually restart) > > 5. `UPDATE user SET is_deleted=0;` > > 6. wait for restart (or manually restart) > > 7. log in > > > Upon logging in the deleted user is back along with their hosts. > > There is probably a better way. That is dangerous, because it will restore the admin user with the default username and password!! (admin@example.com/changeme)
Author
Owner

@etfz commented on GitHub (Oct 14, 2022):

Just encountered this very unfortunate issue. Was able to recover by assigning the affected entries to a different owner.

This is also done directly in the database. In my case I was using SQLite.

  1. First open a container shell. (use docker ps to find your container ID, if necessary)
docker exec -it <container-name-or-id> bash
  1. Install SQLite. (while inside the container)
apt update
apt install sqlite3
  1. Enter the database
sqlite3 /data/database.sqlite
  1. Find the ID of the user to which you want to reassign the affected entries. Optionally, also the ID of the removed user.
SELECT id, name FROM user;
1|etfz
2|Ghost
  1. Reassign the entries using the user IDs from the output of the previous query. You can either reassign everything to you, (first line in the example below) or only the entries owned by the removed user. (second line, useful if you still have other active users)
UPDATE proxy_host  SET owner_user_id = 1;
UPDATE certificate SET owner_user_id = 1 where owner_user_id = 2;

List all tables using .tables to find any other tables you may need to edit.

Taken from here:
https://forums.unraid.net/topic/76460-support-djoss-nginx-proxy-manager/page/52/#comment-969943

Steps 1 through 3 can probably be done outside of the container, too, since the database should be bind mounted outside of the container.

<!-- gh-comment-id:1278596026 --> @etfz commented on GitHub (Oct 14, 2022): Just encountered this very unfortunate issue. Was able to recover by assigning the affected entries to a different owner. This is also done directly in the database. In my case I was using SQLite. 1. First open a container shell. (use `docker ps` to find your container ID, if necessary) ``` docker exec -it <container-name-or-id> bash ``` 2. Install SQLite. (while inside the container) ``` apt update apt install sqlite3 ``` 3. Enter the database ``` sqlite3 /data/database.sqlite ``` 4. Find the ID of the user to which you want to reassign the affected entries. Optionally, also the ID of the removed user. ```sql SELECT id, name FROM user; ``` ``` 1|etfz 2|Ghost ``` 5. Reassign the entries using the user IDs from the output of the previous query. You can either reassign everything to you, (first line in the example below) or only the entries owned by the removed user. (second line, useful if you still have other active users) ```sql UPDATE proxy_host SET owner_user_id = 1; UPDATE certificate SET owner_user_id = 1 where owner_user_id = 2; ``` List all tables using `.tables` to find any other tables you may need to edit. Taken from here: https://forums.unraid.net/topic/76460-support-djoss-nginx-proxy-manager/page/52/#comment-969943 Steps 1 through 3 can probably be done outside of the container, too, since the database should be bind mounted outside of the container.
Author
Owner

@franciscopaniskaseker commented on GitHub (Nov 25, 2022):

Still happening. i followed @etfz steps and fixed the problem, but of course the bug can happen again.

<!-- gh-comment-id:1327469708 --> @franciscopaniskaseker commented on GitHub (Nov 25, 2022): Still happening. i followed @etfz steps and fixed the problem, but of course the bug can happen again.
Author
Owner

@fiservedpi commented on GitHub (Apr 24, 2023):

Experiencing the same on latest version (v2.10.2 © 2022 ) applied the above fix and all is well. I do not know what started all this, I was updating some containers beforehand and then all of a sudden error!
image

<!-- gh-comment-id:1520682489 --> @fiservedpi commented on GitHub (Apr 24, 2023): Experiencing the same on latest version (v2.10.2 © 2022 ) applied the above fix and all is well. I do not know what started all this, I was updating some containers beforehand and then all of a sudden error! ![image](https://user-images.githubusercontent.com/42981853/234091577-b6266c32-7363-4e87-ba52-26d3ac8ec694.png)
Author
Owner

@rubickecho commented on GitHub (Jun 29, 2023):

Experiencing the same on latest version (v2.10.2 © 2022 ) applied the above fix and all is well. I do not know what started all this, I was updating some containers beforehand and then all of a sudden error! image

yes, I had a problem today too, looking forward to a quick fix

<!-- gh-comment-id:1612372643 --> @rubickecho commented on GitHub (Jun 29, 2023): > Experiencing the same on latest version (v2.10.2 © 2022 ) applied the above fix and all is well. I do not know what started all this, I was updating some containers beforehand and then all of a sudden error! ![image](https://user-images.githubusercontent.com/42981853/234091577-b6266c32-7363-4e87-ba52-26d3ac8ec694.png) yes, I had a problem today too, looking forward to a quick fix
Author
Owner

@devuar commented on GitHub (Jul 25, 2023):

Any update on this?

<!-- gh-comment-id:1650283559 --> @devuar commented on GitHub (Jul 25, 2023): Any update on this?
Author
Owner

@v3ss0n commented on GitHub (Jul 26, 2023):

Consider moving to traefik . This is such a deal breaker bug that dev choose to ignore ( along with severe CVEs).

<!-- gh-comment-id:1650906045 --> @v3ss0n commented on GitHub (Jul 26, 2023): Consider moving to traefik . This is such a deal breaker bug that dev choose to ignore ( along with severe CVEs).
Author
Owner

@devuar commented on GitHub (Jul 31, 2023):

I was able to reset the user by:

  1. entering database
  2. using db
  3. UPDATE user SET is_deleted=1;
  4. wait for restart (or manually restart)
  5. UPDATE user SET is_deleted=0;
  6. wait for restart (or manually restart)
  7. log in

Upon logging in the deleted user is back along with their hosts.

There is probably a better way.

This worked for me!

<!-- gh-comment-id:1659014094 --> @devuar commented on GitHub (Jul 31, 2023): > I was able to reset the user by: > > 1. entering database > 2. using db > 3. `UPDATE user SET is_deleted=1;` > 4. wait for restart (or manually restart) > 5. `UPDATE user SET is_deleted=0;` > 6. wait for restart (or manually restart) > 7. log in > > Upon logging in the deleted user is back along with their hosts. > > There is probably a better way. This worked for me!
Author
Owner

@alexsalex commented on GitHub (Aug 30, 2023):

Same issue here...

<!-- gh-comment-id:1699572015 --> @alexsalex commented on GitHub (Aug 30, 2023): Same issue here...
Author
Owner

@Kevinsky86 commented on GitHub (Dec 22, 2023):

Consider moving to traefik . This is such a deal breaker bug that dev choose to ignore ( along with severe CVEs).

Can you elaborate on the CVE's?

<!-- gh-comment-id:1867605206 --> @Kevinsky86 commented on GitHub (Dec 22, 2023): > Consider moving to traefik . This is such a deal breaker bug that dev choose to ignore ( along with severe CVEs). Can you elaborate on the CVE's?
Author
Owner

@github-actions[bot] commented on GitHub (Aug 9, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2277006472 --> @github-actions[bot] commented on GitHub (Aug 9, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@kerstenremco commented on GitHub (Nov 15, 2024):

Added PR #4166 for this issue

<!-- gh-comment-id:2479161723 --> @kerstenremco commented on GitHub (Nov 15, 2024): Added PR #4166 for this issue
Author
Owner

@github-actions[bot] commented on GitHub (Jun 16, 2025):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2974914091 --> @github-actions[bot] commented on GitHub (Jun 16, 2025): Issue is now considered stale. If you want to keep it open, please comment :+1:
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-proxy-manager-NginxProxyManager#1475
No description provided.