*30 connect() to unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket failed (13: Permission denied)
Closed
*30 connect() to unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket failed (13: Permission denied)
Created by: minhvn
I get 502 BAD gateway and view log below(cat /var/log/nginx/gitlab_error.log): 2013/02/04 11:08:45 [crit] 21566#0: *30 connect() to unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket failed (13: Permission denied) while connecting to upstream, client: 192.168.20.37
Please help me :)
Created by: minhvn
Yes, Below is permission : [root@git ~]# ls -lai /home/gitlab/gitlab/tmp/sockets/ total 8 802975 drwxrwxr-x. 2 gitlab gitlab 4096 Feb 4 09:34 . 801862 drwxr-xr-x. 6 gitlab gitlab 4096 Feb 4 09:31 .. 802980 srwxrwxrwx. 1 gitlab gitlab 0 Feb 4 09:34 gitlab.socket [root@git ~]#
By Administrator on 2013-02-04T05:27:57 (imported from GitLab project)
Created by: minhvn
2013/02/04 20:28:57 [crit] 21566#0: *84 stat() "/home/gitlab/gitlab/public/" failed (13: Permission denied), client: 192.168.20.37, server: myserver, request: "GET / HTTP/1.1", host: "myserver" 2013/02/04 20:28:57 [crit] 21566#0: *84 stat() "/home/gitlab/gitlab/public//index.html" failed (13: Permission denied), client: 192.168.20.37, server: myserver, request: "GET / HTTP/1.1", host: "myserver" 2013/02/04 20:28:57 [crit] 21566#0: *84 stat() "/home/gitlab/gitlab/public/.html" failed (13: Permission denied), client: 192.168.20.37, server: myserver, request: "GET / HTTP/1.1", host: "myserver" 2013/02/04 20:28:57 [crit] 21566#0: *84 connect() to unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket failed (13: Permission denied) while connecting to upstream, client: 192.168.20.37, server: myserver, request: "GET / HTTP/1.1", upstream: "http://unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket:/", host: "myserver" 2013/02/04 20:29:32 [crit] 21566#0: *84 stat() "/home/gitlab/gitlab/public/" failed (13: Permission denied), client: 192.168.20.37, server: myserver, request: "GET / HTTP/1.1", host: "myserver" 2013/02/04 20:29:32 [crit] 21566#0: *84 stat() "/home/gitlab/gitlab/public//index.html" failed (13: Permission denied), client: 192.168.20.37, server: myserver, request: "GET / HTTP/1.1", host: "myserver" 2013/02/04 20:29:32 [crit] 21566#0: *84 stat() "/home/gitlab/gitlab/public/.html" failed (13: Permission denied), client: 192.168.20.37, server: myserver, request: "GET / HTTP/1.1", host: "myserver" 2013/02/04 20:29:32 [crit] 21566#0: *84 connect() to unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket failed (13: Permission denied) while connecting to upstream, client: 192.168.20.37, server: myserver, request: "GET / HTTP/1.1", upstream: "http://unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket:/", host: "myserver"
Help me please :)
By Administrator on 2013-02-04T23:29:52 (imported from GitLab project)
Created by: koenpunt
You should head over to the Support Forum for questions regarding setup/configuration.
By Administrator on 2013-02-04T14:46:23 (imported from GitLab project)
Created by: scalp42
Just make sure to understand the implication of having
nginx
run under thegitlab
user (http://en.wikipedia.org/wiki/Principle_of_least_privilege)By Administrator on 2013-02-06T17:42:20 (imported from GitLab project)
Created by: robgjansen
I had this same problem: file and directory permissions were fine but nginx was reporting the following when I tried to connect via the web browser:
502 Bad Gateway
Tailing the nginx gitlab error log (
tail -f /var/log/nginx/gitlab_error.log
) gives the following:2013/08/23 14:32:13 [crit] 32627#0: *11 stat() "/home/gitlab/gitlab/public/" failed (13: Permission denied), client: [scrubbed], server: [scrubbed], request: "GET / HTTP/1.1", host: "[scrubbed]" 2013/08/23 14:32:13 [crit] 32627#0: *11 stat() "/home/gitlab/gitlab/public//index.html" failed (13: Permission denied), client: [scrubbed], server: [scrubbed], request: "GET / HTTP/1.1", host: "[scrubbed]" 2013/08/23 14:32:13 [crit] 32627#0: *11 stat() "/home/gitlab/gitlab/public/.html" failed (13: Permission denied), client: [scrubbed], server: [scrubbed], request: "GET / HTTP/1.1", host: "[scrubbed]" 2013/08/23 14:32:13 [crit] 32627#0: *11 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: [scrubbed], server: [scrubbed], request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "[scrubbed]" 2013/08/23 14:32:13 [crit] 32627#0: *11 stat() "/home/gitlab/gitlab/public/favicon.ico" failed (13: Permission denied), client: [scrubbed], server: [scrubbed], request: "GET /favicon.ico HTTP/1.1", host: "[scrubbed]" 2013/08/23 14:32:13 [crit] 32627#0: *11 stat() "/home/gitlab/gitlab/public/favicon.ico/index.html" failed (13: Permission denied), client: [scrubbed], server: [scrubbed], request: "GET /favicon.ico HTTP/1.1", host: "[scrubbed]" 2013/08/23 14:32:13 [crit] 32627#0: *11 stat() "/home/gitlab/gitlab/public/favicon.ico.html" failed (13: Permission denied), client: [scrubbed], server: [scrubbed], request: "GET /favicon.ico HTTP/1.1", host: "[scrubbed]" 2013/08/23 14:32:13 [crit] 32627#0: *11 connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream, client: [scrubbed], server: [scrubbed], request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "[scrubbed]"
Turns out this was an SELinux issue. Some rules must have gotten nuked on an SELinux update.
You could do this:
# setenforce Permissive
But I prefer to do this:
# setsebool -P httpd_enable_homedirs 1 # setsebool -P httpd_read_user_content 1 # setsebool -P httpd_can_network_connect 1
And it works. Note that the correct solution here is probably to relabel the files in
/home/gitlab/gitlab
, and set a policy so they get labeled correctly in future updates, but I didn't pursue that route (UPDATE: this guy did).Helpful link: http://wiki.centos.org/HowTos/SELinux
By Administrator on 2014-04-11T15:42:27 (imported from GitLab project)
Created by: idevit
Be sure to verify your nginx vhost.. If you read unicorn config you see a port 8080. So be sure nothing else runs on 8080, if not change it.
Then modify /etc/nginx/sites-available/gitlab with your favorite text editor
Then set the proxy_pass to where gitlab_shell is actually running: proxy_pass http://localhost:8080;
Its in the last line..
By Administrator on 2013-12-29T21:51:21 (imported from GitLab project)
Created by: datBoiMoudi
I also figured out that this error occurred after an CentOS 6.6 update. By setting SELinux to Permissive with
setenforce 0
does the trick for now but it would be great if anyone could figure out what specific SELinux settings have to be adjusted so that SELinux isn't disabled for the whole systemBy Administrator on 2014-11-12T06:59:50 (imported from GitLab project)
Created by: robgjansen
@Tobi555666 I take it you didn't try the settings I suggested in my post above, i.e.:
# setsebool -P httpd_enable_homedirs 1 # setsebool -P httpd_read_user_content 1 # setsebool -P httpd_can_network_connect 1
By Administrator on 2014-11-15T12:38:43 (imported from GitLab project)
Created by: veegee
I am using the system's nginx instead of the one included in the omnibus distribution.
Do
usermod -aG gitlab-www www-data
to solve the issue. You may need to do it every time you restart nginx or gitlab via gitlab-ctl. I haven't bothered to figure out exactly why, but this fixes it, assuming nginx is running with the userwww-data
.By Administrator on 2015-01-11T01:18:04 (imported from GitLab project)