docker-nginx-proxy-manager
docker-nginx-proxy-manager copied to clipboard
Cannot read property 'avatar' of null
I sotopped seeing the Proxy Hosts settings and instead I got the:
Cannot read property 'avatar' of null
error message. I do not know how that happened, but the first guess is the automatics docker image update jlesage/nginx-proxy-manager
I am using v2.0.13
Where do you get this error exactly? In the UI or the container's log? Is the UI still accessible?
The error is in the GUI:
How did you change your avatar? I think this is not something that can be changed via the interface.
I did not change it nor set it up :)
I guess it uses https://en.gravatar.com/
Yes you are right...
So what this command outputs?
docker exec <conainer name> sh -c 'echo "select email,avatar from nginxproxymanager.user" | mysql'
Do you have a null avatar?
Here is the result of your query:
root@Xenon:~# docker exec NginxProxyManager sh -c 'echo "select email,avatar from nginxproxymanager.user" | mysql'
email avatar
pavel@XXXX //www.gravatar.com/avatar/13711f8a5ed4b796fe96cd42e26aca90?default=mm
pavel@XXXX //www.gravatar.com/avatar/13711f8a5ed4b796fe96cd42e26aca90?default=mm
I modified the email to pavel@XXXX
just to anonymize the data.
Hi @jlesage ,
I am keeping the container with all my issues running so you can debug it. It do not see any progress so I will delete it and start over.
Let me know if I should wait.
Thanks.
Sorry I didn't have time to work on this. If it's possible for you to remove any sensitive data from your config and share the appdata folder, I could use it to debug on my side. Else just start over to have something functional.
This also happens when you delete an user account.
I had this problem when re-creating the user account due to a lost password. I had to update a few tables (proxy_host, redirection_host, audit, etc.) Once those were referencing the correct owner_user_id, the error went away (and I was able to see/edit my proxy entries).
I had this problem when re-creating the user account due to a lost password. I had to update a few tables (proxy_host, redirection_host, audit, etc.) Once those were referencing the correct owner_user_id, the error went away (and I was able to see/edit my proxy entries).
This is the error I'm having. Tried resetting my password following the directions from #230. Now I'm receiving avatar errors like OP. Could you elaborate on the commands to update the tables? I'm not familiar with MariaDB / MySQL at all.
UPDATE:
After replicating the steps from #230 again, I was able to get it to a relatively stable state. It appears that I'm going to be unable to delete old accounts until this is fixed. My last admin account was using an @icloud.com
suffix which could explain the avatar issue.
Setting all of the users to is_deleted=0;
via UPDATE user SET is_deleted=0;
will make them re-appear in the Users list and I'm able to access the Hosts list once again.
Output of:
select email,avatar from user;
+--------------------+-----------------------------------------------------------------------+
| email | avatar |
+--------------------+-----------------------------------------------------------------------+
| [email protected] | //www.gravatar.com/avatar/c203a2090b903962ae58d5fb3d3XXXXX?default=mm |
| [email protected] | //www.gravatar.com/avatar/c203a2090b903962ae58d5fb3d3XXXXX?default=mm |
| [email protected] | //www.gravatar.com/avatar/02d753f45ef41e670c41a6a81c8XXXXX?default=mm |
| [email protected] | //www.gravatar.com/avatar/c203a2090b903962ae58d5fb3d3XXXXX?default=mm |
| [email protected] | //www.gravatar.com/avatar/c203a2090b903962ae58d5fb3d3XXXXX?default=mm |
| [email protected] | //www.gravatar.com/avatar/6257524feec9cca05f182d70169XXXXX?default=mm |
+--------------------+-----------------------------------------------------------------------+
I had this problem when re-creating the user account due to a lost password. I had to update a few tables (proxy_host, redirection_host, audit, etc.) Once those were referencing the correct owner_user_id, the error went away (and I was able to see/edit my proxy entries).
This is the error I'm having. Tried resetting my password following the directions from #230. Now I'm receiving avatar errors like OP. Could you elaborate on the commands to update the tables? I'm not familiar with MariaDB / MySQL at all.
UPDATE: After replicating the steps from #230 again, I was able to get it to a relatively stable state. It appears that I'm going to be unable to delete old accounts until this is fixed. My last admin account was using an
@icloud.com
suffix which could explain the avatar issue. Setting all of the users tois_deleted=0;
viaUPDATE user SET is_deleted=0;
will make them re-appear in the Users list and I'm able to access the Hosts list once again.Output of:
select email,avatar from user;
+--------------------+-----------------------------------------------------------------------+ | email | avatar | +--------------------+-----------------------------------------------------------------------+ | [email protected] | //www.gravatar.com/avatar/c203a2090b903962ae58d5fb3d3XXXXX?default=mm | | [email protected] | //www.gravatar.com/avatar/c203a2090b903962ae58d5fb3d3XXXXX?default=mm | | [email protected] | //www.gravatar.com/avatar/02d753f45ef41e670c41a6a81c8XXXXX?default=mm | | [email protected] | //www.gravatar.com/avatar/c203a2090b903962ae58d5fb3d3XXXXX?default=mm | | [email protected] | //www.gravatar.com/avatar/c203a2090b903962ae58d5fb3d3XXXXX?default=mm | | [email protected] | //www.gravatar.com/avatar/6257524feec9cca05f182d70169XXXXX?default=mm | +--------------------+-----------------------------------------------------------------------+
This also worked for me! Thanks
Just ran into this after deleting a user. Have to change owner_user_id in the tables of the affected pages to an existing user. For me was access_list and proxy_host tables.
Yes, just follow this guide and you won't have any issues https://github.com/NginxProxyManager/nginx-proxy-manager/issues/230#issuecomment-815078355
Used the link @zygimantus to reset a forgotten password. Ended up with some duplicate users. When deleting those users, I get this error. I am able to change/disable accounts and everything works fine, but deleting them results in this error.
When having this issue, it's possible to 'fix' it by UPDATE user SET is_deleted=0;
on the DB.
in fact the back rest (exemple: /api/nginx/certificates?expand=owner) api return null
on owner
attribute if the owner of the proxy host/certificats/etc object is disabled of removed (remove by the ui)...
i think is bug on the api, i think the remove of user must reassign the object to the user who remove user.
and if the user is disabled the api must return the user information and not null.
i've reafected all my object with my news user.
to get sqlite3 cli (if the database used is sqlite) in the container (in ssh terminal addon):
# docker exec addon_<id>_nginxproxymanager /bin/sh
# apk update
# apk add sqlite
to get the user id (column id):
# sqlite3 /data/database.sqlite
sqlite> select id, email from user;
1|[email protected]
2|[email protected]
my new user is id = 2
to update proxy_host table and reaffect to the new user:
sqlite> update proxy_host set owner_user_id = 2;
and reload the proxy manager proxy host admin page.
the same for each table that have owner_user_id column.
Hi, can add to this problem, also getting the same error on a certificate that is owned by the original admin user, which I deleted. Fixed with the same fix as above but for the certificate table:
update certificate set owner_user_id = 2;```
Hi,
Just delete all users you don't need, then for the user you want do, UPDATE user SET id=1 WHERE id=(Current id of your User);
The issue is, that your main user with id 1 is most likely the owner and the user you want to reactivate. But because your new user does not have id 1 it will give you this error. You could update the id for all tables/entries manually. But as I'm lazy, and only have one user this is a lot quicker.
I got this problem after resetting my password as shown here: https://github.com/NginxProxyManager/nginx-proxy-manager/discussions/1634 (setting isDeleted to the current user, the user that created the proxy hosts)
And was able to fix it only by deleting all the contents of the data folder (docker volume)
If you were playing with adding users , I had an error in the audit tab, I fixed by "delete from audit_log;" now all the tabs are working fine. and this is just FYI all the tables using the column "owner_user_id" :
- proxy_host
- certificate
- access_list
- dead_host
- redirection_host
- stream
For my part, just like you, I lost the administrator user's password and did the same as you did, I forced the creation of an administrator user by running the query 'UPDATE user SET is_deleted=1'. And once I logged in with the default credentials, I changed the previous administrator user's password. And that's it, it worked well for me.