[GH-ISSUE #1215] Bad Gateway error - Command failed: logrotate #988

Closed
opened 2026-02-26 06:35:20 +03:00 by kerem · 8 comments
Owner

Originally created by @rutvik-rathod on GitHub (Jul 4, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1215

I have installed the nginx proxy manager using the instructions

but when I try to login the localip:81
I get a promt as
BAD gateway

Originally created by @rutvik-rathod on GitHub (Jul 4, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1215 I have installed the nginx proxy manager using the instructions but when I try to login the localip:81 I get a promt as BAD gateway
kerem closed this issue 2026-02-26 06:35:20 +03:00
Author
Owner

@rutvik-rathod commented on GitHub (Jul 5, 2021):

badGatewarError

<!-- gh-comment-id:873861744 --> @rutvik-rathod commented on GitHub (Jul 5, 2021): ![badGatewarError](https://user-images.githubusercontent.com/60855001/124431344-dcd4e880-dd8d-11eb-81ad-52dfa787b7d1.JPG)
Author
Owner

@danner26 commented on GitHub (Jul 5, 2021):

Not sure if this is your issue but sometimes during startup the database is still loading/migrating which causes the frontend to report bad gateway. If you wait a few minutes it often works for me.

If that did not fix the issue, pull the logs and attach them here. If you are using docker you can use docker ps to find the container id. Then you can run docker logs --details CONTAINER_ID
Otherwise the logs reside in the normal place

<!-- gh-comment-id:874173404 --> @danner26 commented on GitHub (Jul 5, 2021): Not sure if this is your issue but sometimes during startup the database is still loading/migrating which causes the frontend to report bad gateway. If you wait a few minutes it often works for me. If that did not fix the issue, pull the logs and attach them here. If you are using docker you can use `docker ps` to find the container id. Then you can run `docker logs --details CONTAINER_ID` Otherwise the logs reside in the normal place
Author
Owner

@frisodubach commented on GitHub (Jul 6, 2021):

From what I've encountered, the bad gateway at login is usually from a database error. Either it's not configured correctly, or it simply doesn't work (which is common on ARM-based architecture). Doing what danner26 said will help find the exact issue though.

<!-- gh-comment-id:874824252 --> @frisodubach commented on GitHub (Jul 6, 2021): From what I've encountered, the bad gateway at login is usually from a database error. Either it's not configured correctly, or it simply doesn't work (which is common on ARM-based architecture). Doing what danner26 said will help find the exact issue though.
Author
Owner

@simuuh commented on GitHub (Jul 11, 2021):

yes, this message is annoying, but if you wait a few more minutes to log in, the error message will disappear.

<!-- gh-comment-id:877839014 --> @simuuh commented on GitHub (Jul 11, 2021): yes, this message is annoying, but if you wait a few more minutes to log in, the error message will disappear.
Author
Owner

@PlasmatikSteak commented on GitHub (Jul 22, 2021):

I get the "Bad Gateway" error as well. Only just got it after upgrading to version 2.9.5.
docker logs --details CONTAINER_ID gives the below result

 [7/22/2021] [5:58:25 AM] [Migrate  ] › ℹ  info      Current database version: 20210210154703
 [7/22/2021] [5:58:25 AM] [Setup    ] › ℹ  info      Logrotate Timer initialized
 [7/22/2021] [5:58:25 AM] [Global   ] › ✖  error     Command failed: logrotate /etc/logrotate.d/nginx-proxy-manager
 error: skipping "/data/logs/fallback_access.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
 error: skipping "/data/logs/fallback_error.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
<!-- gh-comment-id:884674924 --> @PlasmatikSteak commented on GitHub (Jul 22, 2021): I get the "Bad Gateway" error as well. Only just got it after upgrading to version 2.9.5. `docker logs --details CONTAINER_ID` gives the below result ``` [7/22/2021] [5:58:25 AM] [Migrate ] › ℹ info Current database version: 20210210154703 [7/22/2021] [5:58:25 AM] [Setup ] › ℹ info Logrotate Timer initialized [7/22/2021] [5:58:25 AM] [Global ] › ✖ error Command failed: logrotate /etc/logrotate.d/nginx-proxy-manager error: skipping "/data/logs/fallback_access.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation. error: skipping "/data/logs/fallback_error.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation. ```
Author
Owner

@EvanGrote commented on GitHub (Jul 24, 2021):

Also seeing the same error. Rolling back my docker container container to version 2.9.4 “resolved” the issue for me. Will follow this issue for a more permanent fix.

<!-- gh-comment-id:886123425 --> @EvanGrote commented on GitHub (Jul 24, 2021): Also seeing the same error. Rolling back my docker container container to version `2.9.4` “resolved” the issue for me. Will follow this issue for a more permanent fix.
Author
Owner

@mrneutron42 commented on GitHub (Jul 27, 2021):

I just tried to install nginx into a Ubuntu 20.04 VM, per the instructions, and got the same Bad Gateway message.

The instructions clearly need to be updated, because they do not produce a working nginx system, as published.

To fix, I followed the advice of drewbeer:
https://github.com/jc21/nginx-proxy-manager/issues/310#issuecomment-603552819
I manually added the config.json file, and the reference to that file in the docker-compose.yaml file.
Then, I manually deleted the 2 database folders that were created on the initial failed attempts, and ran:
sudo docker-compose down
sudo docker-compose up -d
(I found that without sudo there were permission errors.)

After doing all that, I was able to log into the nginx webpage and change the email address and password.
I have not taken the next steps and added web servers.

<!-- gh-comment-id:887700548 --> @mrneutron42 commented on GitHub (Jul 27, 2021): I just tried to install nginx into a Ubuntu 20.04 VM, per the instructions, and got the same Bad Gateway message. - https://docs.docker.com/engine/install/ubuntu/ (advises to install using the repository) - https://docs.docker.com/compose/install/ - Create a docker-compose.yml file - Bring up your stack - Log in to the Admin UI The instructions clearly need to be updated, because they do not produce a working nginx system, as published. To fix, I followed the advice of drewbeer: https://github.com/jc21/nginx-proxy-manager/issues/310#issuecomment-603552819 I manually added the config.json file, and the reference to that file in the docker-compose.yaml file. Then, I manually deleted the 2 database folders that were created on the initial failed attempts, and ran: sudo docker-compose down sudo docker-compose up -d (I found that without sudo there were permission errors.) After doing all that, I was able to log into the nginx webpage and change the email address and password. I have not taken the next steps and added web servers.
Author
Owner

@chaptergy commented on GitHub (Nov 5, 2021):

There used to be the issue with logrotate crashing npm but it has since been fixed. With the new suggested way of using SQLite, database errors will now also become much less likely.

<!-- gh-comment-id:961901229 --> @chaptergy commented on GitHub (Nov 5, 2021): There used to be the issue with logrotate crashing npm but it has since been fixed. With the new suggested way of using SQLite, database errors will now also become much less likely.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#988
No description provided.