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

Configuration blank in web administration #344

Closed
q1t1 opened this issue Jul 16, 2022 · 120 comments
Closed

Configuration blank in web administration #344

q1t1 opened this issue Jul 16, 2022 · 120 comments
Labels
stale There has not been activity on this issue or PR for quite some time.

Comments

@q1t1
Copy link

q1t1 commented Jul 16, 2022

Hi Frenck,
It's like the addon reset itself...

It tried to connect with my normal credentials, and it failed.
I the used admin@example.com / changeme and it worked...

My configuration in the web administration is blanked but my old confiuration is still present in mariadb and works as intended...

Is it possible to re-link the web administration to the mariadb configuration ?

Thank you for your hard work, best regards,

@q1t1 q1t1 closed this as completed Jul 16, 2022
@q1t1
Copy link
Author

q1t1 commented Jul 16, 2022

I reinstalled it and the configuration came back.

Best regards !

@broyuken
Copy link

Please reopen this, as I am having the same issue but reinstalling did not resolve it.

@adamgreenberg07
Copy link

I'm having the same issue. I have not tried to uninstall the add on and re-install because I don't want to risk making the problem worse.

@q1t1
Copy link
Author

q1t1 commented Aug 14, 2022

As 2 people have the same problem, I reopen this case.

@q1t1 q1t1 reopened this Aug 14, 2022
@habuild
Copy link

habuild commented Aug 16, 2022

Same issue. It went to sqlite from mariadb.

[01:16:30] INFO: Starting the Manager...
[01:16:30] INFO: Starting NGinx...
[8/17/2022] [1:16:31 AM] [Global   ] › ℹ  info      No valid environment variables for database provided, using default SQLite file '/data/database.sqlite'
[8/17/2022] [1:16:31 AM] [Global   ] › ℹ  info      Generating SQLite knex configuration

The issue is also duplicated here, with better logs.
#348

@gitolicious
Copy link

gitolicious commented Aug 20, 2022

Same thing happened to me. I was surprised to see everything else (proxy hosts, SSL certs) still working as expected as creredentials are reset and the web UI is blank. Is there anything we can do to help debugging?

@lbouriez
Copy link

Hello, same:
No valid environment variables for database provided, using default SQLite
My maria-db addon is up and working, nginx is still working but i cannot login

@habuild
Copy link

habuild commented Aug 21, 2022

The solution I found was to reinstall the nginx proxy manager addon. Your current config should still be saved in mariadb addon. as @q1t1 suggested earlier

I did have to muck around with the proxy host address after reinstall to get it to find my local hostname again. I had mypihostname.local set. I was getting sent to a HA loading page with a 60sec retry timer. I set my local host back to IP number and clicked the external link from proxy hosts page.
I swtiched it back mypihostname.local after that and it worked fine.

[11:44:43] INFO: Starting NGinx...
[8/21/2022] [11:44:44 AM] [Global   ] › ℹ  info      Manual db configuration already exists, skipping config creation from environment variables

@lbouriez
Copy link

The solution I found was to reinstall the nginx proxy manager addon. Your current config should still be saved in mariadb addon. as @q1t1 suggested earlier

I did have to muck around with the proxy host address after reinstall to get it to find my local hostname again. I had mypihostname.local set. I was getting sent to a HA loading page with a 60sec retry timer. I set my local host back to IP number and clicked the external link from proxy hosts page. I swtiched it back mypihostname.local after that and it worked fine.

[11:44:43] INFO: Starting NGinx...
[8/21/2022] [11:44:44 AM] [Global   ] › ℹ  info      Manual db configuration already exists, skipping config creation from environment variables

I tried that like 2 days ago, it works but after nginx update... Again it started to use the sqllite db.

@lbouriez
Copy link

@frenck any idea what could be the issue ? Why this addon is not able to see mariadb and fallback on sqlite ?

@richard-scott
Copy link

I've had to delete my 'nginxproxymanager' MySQL database and start again from scratch. Nothing else worked for me.

@gitolicious
Copy link

