500 error on homepage when storage accidently deleted from config

Summary

If you accidently delete a storage provider your homepage, your projects page, explorer page, and the projects stored on that storage return 500 errors. GitLab should fail more gracefully.

Steps to reproduce

  1. Add 2 storage providers in gitlab.rb
  2. create projects with both of them
  3. delete one of the storage providers

Notice your homepage will return 500 error

Example Project

N/A

What is the current bug behavior?

500 error rather than user friendly error message

What is the expected correct behavior?

Error message about storage missing but ability to still browser project names, issues, etc.

Relevant logs and/or screenshots

==> /var/log/gitlab/gitlab-rails/production.log <==

ActionView::Template::Error (storage not found: "alternative"):
    11:
    12: .js-projects-list-holder
    13:   - if any_projects?(projects)
    14:     - load_pipeline_status(projects)
    15:
    16:     %ul.projects-list
    17:       - projects.each_with_index do |project, i|
  lib/gitlab/gitaly_client.rb:224:in `token'
  lib/gitlab/gitaly_client.rb:183:in `request_kwargs'
  lib/gitlab/gitaly_client.rb:136:in `call'
  lib/gitlab/gitaly_client/repository_service.rb:17:in `exists?'
  lib/gitlab/git/repository.rb:149:in `exists?'
  app/models/repository.rb:492:in `exists?'
  lib/gitlab/repository_cache_adapter.rb:17:in `block (2 levels) in cache_method'
  lib/gitlab/repository_cache.rb:22:in `fetch'
  lib/gitlab/repository_cache_adapter.rb:54:in `cache_method_output'
  lib/gitlab/repository_cache_adapter.rb:16:in `block in cache_method'
  app/models/repository.rb:103:in `commit'
  app/models/project.rb:532:in `commit'
  lib/gitlab/cache/ci/project_pipeline_status.rb:10:in `commit'
  lib/gitlab/cache/ci/project_pipeline_status.rb:83:in `load_from_project'
  lib/gitlab/cache/ci/project_pipeline_status.rb:75:in `load_status'
  lib/gitlab/cache/ci/project_pipeline_status.rb:21:in `block in load_in_batch_for_projects'
  lib/gitlab/cache/ci/project_pipeline_status.rb:19:in `each'
  lib/gitlab/cache/ci/project_pipeline_status.rb:19:in `load_in_batch_for_projects'
  app/helpers/projects_helper.rb:189:in `load_pipeline_status'
  app/views/shared/projects/_list.html.haml:14:in `_app_views_shared_projects__list_html_haml__1630161973980022520_70350958026100'
  app/views/explore/projects/_projects.html.haml:1:in `_app_views_explore_projects__projects_html_haml__767812559117792419_70350958128400'
  app/views/explore/projects/index.html.haml:11:in `_app_views_explore_projects_index_html_haml___3414149690609639326_70351113064740'
  app/controllers/explore/projects_controller.rb:12:in `index'
  lib/gitlab/i18n.rb:50:in `with_locale'
  lib/gitlab/i18n.rb:56:in `with_user_locale'
  app/controllers/application_controller.rb:362:in `set_locale'
  lib/gitlab/middleware/multipart.rb:95:in `call'
  lib/gitlab/request_profiler/middleware.rb:14:in `call'
  lib/gitlab/middleware/go.rb:17:in `call'
  lib/gitlab/etag_caching/middleware.rb:11:in `call'
  lib/gitlab/middleware/read_only/controller.rb:28:in `call'
  lib/gitlab/middleware/read_only.rb:16:in `call'
  lib/gitlab/request_context.rb:18:in `call'
  lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
  lib/gitlab/middleware/release_env.rb:10:in `call'
Assignee Loading
Time tracking Loading