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

Hosts of a deleted user break the host list #2041

Open
v3ss0n opened this issue May 5, 2022 · 17 comments
Open

Hosts of a deleted user break the host list #2041

v3ss0n opened this issue May 5, 2022 · 17 comments
Labels

Comments

@v3ss0n
Copy link

v3ss0n commented May 5, 2022

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 v3ss0n added the bug label May 5, 2022
@damianog
Copy link
Contributor

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?

@v3ss0n
Copy link
Author

v3ss0n commented May 28, 2022

Only way is to go in and fix using SQL.

@damianog
Copy link
Contributor

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?

@danielclough
Copy link

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.

@v3ss0n
Copy link
Author

v3ss0n commented Jun 15, 2022

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

@wbloos
Copy link

wbloos commented 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)

@etfz
Copy link

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

@franciscopaniskaseker
Copy link

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

@fiservedpi
Copy link

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

@rubickecho
Copy link

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

@devuar
Copy link

devuar commented Jul 25, 2023

Any update on this?

@v3ss0n
Copy link
Author

v3ss0n commented Jul 26, 2023

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

@devuar
Copy link

devuar commented 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!

@alexsalex
Copy link

Same issue here...

@Kevinsky86
Copy link

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?

Copy link

github-actions bot commented Aug 9, 2024

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

@kerstenremco
Copy link
Contributor

Added PR #4166 for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests