I have my own Gitlab server where I have all the code I write. Today I was trying to check something fast in one of the source files on the server over the Web frontend for Gitlab and I couldn’t get file to show.
All I would get is following error message.
Interesting. I tried Web IDE editor and I would get the same thing, just the message loading Web IDE editor and nothing would happen.
Next obvious step was to check console in Developer tools in Chrome. What I found there was an interesting error.
The problem is net::ERR:SPDY_PROTOCOL_ERROR, and as Gitlab server is behind Nginx server which acts as reverse proxy for it, this error can only come from it. The next step was to check error logs on the Nginx server.
2018/12/10 11:51:34 [crit] 1582#1582: *81392 open() "/var/cache/nginx/proxy_temp/1/01/0000000011" failed (13: Permission denied) while reading upstream, client: 18.104.22.168, server: git.server.address, request: "GET /assets/webpack/pages.ide.0f5d4844.chunk.js HTTP/2.0", upstream: ...
So error is obviously permissions based, Nginx server is caching .js and .css content but it doesn’t have permissions to access cached content. Solution was simple, just allow nginx to access all of the content in that folder and VOILA, everything works as it should.
sudo chown -R nginx:nginx /var/cache/nginx/