jlesage / docker-nginx-proxy-manager

Docker container for Nginx Proxy Manager
MIT License
755 stars 166 forks source link

[Bug] Problem with database. #296

Open myxxmikeyxx opened 1 year ago

myxxmikeyxx commented 1 year ago

Current Behavior

I have exported my old database and then exported just the proxy's list to a csv. I then recreated my docker fully and started from scratch and tried to just import my proxy's list. Everything looks the same between the old and the new database proxy's tables. After logging in, I go to proxy's and I see this error: Cannot read properties of null (reading 'name') image

I might be doing something wrong but I am not sure what. Another question that kind of goes along with this is how do I change it from using sqlite database to using my mariadb database in unraid? I tried changing the database location from the default path to the ip and port of my mariadb and on mariadb I had created the npm database and npm user with the npm password that is shows on the webpage

Expected Behavior

I thought I should just be able to import a csv file into the database into the table I want to restore of all my previously exported table data.

Steps To Reproduce

Inside Unraid install the Nginx Proxy Manager (NPM). Create proxies. Stop Container. Export the database file and open with some database reader. (I used: DBrowser (SQLite)) image Export Proxy table to csv file. Back in Unraid install the Nginx Proxy Manager (NPM) again fresh (delete all old folders and data) Get logged in first time and change default user. Stop container. Export the database file and open. Import the csv file into database. Save and put database back on unraid. Start NPM again and log in. Check Proxy's

Environment

Container creation

Not sure what this is since I don't see this in unraid until I build it or edit it again. Side note I change the 'DB back to the file so that is what I am using right now'

docker run -d --name='Nginx-Proxy-Manager-Official' --net='back_bridge_network' -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Tower" -e HOST_CONTAINERNAME="Nginx-Proxy-Manager-Official" -e 'DB_SQLITE_FILE'='/data/database.sqlite' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://[IP]:[PORT:81]' -l net.unraid.docker.icon='https://nginxproxymanager.com/icon.png' -p '81:81/tcp' -p '80:80/tcp' -p '443:443/tcp' -p '3000:3000/tcp' -v '/mnt/user/appdata/Nginx-Proxy-Manager-Official/data':'/data':'rw' -v '/mnt/user/appdata/Nginx-Proxy-Manager-Official/letsencrypt':'/etc/letsencrypt':'rw' -v '/tmp/Nginx-Proxy-Manager-Official/var/log':'/var/log':'rw' --memory=1G --no-healthcheck 'jc21/nginx-proxy-manager'

Container log

root@Tower:~# docker logs Nginx-Proxy-Manager-Official
❯ Configuring npm user ...
❯ Configuring npm group ...
❯ Checking paths ...
❯ Setting ownership ...
❯ Dynamic resolvers ...
❯ IPv6 ...
Enabling IPV6 in hosts in: /etc/nginx/conf.d
- /etc/nginx/conf.d/default.conf
- /etc/nginx/conf.d/include/assets.conf
- /etc/nginx/conf.d/include/block-exploits.conf
- /etc/nginx/conf.d/include/force-ssl.conf
- /etc/nginx/conf.d/include/ip_ranges.conf
- /etc/nginx/conf.d/include/letsencrypt-acme-challenge.conf
- /etc/nginx/conf.d/include/proxy.conf
- /etc/nginx/conf.d/include/ssl-ciphers.conf
- /etc/nginx/conf.d/include/resolvers.conf
- /etc/nginx/conf.d/production.conf
Enabling IPV6 in hosts in: /data/nginx
- /data/nginx/proxy_host/1.conf
- /data/nginx/proxy_host/3.conf
- /data/nginx/proxy_host/2.conf
- /data/nginx/proxy_host/4.conf
❯ Docker secrets ...

-------------------------------------
 _   _ ____  __  __
| \ | |  _ \|  \/  |
|  \| | |_) | |\/| |
| |\  |  __/| |  | |
|_| \_|_|   |_|  |_|
-------------------------------------
User:  npm PUID:0 ID:0 GROUP:0
Group: npm PGID:0 ID:0
-------------------------------------

