Connect to unix:/opt/indico/web/uwsgi.sock failed (13: Permission denied)

Dear Developers,

after a tidy installation where every step just performed clean and smooth, I have the “502 Bad Gateway” error when pointing to my URL. The only error in log files I was able to find is

2022/01/20 10:02:47 [crit] 24129#24129: *1 connect() to unix:/opt/indico/web/uwsgi.sock failed (13: Permission denied) while connecting to upstream, client: my.ip , server: my.fqdn, request: “GET / HTTP/2.0”, upstream: “uwsgi://unix:/opt/indico/web/uwsgi.sock:”, host: “my.fqdn”

as logged in /opt/indico/log/nginx/error.log

I checked every step, in particular those related to the setting of the users and related permissions; I was not able to spot any error, nor to have any other significant message.

Can you point me to some smart directions to explore to fix the problem?

Thank you

Could it be SELinux-related (if your system uses SELinux)?

Otherwise, check the permissions of /opt/indico/web/uwsgi.sock and everything in the path:

ls -ld /opt /opt/indico /opt/indico/web /opt/indico/web/uwsgi.sock 

And also check the user that runs nginx (ps aux | grep nginx), and see if that user (or its group) has the necessary permissions to access the uwsgi socket.

Thank you ThiefMaster, you’ve led me to the point!
The /opt/indico directory had 700 access rights, so nginx could not access the socket.
Quite embarassing for me not to spot it by myself. I don’t even know how it could have happen, I’ll recheck the installation procedure.
Thanks a lot!

chmod 710 /opt/indico should fix it :wink:

It did! Thanks again :smiley: