close

[Solved] nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument Error Occurs?

Today I get the following error nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument in python.

How To Solve nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument Error ?

  1. How To Solve nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument Error ?

    To Solve nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument Error Then check if you still see that nginx.pid error and also if nginx is actually running and if you can connect to port 80 on your server.

  2. nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument

    To Solve nginx.service: Failed to read PID from file /run/nginx.pid: Invalid argument Error Then check if you still see that nginx.pid error and also if nginx is actually running and if you can connect to port 80 on your server.

Solution 1

That warning with the nginx.pid file is a know bug (at least for Ubutnu if not for other distros as well).

Workaround (on a ssh console, as root, use the commands bellow):

mkdir /etc/systemd/system/nginx.service.d
printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf
systemctl daemon-reload
systemctl restart nginx 

Then check if you still see that nginx.pid error and also if nginx is actually running and if you can connect to port 80 on your server.

I would also check if this actually exists and the permissions on it:

/run/uwsgi/mysite3.sock

If nginx is running and uWSGI is running as well then I guess it’s a configuration problem

I understand you want to use Django so I would recommend to review your actual configuration

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read