Logrotate on nginx proxy manager is broken #877

Closed
opened 2026-02-04 22:00:07 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @theyo-tester on GitHub (Apr 29, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

Nginx Proxy Manager

📂 What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nginxproxymanager.sh)"

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian/Proxmox 8.1.4

📝 Provide a clear and concise description of the issue.

After months of running smoothly with default settings, the LXC container's npm suddenly stopped working properly. The Web UI showed "internal error" for any attempted changes.

Long story short, it turned out to be a storage issue. The default storage limit of 4GB was full due to oversized log folders.

The du command returned:

...
769M    /var
341M   /root
1.6G    /data
...
1.6G    /data/logs
...
399M    /var/log
...
1.1G /data/logs/proxy-host-8_access.log

Root cause:

checking the logrotate configuration /etc/logrotate.d/nginx-proxy-manager:

cat /etc/logrotate.d/nginx-proxy-manager

/data/logs/*_access.log /data/logs/*/access.log {
    su npm npm
    create 0644
    weekly
    rotate 4
    missingok
    notifempty
    compress
    sharedscripts
    postrotate
    /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
    endscript
}

/data/logs/*_error.log /data/logs/*/error.log {
    su npm npm
    create 0644
    weekly
    rotate 10
    missingok
    notifempty
    compress
    sharedscripts
    postrotate
    /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
    endscript

Please note that the user npm does not exist in the LXC. Instead nginx runs as root.

FIX:

I suggest changing /etc/logrotate.d/nginx-proxy-manager to this:

/data/logs/*_access.log /data/logs/*/access.log {
    create 0644 root root
    weekly
    rotate 4
    missingok
    notifempty
    compress
    maxsize 100M
    maxage 365
    dateext
    sharedscripts
    postrotate
    /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
    endscript
}

/data/logs/*_error.log /data/logs/*/error.log {
    create 0644 root root
    weekly
    rotate 10
    missingok
    notifempty
    compress
    maxsize 50M
    maxage 365
    dateext
    sharedscripts
    postrotate
    /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
    endscript
}

Then run logrotate -v -f /etc/logrotate.d/nginx-proxy-manager
Optional for testing, run first logrotate -d /etc/logrotate.d/nginx-proxy-manager, to see what will happen.

The final result:
23M /data/logs

🔄 Steps to reproduce the issue.

  1. Install Nginx Proxy Manager with the command bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nginxproxymanager.sh)" and use default settings.
  2. Test the configuration (dry run): logrotate -d /etc/logrotate.d/nginx-proxy-manager
  3. Alternatively, check the content of /etc/logrotate.d/nginx-proxy-manager.

Paste the full error output (if available).

logrotate -d /etc/logrotate.d/nginx-proxy-manager returns:

reading config file /etc/logrotate.d/nginx-proxy-manager
error: /etc/logrotate.d/nginx-proxy-manager:2 unknown user 'npm'
error: found error in /data/logs/*_access.log /data/logs/*/access.log , skipping
removing last 1 log configs
error: /etc/logrotate.d/nginx-proxy-manager:16 unknown user 'npm'
error: found error in /data/logs/*_error.log /data/logs/*/error.log , skipping
removing last 1 log configs
Reading state from file: /var/lib/logrotate/status
Allocating hash table for state file, size 64 entries
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state

🖼️ Additional context (optional).

No response

Originally created by @theyo-tester on GitHub (Apr 29, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? Nginx Proxy Manager ### 📂 What was the exact command used to execute the script? bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nginxproxymanager.sh)" ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian/Proxmox 8.1.4 ### 📝 Provide a clear and concise description of the issue. After months of running smoothly with default settings, the LXC container's npm suddenly stopped working properly. The Web UI showed "internal error" for any attempted changes. Long story short, it turned out to be a storage issue. The default storage limit of 4GB was full due to oversized log folders. The du command returned: ``` ... 769M /var 341M /root 1.6G /data ... 1.6G /data/logs ... 399M /var/log ... 1.1G /data/logs/proxy-host-8_access.log ``` ### Root cause: checking the logrotate configuration `/etc/logrotate.d/nginx-proxy-manager`: ``` cat /etc/logrotate.d/nginx-proxy-manager /data/logs/*_access.log /data/logs/*/access.log { su npm npm create 0644 weekly rotate 4 missingok notifempty compress sharedscripts postrotate /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true endscript } /data/logs/*_error.log /data/logs/*/error.log { su npm npm create 0644 weekly rotate 10 missingok notifempty compress sharedscripts postrotate /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true endscript ``` Please note that the **user npm does not exist in the LXC**. Instead nginx runs as root. ### FIX: I suggest changing `/etc/logrotate.d/nginx-proxy-manager` to this: ``` /data/logs/*_access.log /data/logs/*/access.log { create 0644 root root weekly rotate 4 missingok notifempty compress maxsize 100M maxage 365 dateext sharedscripts postrotate /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true endscript } /data/logs/*_error.log /data/logs/*/error.log { create 0644 root root weekly rotate 10 missingok notifempty compress maxsize 50M maxage 365 dateext sharedscripts postrotate /bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true endscript } ``` Then run `logrotate -v -f /etc/logrotate.d/nginx-proxy-manager` Optional for testing, run first `logrotate -d /etc/logrotate.d/nginx-proxy-manager`, to see what will happen. The final result: 23M /data/logs ### 🔄 Steps to reproduce the issue. 1. Install Nginx Proxy Manager with the command `bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/nginxproxymanager.sh)"` and use default settings. 2. Test the configuration (dry run): `logrotate -d /etc/logrotate.d/nginx-proxy-manager` 3. Alternatively, check the content of `/etc/logrotate.d/nginx-proxy-manager`. ### ❌ Paste the full error output (if available). `logrotate -d /etc/logrotate.d/nginx-proxy-manager` returns: ``` reading config file /etc/logrotate.d/nginx-proxy-manager error: /etc/logrotate.d/nginx-proxy-manager:2 unknown user 'npm' error: found error in /data/logs/*_access.log /data/logs/*/access.log , skipping removing last 1 log configs error: /etc/logrotate.d/nginx-proxy-manager:16 unknown user 'npm' error: found error in /data/logs/*_error.log /data/logs/*/error.log , skipping removing last 1 log configs Reading state from file: /var/lib/logrotate/status Allocating hash table for state file, size 64 entries Creating new state Creating new state Creating new state Creating new state Creating new state Creating new state Creating new state ``` ### 🖼️ Additional context (optional). _No response_
OVERLORD added the bug label 2026-02-04 22:00:07 +03:00
Author
Owner

@MickLesk commented on GitHub (Apr 29, 2025):

Not an Script Issue. Report this to NPM. Its an Build-In Addon and not from us.

By the way, idk if anyone updates npm anymore. Not an really respond since month in this project

@MickLesk commented on GitHub (Apr 29, 2025): Not an Script Issue. Report this to NPM. Its an Build-In Addon and not from us. By the way, idk if anyone updates npm anymore. Not an really respond since month in this project
Author
Owner

@theyo-tester commented on GitHub (Apr 29, 2025):

Thank you for the quick response. Where should I report it? Here https://github.com/NginxProxyManager/nginx-proxy-manager?

@theyo-tester commented on GitHub (Apr 29, 2025): Thank you for the quick response. Where should I report it? Here https://github.com/NginxProxyManager/nginx-proxy-manager?
Author
Owner

@tremor021 commented on GitHub (Apr 29, 2025):

correct

@tremor021 commented on GitHub (Apr 29, 2025): correct
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#877