Nginx: nginx: [error] invalid PID number "" in "/run/nginx.pid" (when running nginx -s reload)
Nginx can't signal the master process because the PID file is empty, stale or missing.
nginx: [error] invalid PID number "" in "/run/nginx.pid"nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)nginx: [error] open() "/var/run/nginx.pid" failedinvalid PID number in nginx.pidnginx: [alert] kill(1234, 1) failed (3: No such process) Meaning
Nginx isn't running (or crashed) while you try to reload/stop. Start it first (sudo systemctl start nginx), check the error log for why it died, and remove a stale/empty pid file. Make sure pid in nginx.conf matches the systemd unit's PIDFile.
Common causes
- Nginx not running / crashed
- Empty or stale pid file
pidpath mismatch between nginx.conf and systemd- Config error prevented start
- Permissions on /run
⚡ Quick fix
sudo systemctl start nginxand readjournalctl -u nginxsudo rm /run/nginx.pidif stale- Verify
pid /run/nginx.pid;consistency
Detailed fix by platform
Linux
systemctl status nginx --no-pager && sudo tail -20 /var/log/nginx/error.log
How to diagnose
- Running — master alive?
- PID — File content?
- Path — Same everywhere?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- AH00015: Unable to open logs Apache: AH00091: apache2: could not open error log file /var/log/apache2/error.log. AH00015: Unable to open logs (Permission denied)
- AH00072: make_sock: could not bind to address 0.0.0.0:80 Apache: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 / AH00015: Unable to open logs
- AH00112: DocumentRoot does not exist Apache: AH00112: Warning: DocumentRoot [/var/www/example.com/public_html] does not exist
Most viewed in Nginx / Apache
- nginx: [emerg] unknown directive Nginx: nginx: [emerg] unknown directive "x" in /etc/nginx/sites-enabled/x:12 — configuration file test failed
- upstream timed out Nginx: upstream timed out (110: Connection timed out) while reading response header from upstream
- AH00558 Apache: AH00558: apache2: Could not reliably determine the server's fully qualified domain name
Other ways to find it
Where this error sits
Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026