500 Internal Server Error, ActionView::Template::Error (Missing model Project from count data), on GET /admin after upgrading from 11.6.4-ee to 11.7.3-ee

Summary

After upgrading from 11.6.4-ee to 11.7.3-ee, GET /admin will fail with the 500 status code. However, every page in /admin except for the Overview › Dashboard work correctly.

Steps to reproduce

  1. Upgrade from 11.6.4-ee to 11.7.3-ee.
  2. GET /admin.

What is the current bug behavior?

An error page with the text "500 Whoops, something went wrong on our end." is displayed.

What is the expected correct behavior?

The Dashboard should be displayed.

Relevant logs and/or screenshots

From /var/log/gitlab/gitlab-rails/production.log:

Started GET "/admin" for REDACTED at 2019-02-04 12:52:43 +0100
Processing by Admin::DashboardController#index as HTML
Completed 500 Internal Server Error in 41ms (ActiveRecord: 19.8ms | Elasticsearch: 0.0ms)
  
ActionView::Template::Error (Missing model Project from count data):
    12:             = link_to admin_projects_path do
    13:               %h3.text-center
    14:                 Projects:
    15:                 = approximate_count_with_delimiters(@counts, Project)
    16:             %hr
    17:             = link_to('New project', new_project_path, class: "btn btn-success")
    18:       .col-sm-4
  
app/helpers/count_helper.rb:7:in `approximate_count_with_delimiters'
app/views/admin/dashboard/index.html.haml:15:in `block in _app_views_admin_dashboard_index_html_haml__1414986134073317262_70068568914920'
app/views/admin/dashboard/index.html.haml:12:in `_app_views_admin_dashboard_index_html_haml__1414986134073317262_70068568914920'
app/controllers/application_controller.rb:113:in `render'
lib/gitlab/i18n.rb:55:in `with_locale'
lib/gitlab/i18n.rb:61:in `with_user_locale'
app/controllers/application_controller.rb:417:in `set_locale'
lib/gitlab/middleware/multipart.rb:103:in `call'
lib/gitlab/request_profiler/middleware.rb:16:in `call'
ee/lib/gitlab/jira/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/correlation_id.rb:15:in `use_id'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/read_only/controller.rb:42:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:20:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:29:in `call'
lib/gitlab/middleware/release_env.rb:13:in `call'

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
$ sudo gitlab-rake gitlab:env:info                                                                                     130 

System information System: Debian 9.7 Proxy: no Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.16.6 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.3 Go Version: unknown

GitLab information Version: 11.7.3-ee Revision: d573592 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.11 URL: https://code.chakralinux.org HTTP Clone URL: https://code.chakralinux.org/some-group/some-project.git SSH Clone URL: git@code.chakralinux.org:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: gitlab, github, bitbucket

GitLab Shell Version: 8.4.4 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check
$ sudo gitlab-rake gitlab:check SANITIZE=true
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 8.4.4 ? ... OK (8.4.4) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Checking Reply by email ...

IMAP server credentials are correct? ... yes Init.d configured correctly? ... skipped MailRoom running? ... skipped

Checking Reply by email ... Finished

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 3/1 ... yes 3/2 ... yes 3/3 ... yes 3/4 ... yes 12/5 ... yes 11/6 ... yes 90/7 ... yes 90/8 ... yes 12/9 ... yes 90/10 ... yes 168/12 ... yes 168/13 ... yes 168/14 ... yes 168/15 ... yes 168/16 ... yes 168/17 ... yes 168/18 ... yes 168/19 ... yes 168/20 ... yes 168/21 ... yes 168/22 ... yes 168/23 ... yes 168/24 ... yes 168/25 ... yes 168/26 ... yes 168/27 ... yes 168/28 ... yes 168/29 ... yes 76/30 ... yes 3/31 ... yes 168/32 ... yes 168/33 ... yes 168/34 ... yes 168/35 ... yes 168/36 ... yes 168/37 ... yes 168/38 ... yes 168/39 ... yes 168/40 ... yes 168/41 ... yes 168/42 ... yes 168/43 ... yes 19/44 ... yes 19/45 ... yes 25/46 ... yes 19/47 ... yes 10/48 ... yes 168/49 ... yes 42/50 ... yes 67/53 ... yes 67/54 ... yes 67/55 ... yes 168/112 ... yes 168/113 ... yes 95/114 ... yes 19/115 ... yes 76/119 ... yes 76/122 ... yes 19/124 ... yes 22/125 ... yes 22/126 ... yes 10/127 ... yes 95/128 ... yes 1/130 ... yes 22/131 ... yes 166/132 ... yes 10/133 ... yes 200/137 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 82 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

I ran sudo gitlab-ctl restart twice directly after the upgrade. Now, about four hours later, it is working as expected. I do have the (substantial) log file, but do not know what to look for. It worked just fine from 2019-02-04T1700Z to 2019-02-06T1930, then the exact same error appeared in production.log.

Edited by totte