Error 500 when accessing Gitlab browser interface

2.2k views Asked by At

I'm running an instance of Gitlab Omnibus CE, version 8.15.2, on CentOS 7.3.1611. Upgrading from the 8.14 release family didn't go quite according to plan; since doing that, I've been unable to access the Gitlab browser interface.

When I try to access the browser interface, I can access the login screen and log in, but after I'm logged in, going to any page results in an Error 500: Whoops, something went wrong on our end.

So I used gitlab-ctl tail to grab some log data for what's happening, and it looks like it's a problem with Postgresql's data for one of my projects:

http://pastebin.com/VDMk0eKr

But I'm not sure how I should fix this. Any ideas?

2

There are 2 answers

1
that_roy On

I had the same issue and the above didn't work so I ran the following command to downgrade.

To check the current version istalled:

sudo dpkg -l | grep gitlab-ce

To see which versions were available:

sudo apt-cache madison gitlab-ce | less

and the following to "downgrade", since I was at 9.2.0-rc2.ce.0 shown by the above command:

sudo apt-get install gitlab-ce=9.2.0-rc1.ce.0
1
Piotr Dawidiuk On

It's known issue that's been fixed with newest release 8.15.3. If you don't want to upgrade GitLab, there is an existing workaround (Edit: as mentioned in comment, the workaround does not always work so consider upgrade primary)

File: /opt/gitlab/embedded/service/gitlab-rails/app/models/concerns/has_status.rb

Replace

builds = scope.select('count(*)').to_sql
created = scope.created.select('count(*)').to_sql
success = scope.success.select('count(*)').to_sql
pending = scope.pending.select('count(*)').to_sql
running = scope.running.select('count(*)').to_sql
skipped = scope.skipped.select('count(*)').to_sql
canceled = scope.canceled.select('count(*)').to_sql

with

builds = scope.select('count(*)').reorder(nil).to_sql
created = scope.created.select('count(*)').reorder(nil).to_sql
success = scope.success.select('count(*)').reorder(nil).to_sql
pending = scope.pending.select('count(*)').reorder(nil).to_sql
running = scope.running.select('count(*)').reorder(nil).to_sql
skipped = scope.skipped.select('count(*)').reorder(nil).to_sql
canceled = scope.canceled.select('count(*)').reorder(nil).to_sql

And restart GitLab.