Error 500 and Sidekiq jobs failures when artifacts are in object storage but object storage is disabled
Due to SSL issues after upgrading to 10.3.3, customer disabled artifacts object storage. Now, lots of job pages, /admin/jobs, and Sidekiq jobs (e.g. ExpireBuildInstanceArtifactsWorker) are failing as a result:
Completed 500 Internal Server Error in 1204ms (ActiveRecord: 472.6ms | Elasticsearch: 0.0ms)
ActionView::Template::Error (Object Storage is not enabled):
94:
95: %td
96: .pull-right
97: - if can?(current_user, :read_build, job) && job.artifacts?
98: = link_to download_project_job_artifacts_path(job.project, job), rel: 'nofollow', download: '', title: 'Download artifacts', class: 'btn btn-build' do
99: = icon('download')
100: - if can?(current_user, :update_build, job)
app/models/concerns/artifact_migratable.rb:6:in `artifacts_file'
app/models/concerns/artifact_migratable.rb:14:in `artifacts?'
app/views/projects/ci/builds/_build.html.haml:97:in `_app_views_projects_ci_builds__build_html_haml__2755263102898863351_70114871185740'
app/views/projects/jobs/_table.html.haml:23:in `_app_views_projects_jobs__table_html_haml__4375946446614009866_70114868598760'
app/views/admin/jobs/index.html.haml:18:in `_app_views_admin_jobs_index_html_haml___3683343264365651047_70114865092560'
lib/gitlab/i18n.rb:47:in `with_locale'
lib/gitlab/i18n.rb:53:in `with_user_locale'
app/controllers/application_controller.rb:332:in `set_locale'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
lib/gitlab/jira/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:18:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/middleware/read_only.rb:31:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
Started GET "/code/namespace/project/-/jobs" for 52.34.5.71 at 2018-01-10 00:46:00 +0000
Processing by Projects::JobsController#index as HTML
Parameters: {"namespace_id"=>"namespace", "project_id"=>"project"}
Completed 500 Internal Server Error in 334ms (ActiveRecord: 49.7ms | Elasticsearch: 0.0ms)
ActionView::Template::Error (Object Storage is not enabled):
94:
95: %td
96: .pull-right
97: - if can?(current_user, :read_build, job) && job.artifacts?
98: = link_to download_project_job_artifacts_path(job.project, job), rel: 'nofollow', download: '', title: 'Download artifacts', class: 'btn btn-build' do
99: = icon('download')
100: - if can?(current_user, :update_build, job)
app/models/concerns/artifact_migratable.rb:6:in `artifacts_file'
app/models/concerns/artifact_migratable.rb:14:in `artifacts?'
app/views/projects/ci/builds/_build.html.haml:97:in `_app_views_projects_ci_builds__build_html_haml__2755263102898863351_70114665660660'
app/views/projects/jobs/_table.html.haml:23:in `_app_views_projects_jobs__table_html_haml__4375946446614009866_70114693748860'
app/views/projects/jobs/index.html.haml:22:in `_app_views_projects_jobs_index_html_haml__2740892631549488149_70114695486420'
lib/gitlab/i18n.rb:47:in `with_locale'
lib/gitlab/i18n.rb:53:in `with_user_locale'
app/controllers/application_controller.rb:332:in `set_locale'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
lib/gitlab/jira/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:18:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/middleware/read_only.rb:31:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
We need to gracefully handle this case.
Edited by Stan Hu