mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #3237] [Solved?] After update from 2.9.19 to 2.10.4, "Bad gateway" on local port 81 login screen, but sites keep functioning #2185
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#2185
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Moonbase59 on GitHub (Oct 4, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3237
Checklist
jc21/nginx-proxy-manager:latestdocker image?Describe the bug
I’m not much into docker yet but I succeeded to install NPM 2.9.19 a few months ago and now realized I must make manual updates. So I logged into my Proxmox LXC container and did a
docker-compose pull, which apparently brought me to v2.10.4 (shown on port 81 local login screen).But now on every login attempt, I get a little red "Bad gateway" shown on the login screen and cannot administer my hosts anymore! For the time being, I reverted to my full LXC backup and went back to 2.9.19, which works fine.
docker psshows I’m runningjc21/mariadb-aria:latestandjc21/nginx-proxy-manager:latest.I don’t know how to diagnose this, or where the logs are kept, help urgently needed.
Nginx Proxy Manager Version
2.10.4
To Reproduce
Steps to reproduce the behavior:
ssh.docker-compose pull,docker-compose down,docker-compose up -dExpected behavior
Local admin login working.
Screenshots
Operating System
Proxmox 7.4, unprivileged Ubuntu 22.04.3 LTS LXC
Additional context
Commands used to update:
Docker version:
docker psoutput:docker-compose.ymldocker-compose.override.yml@Moonbase59 commented on GitHub (Oct 4, 2023):
I found I can do a
docker-compose logs app, which shows a lot of migration errors. Hope this helps:2023-10-04 npm-log.log
@Moonbase59 commented on GitHub (Oct 4, 2023):
Ah, I think I managed! I read in some other issue that due to ownership problems the MariaDB and NPM persistent volumes must be separate, so I moved my
mysqlfolder out of thedatafolder into a separate folder.Before
After
These were the steps I did in the console:
Edit
docker-compose.yml(change db persistent volume)Continue in console
Result
I can now log in again using the local address and port 81. No "Bad Gateway" anymore.
The
docker-compose logsshows no errors anymore:I leave this open for others to find (for now) and kindly ask the developers or someone more knowledgeable to confirm that what I did is correct.
After all, NPM is a critical part of the infrastructure and needs to be secure and updatable.
Thanks for giving us this great piece of software!
@conichonhaa commented on GitHub (Oct 4, 2023):
Thanks a lot for sharing. It worked for me
🙏
@not1q84-1 commented on GitHub (Nov 3, 2023):
I was looking for a fix for month - this worked like a charm. Thank you so much...
@sleepystrigiformes commented on GitHub (Nov 5, 2023):
thanks,it is really help me.
@adamphetamine commented on GitHub (Dec 6, 2023):
confirm the fix worked for me- moving the db folder up one level
@not1q84-1 commented on GitHub (Dec 7, 2023):
I would assume that if the sqlite db file is located in the /data folder move it one up so mv xxx.slq ../
@boostedgti916 commented on GitHub (Dec 12, 2023):
Thank you! This fixed it for me been running 2.9.19 forever.
@caioolivv commented on GitHub (Dec 21, 2023):
Doesn't work
@psychogun commented on GitHub (Dec 25, 2023):
How to address this if one is using database.sqlite?
@adrianvg commented on GitHub (Jan 19, 2024):
Same here. Just upgraded npm to 2.11.0 from 2.10.4 and got hit by the Bad gateway-message - again.
Luckily I had a snapshot of the vm running portainer and npm.
Also, moving database.sqlite up a level from data/ gives me a "no user related content" or some such at the login screen.
Checking the logs after starting up npm 2.11.0, the log output stops after [Migrate ].
With npm 2.10.4 it continues with logrotate, ssl renewals etc.
@Spillebulle commented on GitHub (Jan 19, 2024):
Same here with sqlite
@SX2-NAME commented on GitHub (Jan 19, 2024):
Если удалить полностью файлик database.sqlite тогда создается новая учетная запись и все работает. Если потом перезатереть опять не работает. Проблема в том, что после обновления не читает database.sqlite Как выйти с этой ситуации?
@KvizadSaderah commented on GitHub (Jan 19, 2024):
well, i can see in newer versions that mysql folder is outside data by default, but still facing that same issue
@SX2-NAME commented on GitHub (Jan 19, 2024):
У меня SQLite а не MySQL!!!
Путь менять не нужно. Проблем в том что если создать новый database.sqlite все работает. А вот старый нет.
@adrianvg commented on GitHub (Jan 19, 2024):
Translation to english:
"I have SQLite and not MySQL!!!
There is no need to change the path. The problem is that if you create a new database.sqlite everything works. But the old one doesn't."
If I delete and recreate the sqlite-db, won't I lose all my sites and ssl-certificates?
@adrianvg commented on GitHub (Jan 19, 2024):
Could you please write in English?
@SX2-NAME commented on GitHub (Jan 19, 2024):
When creating a new database, existing sites remain! But it is impossible to control them! You need to understand why after the update proxy-manager does not see the database. I hope the developers will fix this. So far I had to roll back from 2.11.0 to 2.10.4
@lowfoon commented on GitHub (Jan 19, 2024):
I think I was able to replicate this on 2.11.0 by letting the login timeout, clicking around the UI, then browser refresh. At the point, when you go to login again, it will give you a
bad gatewayerror.Note: My setup consists of the
database.sqlitefile@taffit commented on GitHub (Jan 19, 2024):
This! This really is the only way to make it running again if you are using SQLite like me. Use the image
jc21/nginx-proxy-manager:2.10.4, until the developers get it to work again with a newer version.@Spillebulle commented on GitHub (Jan 19, 2024):
I had to remove the "NODE" env but else than that, rolling back to 2.10.4 worked for me too
@baroumas commented on GitHub (Jan 19, 2024):
Thank you! I had the same problem until I rolled back to 2.10.4
I've created a new fresh container on the latest version, and then restored table by table from my existing SQLite DB, restarting the container for each. It worked until the table "certificate" was restored, then it stopped working and the container log stopped after:
Then I started another new container and added a hosts by hand, restarted container, and it was working. Requested a certificate (which worked), restarted, and it stopped working with the same logs as above.
@iron-cc commented on GitHub (Jan 20, 2024):
Same here, broke after this update. Rolling back to 2.10.4 fixed the issue for now.
@jhabers commented on GitHub (Jan 20, 2024):
if you copy the old DB over the the new NGINX it will work. Just dont change any settings until its fixed
@SX2-NAME commented on GitHub (Jan 20, 2024):
I tried to do this. It didn't work for me! Rolled back.
@saiful7 commented on GitHub (Jan 21, 2024):
I had the same issue with SQLite and made it work again by rolling back to 2.10.4. Thank you.
@angeloschat commented on GitHub (Jan 21, 2024):
Same issue here. Had to roll back to 2.10.4. Also removed NODE_OPTIONS --openssl-legacy-provider
from ENV otherwise backend did not start
@RodBelaFarin commented on GitHub (Jan 21, 2024):
This way I lost all my data. I can login with default admin@example.com only.
Interesting enough my sites are still working?! Would it be possible to transfer the data to new user account?
@TollhouseC commented on GitHub (Jan 21, 2024):
Experiencing the same issue, attempted a bunch of fixes but nothing worked. Also in the reverted back to 2.10.4 camp till a patch is released, it works fine with that so just gonna chill there. Appreciate all you do jc21+contributors
@technikamateur commented on GitHub (Jan 21, 2024):
I'm getting the same 502 with sqlite. Can be reproduced very easily. Just set up a fresh container, as explained in Quick Start. Afterwards stop and re run the container... and you're getting 502.
@LoScienzo commented on GitHub (Feb 10, 2024):
I have the same issue (on SQLite) trying to go from 2.10.4 to 2.11.0 or 2.11.1. My instance was originally spun up on 2.9.19 and I was able to incrementally update up to 2.10.4 with no issue.
Also we should maybe remove the "[Solved?]" from the title.
@adrianvg commented on GitHub (Feb 12, 2024):
Thanks @jc21!
NPM release 2.11.1 solved the bad gateway issue for me.
For posterity, I use this docker-compose.yml, with sqlite as the database:
And this is my upgrade-script:
@T0ddz commented on GitHub (Mar 8, 2024):
I got the same problem and I solved this by executing
chmod 777 database.sqlite@deenius commented on GitHub (Mar 11, 2024):
I'm getting the same error.
If I look in the log file (database), I see this:
@JIeJaitt commented on GitHub (Apr 7, 2024):
For the same problem, the best way is to directly deploy version 2.9.19 instead of trying to solve the problem yourself, because it is more time-consuming, unless you plan to spend the extra time solving this problem. The following is my docker orchestration Documents, for reference only:
Remember that the server panel releases the port required by the service on the left, One more thing, version 2.9.19 has the problem of Internal Error when applying for a certificate. If you encounter this problem, it is recommended to go back to 2.9.18.
@iamhasantan commented on GitHub (Apr 11, 2024):
I have this issue with 2.9.18 pulled today, its fine on the first start up, but any subsequent restarts of the container have the bad gateway error (using sql lite db)
@JVKeller commented on GitHub (Jun 24, 2024):
I tried all the fixes here after updating to 2.11.2. Ended up reverting everything and just needed a reboot, instead of just restarting services, after updating.
Also, be sure your other config files are compliant with the updated nginx.
BEFORE you update, Change: (/data/nginx/proxy_host/*)
to:
@claytonjr commented on GitHub (Jul 13, 2024):
This solution worked for me, just downgrade.
@zxy95 commented on GitHub (Jul 15, 2024):
I solved this problem with this way:
Change the permissions of the generated ssl certificate to 777, and restart the container. The specific file path is: /etc/letsencrypt/archive/npm-12/*
How I found it:
When I runned both version 2.10 and 2.11 on a newly created clean host, they worked fine at first, but the issue occurred a few days later. During this time, I just only generated ssl certificates, so I checked the ssl files, found that the permissions of /etc/letsencrypt/archive/npm-12/* was different from the /etc/letsencrypt/live/npm-12/ (which are all linked to ../archive/..), so I changed them, and the problem fixed.
@PeterKse commented on GitHub (Jul 18, 2024):
Encountered this today:
In the docker compose, I exposed a port in the db container:
Connected to the db, using pw in the compose:
modified the db:
exited mysql:
EXIT;Removed the exposed port in db, restarted the containers.
admin@example.com:changeme worked without Bad Gateway
@technikamateur commented on GitHub (Jul 22, 2024):
That's exactly the problem since 2.10. I am still hoping that someone fixes the problem with sqlite.
@MarkRotNF commented on GitHub (Sep 8, 2024):
I also had the gateway error.
docker psshowed that " nginxproxymanager-db-1" (jc21/mariadb-aria:latest) ist "restarting" (in loop).docker-compose up(without -d) returned:I was able to fix it with the following:

cd to the mysql folder (should be the path thats in the docker-compose.yaml "db:" -> "volumes:". E.g. "./mysql" as in my case.
docker-compose downsudo mv aria_log. XXXXXXXXX bak.aria_log.XXXXXXXXXdocker-compose up -d(similar to described here: https://serverfault.com/questions/893626/mysql-wont-start-mysqld-got-signal-11)
(I'm not sure if this was due to insufficient free storage space. Mine was almost full.)
@frame45 commented on GitHub (Sep 12, 2024):
For me on v2.11.3 this fix worked. Thank you @Moonbase59 for the excellent research.
@qiulang commented on GitHub (Nov 19, 2024):
After reading all the comments, I still do not know how to fix that.
chmod 777 database.sqlitedoes not work for me.@canob commented on GitHub (Nov 19, 2024):
For me, downgrade to 2.10.4 worked, using SQLite.
@qiulang commented on GitHub (Nov 20, 2024):
Running on my local machine is fine. This happens when I deploy it on the cloud.
@HassenH1 commented on GitHub (Dec 23, 2024):
It took me about 30 min to kind of figure out what happened. EarIier, I had removed
version: '3.8'from my docker compose file then i started getting the same error. Once i put it back in then ran docker compose down and docker compose -d.@AntonBronnfjell commented on GitHub (Jan 18, 2025):
Just to confirm at version 2.11.2 the solution of @Moonbase59 works.
@billyp1970 commented on GitHub (Feb 9, 2025):
I may be a little late to the party here, but I had the same issue and here is what worked for me. In the database, migrations_lock was locked. I found in another post (sorry I didn't get the link) it said to remove said locks...mine started working as soon as I deleted those enteries.
Edit: I found the site, link provided:
https://github.com/knex/knex/issues/1217
@XxJooO commented on GitHub (Mar 3, 2025):
Folks,
I've recently updated from 2.9.19 to 2.12.2 and after several weeks of correct working I tried to login to do some changes and get the BAD GATEWAY...
Now I am on 2.12.3, and it still does not work. I tried some of the mentioned things above - nothing worked for me. And bad enough the thing @Moonbase59 mentioned does not work for me because my structure is totally different.
Is it still not fixed? Can I do something other to solve it?
@GEFNENEN commented on GitHub (Mar 11, 2025):
+1
@Tomblarom commented on GitHub (Mar 30, 2025):
I'm on
v2.12.3and thisBad Gatewaylogin issue suddenly happend to me. It was very random! This worked for me:Lets see for how long...
@Ranger21 commented on GitHub (Apr 29, 2025):
Doesn't work for me on v2.12.3
@orca9420 commented on GitHub (May 18, 2025):
Hi, everyone, I have tried various versions of the image, reinstalled and redeployed multiple times, changed the MySQL directory, but nothing worked. In the end, there was no other solution. I recommend everyone use this image; it won't have this problem.
https://hub.docker.com/r/zoeyvid/npmplus
@nicko88 commented on GitHub (Oct 10, 2025):
I just got this issue with npmplus today and I have no idea what to do...