❯ Starting backend ...
❯ Starting nginx ...
[6/9/2023] [1:05:28 PM] [Global   ] › ℹ  info      Using Sqlite: /data/database.sqlite
[6/9/2023] [1:05:29 PM] [Migrate  ] › ℹ  info      Current database version: none
[6/9/2023] [1:05:45 PM] [Setup    ] › ℹ  info      Added Certbot plugins certbot-dns-cloudflare==$(certbot --version | grep -Eo '[0-9](\.[0-9]+)+') cloudflare
[6/9/2023] [1:05:45 PM] [Setup    ] › ℹ  info      Logrotate Timer initialized
[6/9/2023] [1:05:46 PM] [Setup    ] › ℹ  info      Logrotate completed.
[6/9/2023] [1:05:46 PM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[6/9/2023] [1:05:46 PM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[6/9/2023] [1:05:46 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[6/9/2023] [1:05:46 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[6/9/2023] [1:05:46 PM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[6/9/2023] [1:05:46 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[6/9/2023] [1:05:46 PM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[6/9/2023] [1:05:46 PM] [Global   ] › ℹ  info      Backend PID 179 listening on port 3000 ...
[6/9/2023] [1:05:47 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[6/9/2023] [1:05:47 PM] [SSL      ] › ℹ  info      Renew Complete
[6/9/2023] [1:08:08 PM] [Global   ] › ℹ  info      PID 179 received SIGTERM
[6/9/2023] [1:08:08 PM] [Global   ] › ℹ  info      Stopping.
❯ Configuring npm user ...
0
usermod: no changes
❯ Configuring npm group ...
❯ Checking paths ...
❯ Setting ownership ...
❯ Dynamic resolvers ...
❯ IPv6 ...
Enabling IPV6 in hosts in: /etc/nginx/conf.d
- /etc/nginx/conf.d/include/assets.conf
- /etc/nginx/conf.d/include/block-exploits.conf
- /etc/nginx/conf.d/include/force-ssl.conf
- /etc/nginx/conf.d/include/ip_ranges.conf
- /etc/nginx/conf.d/include/letsencrypt-acme-challenge.conf
- /etc/nginx/conf.d/include/proxy.conf
- /etc/nginx/conf.d/include/ssl-ciphers.conf
- /etc/nginx/conf.d/include/resolvers.conf
- /etc/nginx/conf.d/default.conf
- /etc/nginx/conf.d/production.conf
Enabling IPV6 in hosts in: /data/nginx
- /data/nginx/proxy_host/1.conf
- /data/nginx/proxy_host/3.conf
- /data/nginx/proxy_host/2.conf
- /data/nginx/proxy_host/4.conf
❯ Docker secrets ...

-------------------------------------
 _   _ ____  __  __
| \ | |  _ \|  \/  |
|  \| | |_) | |\/| |
| |\  |  __/| |  | |
|_| \_|_|   |_|  |_|
-------------------------------------
User:  npm PUID:0 ID:0 GROUP:0
Group: npm PGID:0 ID:0
-------------------------------------

❯ Starting nginx ...
❯ Starting backend ...
[6/9/2023] [1:08:20 PM] [Global   ] › ℹ  info      Using Sqlite: /data/database.sqlite
[6/9/2023] [1:08:21 PM] [Migrate  ] › ℹ  info      Current database version: none
[6/9/2023] [1:08:23 PM] [Setup    ] › ℹ  info      Added Certbot plugins certbot-dns-cloudflare==$(certbot --version | grep -Eo '[0-9](\.[0-9]+)+') cloudflare
[6/9/2023] [1:08:23 PM] [Setup    ] › ℹ  info      Logrotate Timer initialized
[6/9/2023] [1:08:23 PM] [Setup    ] › ℹ  info      Logrotate completed.
[6/9/2023] [1:08:23 PM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[6/9/2023] [1:08:23 PM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[6/9/2023] [1:08:23 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[6/9/2023] [1:08:24 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[6/9/2023] [1:08:24 PM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[6/9/2023] [1:08:24 PM] [SSL      ] › ℹ  info      Renewing SSL certs close to expiry...
[6/9/2023] [1:08:24 PM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[6/9/2023] [1:08:24 PM] [Global   ] › ℹ  info      Backend PID 157 listening on port 3000 ...
[6/9/2023] [1:08:24 PM] [Nginx    ] › ℹ  info      Reloading Nginx
[6/9/2023] [1:08:24 PM] [SSL      ] › ℹ  info      Renew Complete

Container inspect

No response

Anything else?

No response

jlesage commented 11 months ago

I think you opened this issue at the wrong place. The project for the container image you are using is there: https://github.com/NginxProxyManager/nginx-proxy-manager