500 when viewing members of group or project since 8.10
Summary
Since the update to 8.10, all our project and group member pages throw a 500 when opening them.
Steps to reproduce
Open the project or group members page. This was first noticed in 8.10.2, update to 8.10.3 didn't solve the problem. Installation is from source.
Expected behavior
The project or group members page shows up.
Relevant logs and/or screenshots
The following is logged in production.log:
Started GET "/foo/bar/project_members" for 212.12.32.97 at 2016-08-03 08:52:35 +0200
Processing by Projects::ProjectMembersController#index as HTML
Parameters: {"namespace_id"=>"foo", "project_id"=>"bar"}
Completed 500 Internal Server Error in 183ms (ActiveRecord: 13.7ms)
ActionView::Template::Error (undefined method `to_time' for nil:NilClass):
58: Requested
59: = time_ago_with_tooltip(member.requested_at)
60: - else
61: Joined #{time_ago_with_tooltip(member.created_at)}
62:
63: - else
64: = image_tag avatar_icon(member.invite_email, 40), class: "avatar s40", alt: ''
app/helpers/application_helper.rb:169:in `time_ago_with_tooltip'
app/views/shared/members/_member.html.haml:61:in `_app_views_shared_members__member_html_haml___1110946124008052009_69963047305480'
app/views/projects/project_members/_group_members.html.haml:12:in `_app_views_projects_project_members__group_members_html_haml__1799386550780807724_69963047344760'
app/views/projects/project_members/index.html.haml:21:in `_app_views_projects_project_members_index_html_haml___1771333089747164886_69963046302280'
lib/gitlab/middleware/go.rb:16:in `call'
Output of checks
Results of GitLab Application Check
Checking GitLab Shell ...
GitLab Shell version >= 3.2.1 ? ... OK (3.2.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
5/2 ... ok
lots and lots of oks
107/514 ... ok
123/515 ... ok
123/516 ... ok
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/.ssh/authorized_keys: OK
Send ping to redis server: gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ...
5/2 ... yes
.... lots and lots of yes
107/514 ... yes
123/515 ... yes
123/516 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.2)
Your git bin path is "/usr/local/bin/git"
Git version >= 2.7.3 ? ... yes (2.8.4)
Active users: 28
Checking GitLab ... Finished
Results of GitLab Environment Info
System information
System: Debian 7.11
Current User: git
Using RVM: no
Ruby Version: 2.1.2p95
Gem Version: 2.2.2
Bundler Version:1.7.4
Rake Version: 10.5.0
Sidekiq Version:4.1.4
GitLab information
Version: 8.10.3
Revision: 9d69315
Directory: /home/git/gitlab
DB Adapter: postgresql
URL: https://git.domain.de
HTTP Clone URL: https://git.domain.de/some-group/some-project.git
SSH Clone URL: git@git.domain.de:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 3.2.1
Repository storage paths:
- default: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/local/bin/git
Possible fixes
time_ago_with_tooltip()
in app/helpers/application_helper.rb
does not check if time if Nil. If time would be checked for Nil, the page would not throw a 500 and simply not print a proper time tooltip. As a quick fix, I replaced both to_time
calls with simple string in our installation.
Maybe a migration went wrong at some point in the past causing time being Nil here.