500 error after upgrade to 9 gitlab-ce omnibus install

Passed upgrade I am getting error on dashboard, project pages for particular users.

the error states

Read fragment views/namespaces/25-20160531155254866740000/projects/111-20170123231440157145000/projects/index/application_settings/1-20170102085551051166000/v2.3/11c9265e4d55673ccda1830ad08db0e9 (0.2ms)
Completed 500 Internal Server Error in 653ms (ActiveRecord: 33.7ms)

ActionView::Template::Error (Failed to inflate loose object.):
35: - if use_creator_avatar
36: = image_tag avatar_icon(project.creator.email, 40), class: “avatar s40”, alt:’’
37: - else
38: = project_icon(project, alt: ‘’, class: ‘avatar project-avatar s40’)
39: %span.project-full-name
40: %span.namespace-name
41: - if project.namespace && !skip_namespace
lib/gitlab/git/repository.rb:64:in target' lib/gitlab/git/repository.rb:64:in block in branches’
lib/gitlab/metrics/instrumentation.rb:156:in each' lib/gitlab/metrics/instrumentation.rb:156:in block in each’

thanks

Hello,
I had the same problem and found how to solve it.
One of my LDAP users, after login, got greeted with an HTTP 500.
A restart of gitlab followed by a root login via the GUI allowed root in, after the user tried to login again also root would get a HTTP 500.

This is on gitlab-ce ombinus 9.0.5, latest package for debian as of now.

When I run
# gitlab-rake gitlab:check

it told me that one of the git repos was corrupted (!!!).
A check confirmed the finding:

radicale.git # git fsck
Checking object directories: 100% (256/256), done.
error: object file objects/ca/17dc2c183546ba2550d96a2ce10ec02dc29c8b is empty
error: object file objects/ca/17dc2c183546ba2550d96a2ce10ec02dc29c8b is empty
fatal: loose object ca17dc2c183546ba2550d96a2ce10ec02dc29c8b (stored in objects/ca/17dc2c183546ba2550d96a2ce10ec02dc29c8b) is corrupt

Got rid of the file, and another git fsck confirmed all was fine and the user could login again.
At that point gitlab-rake gitlab:check confirmed all was fine and the HTTP 500 was gone.
On a client with that repo I git push --force my way through and restored the repo.

Hope this helps!

Full error message follows:
Processing by RootController#index as HTML
Read fragment views/namespaces/2-20160416175234096011000/projects/6-20170122204503613221000/root/index/application_settings/1-20160416225315196676000/v2.3/11c9265e4d55673ccda1830ad08db0e9 (0.4ms)
Completed 500 Internal Server Error in 691ms (ActiveRecord: 18.2ms)

ActionView::Template::Error (Failed to inflate loose object.):
    35:               - if use_creator_avatar
    36:                 = image_tag avatar_icon(project.creator.email, 40), class: "avatar s40", alt:''
    37:               - else
    38:                 = project_icon(project, alt: '', class: 'avatar project-avatar s40')
    39:         %span.project-full-name
    40:           %span.namespace-name
    41:             - if project.namespace && !skip_namespace
  lib/gitlab/git/repository.rb:64:in `target'
  lib/gitlab/git/repository.rb:64:in `block in branches'
  lib/gitlab/git/repository.rb:62:in `each'
  lib/gitlab/git/repository.rb:62:in `map'
  lib/gitlab/git/repository.rb:62:in `branches'
  lib/gitlab/git/repository.rb:57:in `branch_names'
  lib/gitlab/git/repository.rb:177:in `discover_default_branch'
  lib/gitlab/git/repository.rb:40:in `root_ref'
  app/models/repository.rb:474:in `root_ref'
  app/models/repository.rb:49:in `block (2 levels) in cache_method'
  lib/repository_cache.rb:20:in `fetch'
  app/models/repository.rb:1076:in `cache_method_output'
  app/models/repository.rb:49:in `block in cache_method'
  app/models/repository.rb:586:in `head_commit'
  app/models/repository.rb:597:in `tree'
  app/models/repository.rb:1090:in `file_on_head'
  app/models/repository.rb:530:in `avatar'
  app/models/repository.rb:49:in `block (2 levels) in cache_method'
  lib/repository_cache.rb:20:in `fetch'
  app/models/repository.rb:1076:in `cache_method_output'
  app/models/repository.rb:49:in `block in cache_method'
  app/models/project.rb:789:in `avatar_in_git'
  app/models/project.rb:795:in `avatar_url'
  app/helpers/application_helper.rb:43:in `project_icon'
  app/views/shared/projects/_project.html.haml:38:in `block (2 levels) in _app_views_shared_projects__project_html_haml__4508947423941226302_69864352395660'
  app/views/shared/projects/_project.html.haml:31:in `block in _app_views_shared_projects__project_html_haml__4508947423941226302_69864352395660'
  app/views/shared/projects/_project.html.haml:12:in `_app_views_shared_projects__project_html_haml__4508947423941226302_69864352395660'
  app/views/shared/projects/_list.html.haml:16:in `block in _app_views_shared_projects__list_html_haml___264734034099379995_69864244521160'
  app/views/shared/projects/_list.html.haml:14:in `_app_views_shared_projects__list_html_haml___264734034099379995_69864244521160'
  app/views/dashboard/projects/_projects.html.haml:1:in `_app_views_dashboard_projects__projects_html_haml___1619966685503370863_69864244631240'
  app/views/dashboard/projects/index.html.haml:15:in `_app_views_dashboard_projects_index_html_haml__2112195385169498528_69864236789420'
  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:14:in `call'
  lib/gitlab/request_context.rb:18:in `call'