There is a commit (NginxProxyManager/nginx-proxy-manager@ffe3db8) which could be related: it introduced the SQLite fallback and was introduced in Nginx Proxy Manager 2.9.12 (Add-on version 0.12.0).

@frenck
Copy link
Member

frenck commented Aug 21, 2022

The question is: Why does it fallback (as in, what is wrong with SQL).

@gitolicious
Copy link

Can you point us to the code where the SQL config is being injected/set?
When checking the env vars in the container, there is no SQL config (though I am not sure if it should be there).

root@***-nginxproxymanager:/$ env
PYTHONUNBUFFERED=1
S6_BEHAVIOUR_IF_STAGE2_FAILS=2
CHARSET=UTF-8
HOSTNAME=***-nginxproxymanager
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
PWD=/
CARGO_NET_GIT_FETCH_WITH_CLI=true
YARN_HTTP_TIMEOUT=1000000
TZ=Europe/Berlin
HOME=/root
LANG=C.UTF-8
PIP_PREFER_BINARY=1
HASSIO_TOKEN=******
TERM=xterm-256color
PIP_DISABLE_PIP_VERSION_CHECK=1
SUPERVISOR_TOKEN=******
SHLVL=1
PYTHONDONTWRITEBYTECODE=1
PS1=$(whoami)@$(hostname):$(pwd)$ 
PIP_FIND_LINKS=https://wheels.home-assistant.io/musllinux/
LC_COLLATE=C
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
S6_CMD_WAIT_FOR_SERVICES=1
PIP_NO_CACHE_DIR=1
_=/usr/bin/env

@frenck
Copy link
Member

frenck commented Aug 21, 2022

@gitolicious
Copy link

gitolicious commented Aug 21, 2022

Thx for the link. At least in the running container this information is not present.

$ cat /data/manager/production.json
{
  "database": {
    "fromEnv": true,
    "engine": "knex-native",
    "knex": {
      "client": "sqlite3",
      "connection": {
        "filename": "/data/database.sqlite"
      },
      "useNullAsDefault": true
    }
  },
  "jwt": {***}
}

It might have been overwritten on startup though (see logs above).

@frenck
Copy link
Member

frenck commented Aug 21, 2022

So, what I don't understand is: Why I don't have this issue? As in, I run this thing on multiple machines (including different test setups; I always test releases before shipping them).

This sounds like something fundamentally wrong, but... I don't see it?

(PS: will not respond for a bit, time enjoy my last hour of my Sunday for a bit with a beer 😉 )

@gitolicious
Copy link

gitolicious commented Aug 21, 2022

I can't tell at the moment. It must be this check failing for us:

https://github.com/NginxProxyManager/nginx-proxy-manager/blob/1f3ac7a9ec80ec49a1c13ebcc46ab3f48ae026f4/backend/index.js#L63-L67

Will try looking further into it in the next days. Fooling around with the proxy is always a bit messy as some of my systems rely on it working...

Enjoy your beer, you deserve it! 🍻

@richard-scott
Copy link

Maybe it’s to do with Maria DB and not your add on?

@lbouriez
Copy link

I had issue with an extension of mine that is using mariadb and was not able to connect to it but after restoring the extension... It works and still working until now so not sure if it's nginx or maria :/

@habuild
Copy link

habuild commented Aug 22, 2022

