In my case the 500 error started after migration to new server. Everything was done as per the official guide. The server started fine, the repositories, comments, issues also showed fine. The problem – on clicking a repository it showed 500 error.
Checking the error logs (under /var/log/gitlab/) didn’t reveal the problem. The best way to check Gitlab logs is to use the command –
gitlab-ctl tail
Checking the logs with the above command revealed a permission issue in these folders
drwxr-sr-x 5 git git 4096 Jul 30 22:29 /mnt/repo_storage2/git-data/repositories/+gitaly drwxr-s--- 250 git git 4096 Jul 5 16:20 /mnt/repo_storage2/git-data/repositories/@hashed drwxr-sr-x 9 git git 4096 Jul 17 20:18 /mnt/repo_storage2/git-data/repositories/@pools
Don’t know why/how “git-redis” became the owner of the subfolders. Changing the owner to “git” solved the 500 error.