Tracking the error “Error 500. We’re sorry but something went wrong” on gitlab

To track the source of the error, you need to check production.log.

On my Omnibus edition, it was located at /var/log/gitlab/gitlab-rails/production.log.

# find / -iname 'production.log'

Then read the log to find the recent error:
# tac /var/log/gitlab/gitlab-rails/production.log | less

My error was:

  app/controllers/sessions_controller.rb:25:in `new'
    21:                 Login to manage your projects
    20:               %p
    18:                A collection of open source projects
    17:               %h3
    15:               Droidzone Opensource project repository
ActionView::Template::Error (Inconsistent indentation: 15 spaces used for indentation, but the rest of the document was indented using 2 spaces.):
Completed 500 Internal Server Error in 353ms

Fixing it was easy. I just needed a restore a copy of the original file.
Restart gitlab after fixing the error:

# gitlab-ctl restart

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.