Incorrect ownership on gitlab-ci/builds causes jobs to spin
<!---
Please read this!
Before opening a new issue, make sure to search for keywords in the issues
filtered by the "regression" or "type::bug" label:
- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression
- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=type::bug
and verify the issue you're about to submit isn't a duplicate.
--->
### Summary
<!-- Summarize the bug encountered concisely. -->
The gitlab-ci/builds directory is created after clicking into the ci/cd environments in the UI with ownership git:git, if these permissions change, jobs will spin (three dots) without an indication as to why.
### Steps to reproduce
- chown other:user /var/opt/gitlab/gitlab-ci
- run a ci job, there will be traces but the job state in the UI will just be blank
<!-- Describe how one can reproduce the issue - this is very important. Please use an ordered list. -->
### What is the current *bug* behavior?
Job status is the spinner/dots
<!-- Describe what actually happens. -->
### What is the expected *correct* behavior?
Job fails with a reason
<!-- Describe what you should see instead. -->
### Relevant logs and/or screenshots
<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code
as it's tough to read otherwise. -->
```
==> /var/log/gitlab/gitlab-rails/production.log <==
Completed 302 Found in 7ms (ActiveRecord: 0.0ms | Elasticsearch: 0.0ms | Allocations: 2545)
Started GET "/platform/core/core-nonprod/kics-test/-/jobs/122185/trace.json?state=" for x.x.x.x at 2022-03-31 16:18:25 +0000
Processing by Projects::JobsController#trace as JSON
Parameters: {"state"=>"", "namespace_id"=>"platform/core/core-nonprod", "project_id"=>"kics-test", "id"=>"122185"}
Completed 204 No Content in 32ms (ActiveRecord: 8.2ms | Elasticsearch: 0.0ms | Allocations: 8815)
==> /var/log/gitlab/gitlab-rails/application.log <==
2022-03-31T16:16:59.518Z: (saml) Request phase initiated.
2022-03-31T16:17:07.515Z: Cannot obtain an exclusive lease for geo/verification_state_backfill_worker. There must be another instance already in execution.
2022-03-31T16:17:09.069Z: Cannot obtain an exclusive lease for geo/verification_state_backfill_worker. There must be another instance already in execution.
2022-03-31T16:17:09.121Z: Cannot obtain an exclusive lease for geo/verification_state_backfill_worker. There must be another instance already in execution.
2022-03-31T16:17:10.850Z: (saml) Callback phase initiated.
2022-03-31T16:17:17.798Z: Cannot obtain an exclusive lease for ci/pipeline_processing/atomic_processing_service::pipeline_id:31650. There must be another instance already in execution.
2022-03-31T16:17:37.094Z: ActiveRecord connection established
2022-03-31T16:18:17.001Z: Cannot obtain an exclusive lease for geo/verification_state_backfill_worker. There must be another instance already in execution.
2022-03-31T16:18:17.146Z: Cannot obtain an exclusive lease for geo/verification_state_backfill_worker. There must be another instance already in execution.
2022-03-31T16:18:17.233Z: Cannot obtain an exclusive lease for geo/verification_state_backfill_worker. There must be another instance already in execution.
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/platform/core/core-nonprod/kics-test/-/jobs/122185/trace.json?state=" for x.x.x.x at 2022-03-31 16:18:30 +0000
Processing by Projects::JobsController#trace as JSON
Parameters: {"state"=>"", "namespace_id"=>"platform/core/core-nonprod", "project_id"=>"kics-test", "id"=>"122185"}
Completed 204 No Content in 50ms (ActiveRecord: 8.9ms | Elasticsearch: 0.0ms | Allocations: 9463)
==> /var/log/gitlab/gitlab-rails/production.log <==
Errno::EACCES (Permission denied @ rb_sysopen - /var/opt/gitlab/gitlab-ci/builds/2022_03/4567/122185.log):
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/trace.rb:184:in `initialize'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/trace.rb:184:in `open'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/trace.rb:184:in `block in unsafe_write!'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/trace/stream.rb:15:in `initialize'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/trace.rb:176:in `new'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/trace.rb:176:in `unsafe_write!'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/trace.rb:97:in `block in write'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/exclusive_lease_helpers.rb:38:in `in_lock'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/trace.rb:242:in `in_write_lock'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/trace.rb:96:in `write'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ci/trace.rb:66:in `append'
/opt/gitlab/embedded/service/gitlab-rails/app/services/ci/append_build_trace_service.rb:33:in `execute'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/ci/runner.rb:210:in `block (2 levels) in <class:Runner>'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/endpoint.rb:59:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/endpoint.rb:59:in `block (2 levels) in generate_api_method'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.6/lib/active_support/notifications.rb:205:in `instrument'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/endpoint.rb:58:in `block in generate_api_method'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/endpoint.rb:341:in `execute'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/endpoint.rb:267:in `block in run'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.6/lib/active_support/notifications.rb:205:in `instrument'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/endpoint.rb:247:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/endpoint.rb:322:in `block in build_stack'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/ip_address_state.rb:10:in `with'
/opt/gitlab/embedded/service/gitlab-rails/ee/lib/gitlab/middleware/ip_restrictor.rb:13:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api_guard.rb:213:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-oauth2-1.16.0/lib/rack/oauth2/server/resource.rb:20:in `_call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-oauth2-1.16.0/lib/rack/oauth2/server/resource/bearer.rb:8:in `_call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-oauth2-1.16.0/lib/rack/oauth2/server/abstract/handler.rb:17:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/error.rb:39:in `block in call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/error.rb:38:in `catch'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/error.rb:38:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape_logging-1.8.3/lib/grape_logging/middleware/request_logger.rb:60:in `block in call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape_logging-1.8.3/lib/grape_logging/middleware/request_logger.rb:58:in `catch'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape_logging-1.8.3/lib/grape_logging/middleware/request_logger.rb:58:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/endpoint.rb:231:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/endpoint.rb:225:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/router/route.rb:58:in `exec'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/router.rb:116:in `process_route'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/router.rb:72:in `block in identity'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/router.rb:91:in `transaction'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/router.rb:70:in `identity'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/router.rb:55:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/router.rb:132:in `with_optimization'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/router.rb:54:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/api/instance.rb:167:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/api/instance.rb:71:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/grape-1.5.2/lib/grape/api/instance.rb:66:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/routing/mapper.rb:20:in `block in <class:Constraints>'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/routing/mapper.rb:49:in `serve'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/journey/router.rb:32:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/journey/router.rb:32:in `serve'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/routing/route_set.rb:842:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-experiment-0.7.0/lib/gitlab/experiment/middleware.rb:19:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:420:in `call_app!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/omniauth-saml-1.10.0/lib/omniauth/strategies/saml.rb:86:in `other_phase'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:190:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/omniauth-1.9.1/lib/omniauth/strategy.rb:169:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/flipper-0.21.0/lib/flipper/middleware/memoizer.rb:77:in `memoized_call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/flipper-0.21.0/lib/flipper/middleware/memoizer.rb:42:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/memory_report.rb:13:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/speedscope.rb:13:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/request_profiler/middleware.rb:17:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/web_transaction.rb:46:in `run'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/rack_middleware.rb:16:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/jira/middleware.rb:19:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/go.rb:20:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/etag_caching/middleware.rb:21:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/batch-loader-2.0.1/lib/batch_loader/middleware.rb:11:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-attack-6.3.0/lib/rack/attack.rb:97:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/apollo_upload_server-2.1.0/lib/apollo_upload_server/middleware.rb:19:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/multipart.rb:173:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-attack-6.3.0/lib/rack/attack.rb:111:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/warden-1.2.8/lib/warden/manager.rb:36:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/warden-1.2.8/lib/warden/manager.rb:34:in `catch'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/warden-1.2.8/lib/warden/manager.rb:34:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-cors-1.0.6/lib/rack/cors.rb:98:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/etag.rb:27:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/conditional_get.rb:40:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/read_only/controller.rb:50:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/read_only.rb:18:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/middleware/cookies.rb:689:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.6/lib/active_support/callbacks.rb:98:in `run_callbacks'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/basic_health_check.rb:25:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/rack/logger.rb:37:in `call_app'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/rack/logger.rb:26:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.6/lib/active_support/tagged_logging.rb:99:in `block in tagged'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.6/lib/active_support/tagged_logging.rb:37:in `tagged'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activesupport-6.1.4.6/lib/active_support/tagged_logging.rb:99:in `tagged'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/rack/logger.rb:26:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/request_context.rb:21:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/request_store-1.5.1/lib/request_store/middleware.rb:19:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-timeout-0.5.2/lib/rack/timeout/core.rb:123:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-timeout-0.5.2/lib/rack/timeout/support/timeout.rb:19:in `timeout'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-timeout-0.5.2/lib/rack/timeout/core.rb:122:in `call'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/fix_local_cache_middleware.rb:11:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/compressed_json.rb:26:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/middleware/executor.rb:14:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/middleware/host_authorization.rb:113:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/requests_rack_middleware.rb:77:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-labkit-0.22.0/lib/labkit/middleware/rack.rb:19:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-labkit-0.22.0/lib/labkit/context.rb:36:in `with_context'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/gitlab-labkit-0.22.0/lib/labkit/middleware/rack.rb:18:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/actionpack-6.1.4.6/lib/action_dispatch/middleware/request_id.rb:26:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/sentry-raven-3.1.2/lib/raven/integrations/rack.rb:51:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/engine.rb:539:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/railtie.rb:207:in `public_send'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.6/lib/rails/railtie.rb:207:in `method_missing'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/release_env.rb:13:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.6.2/lib/puma/configuration.rb:252:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.6.2/lib/puma/request.rb:77:in `block in handle_request'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.6.2/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.6.2/lib/puma/request.rb:76:in `handle_request'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.6.2/lib/puma/server.rb:441:in `process_client'
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/puma-5.6.2/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
```
### Output of checks
<!-- If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com -->
#### Results of GitLab environment info
gitlab-runner 14.6, but also other versions
<!-- Input any relevant GitLab environment information if needed. -->
<details>
<summary>Expand for output related to GitLab environment info</summary>
<pre>
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)
(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
</pre>
</details>
#### Results of GitLab application Check
<!-- Input any relevant GitLab application check information if needed. -->
<details>
<summary>Expand for output related to the GitLab application check</summary>
<pre>
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:check SANITIZE=true`)
(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`)
(we will only investigate if the tests are passing)
</pre>
</details>
### Possible fixes
- chown -R git:git /var/opt/gitlab/gitlab-ci
<!-- If you can, link to the line of code that might be responsible for the problem. -->
issue