200 connect() to unix:/tmp/uwsgi.sock failed

7.1k views Asked by At

I am configuring nginx with uwsgi on EC2, I have check logs in file /var/log/nginx/error.log.

I am getting this error:

200 connect() to unix:/tmp/uwsgi.sock failed (2: No such file or directory) while connecting to upstream

My uwsgi.sock location is /var/www/myapp/

How can I change the file location from uwsgi://unix:/tmp/uwsgi.sock to uwsgi://unix:/var/www/myapp/ in configuartion?

2

There are 2 answers

0
openrijal On BEST ANSWER

This might be a problem with classical namespaced Temp, please see this: http://fedoraproject.org/wiki/Features/ServicesPrivateTmp

but you mentioned that you have set your sock location to your app directory, have you done it in your nginx configuration for that virtual host? you will definitely need to restart your web server for that changes to take affect.

Please refer this question and its answer, which might be useful in this case. Got 'No such file or directory' error while configuring nginx and uwsgi

Please refer to the section where in nginx.conf file, uwsgi_pass is mentioned. if you have not made changes like that, please do so and restart the webserver. I think that must solve the problem.

1
cnst On

You have not responded to my comment yet:

What is the full error_log from nginx? Does it mention any sort of duplicates of anything? ;) – cnst Jun 28 at 18:54

The reason I'm asking is that the default configuration on Debian, with the sites-available/ and sites-enabled/ directories, has an include that does not ignore strategically-placed backup files (like those ending in ~).

I once wasted a good amount of time trying to "quickly" do some PoC, only being puzzled why things didn't work which I know 100% should totally work, and why does my error_log report some mysterious bind(2) issues:

23:46:38 [emerg] 25509#0: bind() to [::]:80 failed (98: Address already in use)