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

Unable to clean uninstall. Keeps coming back with previous settings and issues

Open AlexHimself opened this issue 1 year ago • 2 comments

Problem/Motivation

Receiving error Cannot read properties of null (reading 'avatar') after deleting [email protected] account. Uninstalling/reinstalling nginx is not removing previous settings. I'm using the Raspberry Pi Home Assistant image (not sure technical name of that install).

I believe this is after the auto-upgrade breaking change and deleting the [email protected] user. #507 .

The following error appears on nearly every configuration page, not just SSL Certificates.

image

Expected behavior

Uninstalling nginx and reinstalling would be a vanilla install again.

Actual behavior

Same settings, user accounts, and errors persist after each uninstall/install and even mixing in restarts.

[08:41:29] INFO: Starting NGinx... s6-rc: info: service legacy-services successfully started 2024/02/02 08:41:29 [error] 208#208: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.86.7, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "hapi4.local:81", referrer: "http://hapi4.local:81/nginx/certificates" [2/2/2024] [8:41:29 AM] [Global ] › ℹ info Using Sqlite: /config/database.sqlite [2/2/2024] [8:41:32 AM] [Migrate ] › ℹ info Current database version: none

Steps to reproduce

The steps that lead to this error were essentially:

  1. Noticed was unable to login to nginx with my account and I used [email protected]/changeme and it allowed me to login. This was likely due to #507
  2. Was not prompted to change password and previous settings were gone. Appeared vanilla.
  3. I configured the proxy hosts and SSL certificate using [email protected] account.
  4. Added [email protected] as admin.
  5. Deleted [email protected].
  6. Signed out of [email protected] and in as [email protected].
  7. Received error that I suspect is related and could be solved by this github post. I'm guessing the certificate owner was the [email protected] account.
  8. Uninstalled/reinstalled multiple times as well as restarted device and previous settings (user account, forwarding) persist.

This is in the log, if relevant:

[08:41:29] INFO: Starting NGinx... s6-rc: info: service legacy-services successfully started 2024/02/02 08:41:29 [error] 208#208: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.86.7, server: nginxproxymanager, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "hapi4.local:81", referrer: "http://hapi4.local:81/nginx/certificates" [2/2/2024] [8:41:29 AM] [Global ] › ℹ info Using Sqlite: /config/database.sqlite [2/2/2024] [8:41:32 AM] [Migrate ] › ℹ info Current database version: none

AlexHimself avatar Feb 02 '24 16:02 AlexHimself

I managed to fix the database, but I think the underlying issue may still exist. My resolution was the following:

From web SSH Terminal, I ran the following:

  1. apk add sqlite
  2. I opened my nginx database with sqlite3 /addon_configs/a0d7b954_nginxproxymanager/database.sqlite
  3. Ran the following two commands:

update certificate set owner_user_id = 2; update proxy_host set owner_user_id = 2; .exit

  1. Refreshed nginx and it was corrected.

Observation - I noticed when running SELECT * FROM 'auth' that there are 3 users and is_deleted = 0 for all of them. I only have 1 user account ([email protected]).

When running SELECT * FROM 'user' however, I see is_deleted=1 for the two other accounts that shouldn't be there. One is [email protected] and the other is [email protected], which was my attempt to recreate the default admin account.

AlexHimself avatar Feb 02 '24 18:02 AlexHimself

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

github-actions[bot] avatar Mar 04 '24 10:03 github-actions[bot]