nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

Hosts of a deleted user break the host list

Open v3ss0n opened this issue 2 years ago • 6 comments

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.

v3ss0n avatar May 05 '22 18:05 v3ss0n

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?

damianog avatar May 28 '22 14:05 damianog

Only way is to go in and fix using SQL.

v3ss0n avatar May 28 '22 15:05 v3ss0n

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?

damianog avatar May 28 '22 17:05 damianog

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.

danielclough avatar Jun 15 '22 06:06 danielclough

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

v3ss0n avatar Jun 15 '22 21:06 v3ss0n

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!! ([email protected]/changeme)

wbloos avatar Jun 24 '22 08:06 wbloos

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.

etfz avatar Oct 14 '22 07:10 etfz

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

franciscopaniskaseker avatar Nov 25 '22 13:11 franciscopaniskaseker

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

fiservedpi avatar Apr 24 '23 19:04 fiservedpi

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

rubickecho avatar Jun 29 '23 03:06 rubickecho

Any update on this?

devuar avatar Jul 25 '23 17:07 devuar

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

v3ss0n avatar Jul 26 '23 03:07 v3ss0n

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!

devuar avatar Jul 31 '23 19:07 devuar

Same issue here...

alexsalex avatar Aug 30 '23 17:08 alexsalex

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?

Kevinsky86 avatar Dec 22 '23 12:12 Kevinsky86