Permission Denied When Accessing Assets After Upgrading 5.4 To 6.0
Created by: terrywang
Followed the 5.4-to-6.0.md, upgraded from 5.4 to 6.0.
Problem
When accessing Gitlab, a broken login page was displayed, looks like images, css files were not correctly loaded.
NOTE: this was an instance upgraded from 4.0 (1 by 1 over time) to 6.0.
Cause
Checking Nginx log, found the following "Permission denied" error.
2013/08/23 13:52:19 [error] 31035#0: *1 open() "/home/git/gitlab/public/assets/login-logo-20fd89985ad8929292196a39fa51787c.png" failed (13: Permission denied), client: 10.191.131.75, server: devops.au.company.com, request: "GET /assets/login-logo-20fd89985ad8929292196a39fa51787c.png HTTP/1.1", host: "devops.au.company.com", referrer: "http://devops.au.company.com/users/sign_in"
2013/08/23 13:52:22 [error] 31035#0: *1 open() "/home/git/gitlab/public/assets/application-8d0430122c22e07faecdd974cd21a38b.css" failed (13: Permission denied), client: 10.191.131.75, server: devops.au.company.com, request: "GET /assets/application-8d0430122c22e07faecdd974cd21a38b.css HTTP/1.1", host: "devops.au.company.com", referrer: "http://devops.au.company.com/users/sign_in"
2013/08/23 13:52:22 [error] 31035#0: *10 open() "/home/git/gitlab/public/assets/application-7b88a88b92ad70a827dbedb75e5206b1.js" failed (13: Permission denied), client: 10.191.131.75, server: devops.au.company.com, request: "GET /assets/application-7b88a88b92ad70a827dbedb75e5206b1.js HTTP/1.1", host: "devops.au.company.com", referrer: "http://devops.au.company.com/users/sign_in"
Haven't had this issue before. Looking at the installation guide, adding Nginx user to git group is NOT explicitly mentioned, the install guide redirects to GitLab Recipes. That's why I missed the part.
Workaround
Add nginx user (in my case it is www-data
instead of nginx
) to git group usermod -a -G git www-data
and give groups on ~git
read/execute chmod g+rx /home/git
permissions, restart Nginx fixed the issue. I think this is worth being added to the Troubleshooting Guide Wiki because others can possibly run into the same ;-)
Update: added to the Troubleshooting Guide