500 Errors when loading pages when Project#last_activity_at is `nil`
Due to 44affff3, some users are experiencing 500 Errors when loading their dashboards when last_activity_at
is nil
:
ActionView::Template::Error (Object must be a Date, DateTime or Time object. nil given.):
7: - show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && project.commit
8: - css_class += " no-description" if project.description.blank? && !show_last_commit_as_description
9: - cache_key = project_list_cache_key(project)
10: - updated_tooltip = time_ago_with_tooltip(project.last_activity_at)
11:
12: %li.project-row{ class: css_class }
13: = cache(cache_key) do
app/helpers/application_helper.rb:170:in `time_ago_with_tooltip'
app/views/shared/projects/_project.html.haml:10:in `_app_views_shared_projects__project_html_haml___767427546827425347_70226038998540'
app/views/shared/projects/_list.html.haml:17:in `block in _app_views_shared_projects__list_html_haml__4468437915611130289_70226035124740'
app/views/shared/projects/_list.html.haml:15:in `_app_views_shared_projects__list_html_haml__4468437915611130289_70226035124740'
app/views/groups/_projects.html.haml:1:in `_app_views_groups__projects_html_haml___1357245338872153186_70226034329780'
app/views/groups/show.html.haml:19:in `_app_views_groups_show_html_haml___2535675029967850497_70225990102640'
app/controllers/groups_controller.rb:50:in `show'
lib/gitlab/i18n.rb:39:in `with_locale'
lib/gitlab/i18n.rb:45:in `with_user_locale'
app/controllers/application_controller.rb:303:in `set_locale'
lib/gitlab/performance_bar/peek_performance_bar_with_rack_body.rb:16:in `call'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
lib/gitlab/middleware/go.rb:16:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/request_context.rb:18:in `call'
For the customer's instance:
irb(main):004:0> Project.where(updated_at: nil).count
=> 0
irb(main):005:0> Project.where(last_activity_at: nil).count
=> 36
ZD: https://gitlab.zendesk.com/agent/tickets/79195
/cc: @rdavila
Edited by Stan Hu