Some additional parts of the log from my earlier post(not sure why it's renewing so much, although I probably have old certs hiding) and then a reboot log. Doesn't really provide much insight.

Also had this in mariadb logs
[12:30:18] INFO: MariaDB tables unlocked.
2022-08-21 20:08:13 45 [Warning] Aborted connection 45 to db: 'nginxproxymanager' user: 'service' host: '172.30.33.6' (Got timeout reading communication packets)
Updated log
[8/21/2022] [11:56:55 AM] [Setup    ] › ℹ  info      Logrotate completed.
[8/21/2022] [11:56:55 AM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[8/21/2022] [11:56:55 AM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[8/21/2022] [11:56:55 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[8/21/2022] [11:56:55 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[8/21/2022] [11:56:55 AM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[8/21/2022] [11:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [11:56:55 AM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[8/21/2022] [11:56:55 AM] [Global   ] › ℹ  info      Backend PID 263 listening on port 3000 ...
[8/21/2022] [11:57:03 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [11:57:03 AM] [SSL      ] › ℹ  info      Renew Complete
`QueryBuilder#allowEager` method is deprecated. You should use `allowGraph` instead. `allowEager` method will be removed in 3.0
`QueryBuilder#eager` method is deprecated. You should use the `withGraphFetched` method instead. `eager` method will be removed in 3.0
QueryBuilder#omit is deprecated. This method will be removed in version 3.0
Model#$omit is deprected and will be removed in 3.0.
Duplicate relation "access_list" in a relation expression. You should use "a.[b, c]" instead of "[a.b, a.c]". This will cause an error in objection 2.0
[8/21/2022] [12:04:45 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [12:05:10 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [12:05:28 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [12:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [12:57:01 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [12:57:01 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [1:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [1:57:00 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [1:57:00 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [2:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [2:57:00 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [2:57:00 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [3:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [3:57:00 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [3:57:00 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [4:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [4:57:01 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [4:57:01 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [5:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [5:56:55 PM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[8/21/2022] [5:56:55 PM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[8/21/2022] [5:56:56 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[8/21/2022] [5:56:56 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[8/21/2022] [5:56:56 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [5:57:00 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [5:57:00 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [6:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [6:57:01 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [6:57:01 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [7:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [7:57:01 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [7:57:01 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [8:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [8:57:00 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [8:57:00 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [9:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [9:57:01 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [9:57:01 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [10:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [10:57:01 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [10:57:01 PM] [SSL      ] › ℹ  info      Renew Complete
[8/21/2022] [11:56:55 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/21/2022] [11:56:55 PM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[8/21/2022] [11:56:55 PM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[8/21/2022] [11:56:56 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[8/21/2022] [11:56:56 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[8/21/2022] [11:56:56 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [11:57:02 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/21/2022] [11:57:02 PM] [SSL      ] › ℹ  info      Renew Complete
[8/22/2022] [12:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [12:57:00 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [12:57:00 AM] [SSL      ] › ℹ  info      Renew Complete
[8/22/2022] [1:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [1:57:00 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [1:57:00 AM] [SSL      ] › ℹ  info      Renew Complete
[8/22/2022] [2:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [2:57:01 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [2:57:01 AM] [SSL      ] › ℹ  info      Renew Complete
[8/22/2022] [3:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [3:57:00 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [3:57:00 AM] [SSL      ] › ℹ  info      Renew Complete
[8/22/2022] [4:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [4:57:01 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [4:57:01 AM] [SSL      ] › ℹ  info      Renew Complete
[8/22/2022] [5:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [5:56:55 AM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[8/22/2022] [5:56:55 AM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[8/22/2022] [5:56:56 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[8/22/2022] [5:56:56 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[8/22/2022] [5:56:56 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [5:57:00 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [5:57:01 AM] [SSL      ] › ℹ  info      Renew Complete
[8/22/2022] [6:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [6:57:01 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [6:57:01 AM] [SSL      ] › ℹ  info      Renew Complete
[8/22/2022] [7:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [7:57:00 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [7:57:00 AM] [SSL      ] › ℹ  info      Renew Complete
[8/22/2022] [8:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [8:57:00 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [8:57:01 AM] [SSL      ] › ℹ  info      Renew Complete
[8/22/2022] [9:56:55 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [9:57:01 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [9:57:01 AM] [SSL      ] › ℹ  info      Renew Complete
Fresh reboot logs
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: Nginx Proxy Manager
 Manage Nginx proxy hosts with a simple, powerful interface
-----------------------------------------------------------
 Add-on version: 0.12.2
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2022.8.6
 Home Assistant Supervisor: 2022.08.3
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/mysql.sh
cont-init: info: /etc/cont-init.d/mysql.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
cont-init: info: running /etc/cont-init.d/npm.sh
cont-init: info: /etc/cont-init.d/npm.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun manager (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
[10:42:47] INFO: Starting the Manager...
[10:42:47] INFO: Starting NGinx...
s6-rc: info: service legacy-services successfully started
[8/22/2022] [10:43:01 AM] [Global   ] › ℹ  info      Manual db configuration already exists, skipping config creation from environment variables
[8/22/2022] [10:43:07 AM] [Migrate  ] › ℹ  info      Current database version: 20211108145214
[8/22/2022] [10:43:07 AM] [Setup    ] › ℹ  info      Logrotate Timer initialized
[8/22/2022] [10:43:07 AM] [Setup    ] › ℹ  info      Logrotate completed.
[8/22/2022] [10:43:07 AM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[8/22/2022] [10:43:07 AM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[8/22/2022] [10:43:08 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[8/22/2022] [10:43:08 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[8/22/2022] [10:43:08 AM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[8/22/2022] [10:43:08 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[8/22/2022] [10:43:08 AM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[8/22/2022] [10:43:08 AM] [Global   ] › ℹ  info      Backend PID 260 listening on port 3000 ...
[8/22/2022] [10:43:15 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[8/22/2022] [10:43:15 AM] [SSL      ] › ℹ  info      Renew Complete

@joselito11
Copy link

I reinstalled it and the configuration came back.

Best regards !

Thany you very much for this!
I have tried multiple snapshot restore from nginx and mariadb, only reinstall of nginx worked!

@joselito11
Copy link

But after host reboot, I had to reinstall again nginx. Something weird is with mariadb or nginx

@calisro
Copy link

calisro commented Aug 22, 2022

Yes very wierd. Lost access. Reinstalling the addon doesn't completely work as then I needed to remove and re-add letsencrypt ssl config to get it to work again as it thinks it already had the certs.

I just did this yesterday as well. :( reboot and lost access to NPM again.

btw, it is a REBOOT and not a 'HA RESTART' that causes this I believe.

@calisro
Copy link

calisro commented Aug 22, 2022

well. This is how you restore access:

docker exec -it addon_a0d7b954_nginxproxymanager cp /defaults/production.json /data/manager/

and then restart the addon.

@gitolicious
Copy link

gitolicious commented Aug 22, 2022

The one thing that still puzzles me the most: why is the proxy itself still working? Other than the login and Web UI, everything under the hood is doing its thing as always. This very page is served by Nginx Proxy Manager - if I stop the plugin, the page is no longer available.

image

Same for my HomeAssistant in the first browser tab at https://hassio.xxxxxxx.org/

Edit:

Understanding a bit more here... The "working part" is coming from configurations injected via the volume mount /usr/share/hassio/addons/data/a0d7b954_nginxproxymanager:/data. E.g. my HomeAssistant is served by /data/nginx/proxy_host/1.conf. So the pure Nginx configuration is still present, even though it is not managed by Nginx Proxy Manager and the settings stored in MariaDB currently.

@joselito11
Copy link

The one thing that still puzzles me the most: why is the proxy itself still working? Other than the login and Web UI, everything under the hood is doing its thing as always. This very page is served by Nginx Proxy Manager - if I stop the plugin, the page is no longer available.

image

Same for my HomeAssistant in the first browser tab at https://hassio.xxxxxxx.org/

Edit:

Understanding a bit more here... The "working part" is coming from configurations injected via the volume mount /usr/share/hassio/addons/data/a0d7b954_nginxproxymanager:/data. E.g. my HomeAssistant is served by /data/nginx/proxy_host/1.conf. So the pure Nginx configuration is still present, even though it is not managed by Nginx Proxy Manager and the settings stored in MariaDB currently.

How to get data from mariadb? I want move data to nginx in docker to another machine

@james28909
Copy link

james28909 commented Dec 11, 2022

@calisro my apologies, i did not see that post. i only have 3 services running from hass anyway. but on a side note, until this problem arose, and after over 2.5 years of using hass in hyper-v... i did not know that i could use python from within the home assistant os thats installed in windows hyper-v.

ive literally just discovered that i can run my own python scripts. and i just looked and it also runs perl scripts! so this all has been a bit of finding for me. now i have the resources to add a few more services to my domain! but if i have any more problems ill def try the fix in your post

@Alby247
Copy link

Alby247 commented Dec 16, 2022

Just to keep this open...

After previously having this problem and then doing the full delete/reinstall/set up from scratch a while ago Nginx proxy manager has been working fine.

I was playing around with setting up access lists, and in the middle of doing that Nginx proxy manager became unresponsive. Closed the window, opened the add on again - no access using my previously working username/password.

Remote access and certs still work so I'm not touching it for now, but it's very annoying that this is happening.

@Alby247
Copy link

Alby247 commented Dec 16, 2022

well. This is how you restore access:

docker exec -it addon_a0d7b954_nginxproxymanager cp /defaults/production.json /data/manager/

and then restart the addon.

@calisro - I've done this but it's not fixing the issue for me. When I run that command in SSH & Web Terminal (protection mode disabled) it appears to execute without error but there is no output from the command so I can only assume it is running correctly. Is that normal?

@kolorafa
Copy link

kolorafa commented Dec 16, 2022

it appears to execute without error but there is no output from the command so I can only assume it is running correctly. Is that normal?

Yes, copy (cp) command doesn't print anything when succeed.

@timh767 In your case after restart I would check if it didn't get reverted back to bad one between your command and restart.
For example by checking if the /data/manager/production.json has mysql setup or it got reverted back to sqlite.
docker exec -it addon_a0d7b954_nginxproxymanager cat /data/manager/production.json

There could be also be a possibility that for you config is fine but the database in mysql was lost, or that your account and setup was in sqlite to begin with... So check your database using phpmyadmin to confirm that your manager database is still there and is not empty.

@Alby247
Copy link

Alby247 commented Dec 17, 2022

Thanks @kolorafa.

Running that command gives me
{ "database": { "engine": "mysql", "host": "core-mariadb", "name": "nginxproxymanager", "user": "service", "password": "####complexpassword#####", "port": 3306 },
followed by a private and public key.

I can view the nginx database in phpmyadmin, and I can see my user id in the user table as well as my list of proxy hosts and certificates, and also the new access lists I was setting up when it crashed and locked me out.

It appears to simply be not accepting my user password, but I know it's correct (saved in firefox password manager).

Is there any way to reset a user password?

@Alby247
Copy link

Alby247 commented Dec 17, 2022

OK, thanks to this link

NginxProxyManager/nginx-proxy-manager#230 (comment)

I reset my user password to changeme using phpmyadmin, opened NPM with my username and changeme password and was able to log in, all my proxys etc still there as before. Changed password via the NPM interface, logged out and back in again and all is good.

Copied from that link by @chaptergy

`For those not wanting a new admin account, but instead to just set the password of a specific account you can do the following:

Connect to the database as before and go into the table named auth and update the secret column where the user_id is the user id you want. (You can see the users in the users table, and see the id associated with an email address.

Change the secret to

$2b$13$C9mJYK7Gf7sVgCCYw84HhOvOIpnyhkdGqwIp0PPj/s9.q0bxkoMZe

This will result in the password being changeme.

`

@calisro
Copy link

calisro commented Dec 22, 2022

@timh767 That only works if the database is already using the correct one: mariadb. THat is a different issue. You still need to revert the production.json as mentioned many times in this thread.

@Alby247
Copy link

Alby247 commented Dec 22, 2022

@calisro well my symptoms were exactly as described in the original post, and doing the above fixed it whereas none of the other methods in this thread made an difference. Thought that was relevant as others searching on this problem will arrive here and this may be a solution.

Hi Frenck, It's like the addon reset itself...

It tried to connect with my normal credentials, and it failed. I the used admin@example.com / changeme and it worked...

My configuration in the web administration is blanked but my old confiuration is still present in mariadb and works as intended...

Is it possible to re-link the web administration to the mariadb configuration ?

Thank you for your hard work, best regards,

@merti29
Copy link

merti29 commented Jan 20, 2023

Same issue here happend after last update....got it nearly back to work with ssh custom terminal and docker exec...
only got one problem left: the settings tab is not working
grafik

@mvoort1337
Copy link

My Home Assistant certificate will expire in a few weeks so I thought i'd login to nginx pm to lookup the exacte date and noticed it wouldn't log me in.
Issue appears to be the same or similar as the issue referred to in this thread.

I use the Nginx Proxy Manager add-on with an internal certificate, so no letsencrypt.

Add-on version 0.12.3
Home Assistant Core 2022.12.8
Home Assistant Supervisor 2022.12.1
System: Home Assistant OS 9.4 (amd64 / qemux86-64)

Additional information:

  • The Home Assistant web-interface is still running fine and using the current certificate, so the add-on seems to be working.
  • Stopping the add-on also stops the Home Assistant web interface over https, so that it consistent with the add-on still running ok.
  • Restarting the add-on with the mariadb running and the https connection also comes back.
  • Restarting the nginx pm add-on with the mariadb add-on stopped causes the https connection not to come back.
  • Opening the web-ui of the add-on gives a blank configuration, I needed to create a new login from the admin@example.com default username.

I can't explain what the issue is. The reverse proxy appears to be running correctly, yet the management web interface is empty. Almost as if the add-on is using two databases for the different parts.

Setting the log level to debug the add-on indicates that it will be using the mariadb connection initially, then later stating that there is no environment variable provided the the database and that it will default to sqlite.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: Nginx Proxy Manager
 Manage Nginx proxy hosts with a simple, powerful interface
-----------------------------------------------------------
 Add-on version: 0.12.3
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.4  (amd64 / qemux86-64)
 Home Assistant Core: 2022.12.8
 Home Assistant Supervisor: 2022.12.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
Log level is set to DEBUG
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/mysql.sh
[09:57:41] DEBUG: Requested API resource: http://supervisor/services/mysql
[09:57:41] DEBUG: Request method: GET
[09:57:41] DEBUG: Request data: {}
[09:57:41] DEBUG: API HTTP Response code: 200
[09:57:41] DEBUG: API Response: {"result": "ok", "data": {"host": "core-mariadb", "port": 3306, "username": "service", "password": "removedpasswordinformation", "addon": "core_mariadb"}}
cont-init: info: /etc/cont-init.d/mysql.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
[09:57:42] DEBUG: Requested API resource: http://supervisor/dns/info
[09:57:42] DEBUG: Request method: GET
[09:57:42] DEBUG: Request data: {}
[09:57:42] DEBUG: API HTTP Response code: 200
[09:57:42] DEBUG: API Response: {"result": "ok", "data": {"version": "2022.04.1", "version_latest": "2022.04.1", "update_available": false, "host": "172.30.32.3", "servers": [], "locals": ["dns://172.16.227.1"], "mdns": true, "llmnr": true, "fallback": true}}
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
cont-init: info: running /etc/cont-init.d/npm.sh
cont-init: info: /etc/cont-init.d/npm.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun manager (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
s6-rc: info: service legacy-services successfully started
[09:57:42] INFO: Starting NGinx...
[09:57:42] INFO: Starting the Manager...
[1/22/2023] [9:57:42 AM] [Global   ] › ℹ  info      No valid environment variables for database provided, using default SQLite file '/data/database.sqlite'
[1/22/2023] [9:57:42 AM] [Global   ] › ℹ  info      Generating SQLite knex configuration
[1/22/2023] [9:57:42 AM] [Global   ] › ⬤  debug     Wrote db configuration to config file: ./config/production.json
[1/22/2023] [9:57:42 AM] [Migrate  ] › ℹ  info      Current database version: none
[1/22/2023] [9:57:43 AM] [Setup    ] › ⬤  debug     JWT Keypair already exists
[1/22/2023] [9:57:43 AM] [Setup    ] › ⬤  debug     Admin user setup not required
[1/22/2023] [9:57:43 AM] [Setup    ] › ⬤  debug     Default setting setup not required
[1/22/2023] [9:57:43 AM] [Setup    ] › ℹ  info      Logrotate Timer initialized
[1/22/2023] [9:57:43 AM] [Setup    ] › ℹ  info      Logrotate completed.
[1/22/2023] [9:57:43 AM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[1/22/2023] [9:57:43 AM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[1/22/2023] [9:57:43 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[1/22/2023] [9:57:43 AM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[1/22/2023] [9:57:43 AM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[1/22/2023] [9:57:43 AM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[1/22/2023] [9:57:43 AM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[1/22/2023] [9:57:43 AM] [Global   ] › ℹ  info      Backend PID 291 listening on port 3000 ...
[1/22/2023] [9:57:44 AM] [Nginx    ] › ℹ  info      Testing Nginx configuration
[1/22/2023] [9:57:44 AM] [Nginx    ] › ℹ  info      Reloading Nginx
[1/22/2023] [9:57:44 AM] [SSL      ] › ℹ  info      Renew Complete
`QueryBuilder#allowEager` method is deprecated. You should use `allowGraph` instead. `allowEager` method will be removed in 3.0
`QueryBuilder#eager` method is deprecated. You should use the `withGraphFetched` method instead. `eager` method will be removed in 3.0
QueryBuilder#omit is deprecated. This method will be removed in version 3.0
Model#$omit is deprected and will be removed in 3.0.

Let me know if I can help to provide more information.

@WAPEETY
Copy link

WAPEETY commented Feb 10, 2023

docker exec -it addon_a0d7b954_nginxproxymanager cp /defaults/production.json /data/manager/

this command works also for home assistant OS?

@github-actions
Copy link

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 github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Mar 13, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2023
@ThePatricide
Copy link

Also ran into this issue. See #409

Had to reinstall Nginx. Then it could connect to my MariaDB add-on again. It would however not work as reverse proxy anymore and I could not get new certificates. Therefore, also needed to reset the DB (thanks a lot for this switch, hidden in the configuration!) and had to start all over again.
Have configured everything by hand again and is now working as supposed.

@calisro
Copy link

calisro commented Mar 21, 2023

docker exec -it addon_a0d7b954_nginxproxymanager cp /defaults/production.json /data/manager/

this command works also for home assistant OS?

Yes

@calisro
Copy link

calisro commented Mar 21, 2023

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 +1 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

Lovely

@tjorim
Copy link
Contributor

tjorim commented Apr 10, 2023

Not stale

@tjorim tjorim reopened this Apr 10, 2023
@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Apr 11, 2023
@Kali7070
Copy link

docker exec -it addon_a0d7b954_nginxproxymanager cp /defaults/production.json /data/manager/

this command works also for home assistant OS?

Yes

Sorry for my noobish question, but where do i execute the command in home assistant os? In the terminal it doesnt work

@calisro
Copy link

calisro commented Apr 28, 2023

where do i execute the command in home assistant os? In the terminal it doesnt work

#344 (comment)

@dMopp
Copy link

dMopp commented May 25, 2023

docker exec -it addon_a0d7b954_nginxproxymanager cp /defaults/production.json /data/manager/ works fine... however that happened, but solved :D thanks man !

@circa1665
Copy link

This doesn't work for me:

docker exec -it addon_a0d7b954_nginxproxymanager cp /defaults/production.json /data/manager/

Can only login with the default credentials (proxy is working but ui is blank).

@github-actions
Copy link

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 github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Jul 22, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 30, 2023
@skynet01
Copy link

docker exec -it addon_a0d7b954_nginxproxymanager cp /defaults/production.json /data/manager/

Worked for me, also have to restart the add-on hope it won't happen again

@github-actions github-actions bot locked and limited conversation to collaborators Sep 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale There has not been activity on this issue or PR for quite some time.
Projects
None yet
Development

No branches or pull requests