Why nginx .sock file failed everyday?

March 16, 2019 183 views
Nginx Ubuntu 18.04

I run a Nginx on Ubuntu 18.04 with Python and Flask..I follow this 2 tutorial.

1) How To Install Nginx on Ubuntu 18.04
2) How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 18.04

But everyday I check my application,the request always Server Internal Error 500. My application is new,just run for 3 days.But the server keep failed.This happen everyday.

After I run this command,it works again.

sudo systemctl restart myproject

But come on,I need to restart the server everyday??

Here is the result get when I check the /var/log/nginx/error.log.1

2019/03/13 14:47:47 [crit] 7277#7277: *1 connect() to unix:/var/www/html/myproject/myproject.sock failed (2: No such file or directory) while connecting to upstream, client: "someip", server: , request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:/var/www/html/myproject/myproject.sock:", host: "someip", referrer: "some_ip"

And at the same time the report when I login to putty is feel weird..

Here is the log when I login to Putty

It said usage of 8.8% and Memory usage 41%,I mean my application just 1 file and serve for only 3 days with few user for this moment,is this a normal situation?

This situation happen already 3 days..Everyday I need to key in the command to restart the server.Can somebody let me know?

Cause I dont want to end up get this ->> ** Networking Disabled** and this situation happened last time which make me need to set up the whole thing again.

1 Answer

Greetings!

It sounds like the service is stopping. Try this to see if you get any clear error output:

journalctl -u myproject.service

Jarland

Have another answer? Share your knowledge.