After machine reboot "unix:/socket/uwsgi.sock failed (13: Permission denied) while connecting to upstream"

1,121 views
Skip to first unread message

valerio orfano

unread,
Mar 21, 2017, 8:10:22 AM3/21/17
to Django users
Hi folks i have django 1.9 application integrated to nginx via uwsgi application on Centos7.
It was working fine, but then i had to reboot my machine. Now i am having the follwoing issue:  unix:/socket/uwsgi.sock failed (13: Permission denied) while connecting to upstream, client: 10.184.160.9, server: 10.184.2.231, request: "GET /", upstream: "uwsgi://unix:/socket/uwsgi.sock:"   Any clue?

My ini file:

[uwsgi]
chdir = /home/elastic/workspace/ES_Brevetti
wsgi-file = ES_Brevetti/wsgi.py
master = true
processes = 5
uid = nginx
gid = nginx
socket = /socket/uwsgi.sock
chmod-socket = 777
vacuum = true


nginx.conf

upstream django {
    server unix:/socket/uwsgi.sock; # for a file socket
    #server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
server {
    listen 80;
    server_name 10.184.2.231;
    error_log /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    charset utf-8;
   
    location /nuovopatentdb/static {
        alias /home/elastic/workspace/ES_Brevetti/static;
    }

    location / {
        include         /etc/nginx/uwsgi_params;
        uwsgi_pass      unix:/socket/uwsgi.sock;
    }
}


I dont know why i am having this issue?

Further mode should i be creating the cosk file anytime the machine is rebooted ?

Thanx valerio

valerio orfano

unread,
Mar 21, 2017, 8:16:18 AM3/21/17
to Django users
BTW i ve created the uwsgi.sock manually gave permission 777 and changes the owner from root to nginx:nginx

Jan Miszura

unread,
Mar 21, 2017, 9:21:29 AM3/21/17
to django...@googlegroups.com
I was having the same issue and it was solved with "sudo chmod 777 /socket". It's not necessary manually create uwsgi.sock.

Good luck!
Jan

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/46361aa4-4cff-4e03-9e5b-2f166ceb12b4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Jan Miszura

valerio orfano

unread,
Mar 21, 2017, 10:26:55 AM3/21/17
to Django users
Hi and thanx for ur reply.

The solution is "sudo setenforce Permissive "

thanx and regards
Jan

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.



--
Jan Miszura

Reply all
Reply to author
Forward
0 new messages