500 internal server error when creating commits through the API with root access token
Summary
500 internal server error is returned when creating commits through the API when using an OAuth access token owned by the root user.
When inspecting through the UI after the 500 error, the commit was created.
Also see: !198801 (comment 2737813099)
Steps to reproduce
NOTE: this is for setting up an instance for running integration tests against, not for production use.
Start a gitlab container with a root user password set
docker run \
--hostname gitlab \
--name gitlab \
--publish 8022:22 \
--publish 8080:80 \
--publish 8443:443 \
-e "GITLAB_HOST=gitlab" \
-e "GITLAB_HTTPS=false" \
-e "GITLAB_ROOT_PASSWORD=p*ssw0rd" \
-it \
docker.io/gitlab/gitlab-ce:latest
-
image: gitlab/gitlab-ce:18.2.4-ce.0works -
image: gitlab/gitlab-ce:18.2.5-ce.0works -
image: gitlab/gitlab-ce:18.3.0-ce.0first failed here -
image: gitlab/gitlab-ce:18.3.1-ce.0also failed with this one
Create this file auth.txt
grant_type=password&username=root&password=p*ssw0rd
Run unit tests which call the API
export GITLAB_OAUTH_TOKEN=$(curl -sS --data "@auth.txt" --request POST "http://127.0.0.1:8080/oauth/token" | jq -r .access_token)
cargo test # or whatever tests you want to run
The tests that fail perform these steps in sequence by calling the REST API
- create group - succeeds
- create empty project in the new group - succeeds
- create commit - fails
Example Project
No public facing projects at this time.
What is the current bug behavior?
The API returns 500 internal server error.
Inspecting the project in the UI shows that the commit was successfully created.
What is the expected correct behavior?
The API returns a 2xx status code to indicate the commit was created.
Inspecting the project in the UI shows that the commit was successfully created.
Relevant logs and/or screenshots
==> /var/log/gitlab/gitlab-rails/production.log <==
NoMethodError (undefined method `id' for nil:NilClass):
/opt/gitlab/embedded/service/gitlab-rails/lib/api/commits.rb:40:in `web_ide_request?'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/commits.rb:44:in `track_web_ide_commit_events'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/commits.rb:260:in `block (2 levels) in <class:Commits>'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/endpoint.rb:58:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/endpoint.rb:58:in `block (2 levels) in generate_api_method'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/activesupport-7.1.5.1/lib/active_support/notifications.rb:208:in `instrument'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/endpoint.rb:57:in `block in generate_api_method'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/endpoint.rb:328:in `execute'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/endpoint.rb:260:in `block in run'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/activesupport-7.1.5.1/lib/active_support/notifications.rb:208:in `instrument'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/endpoint.rb:240:in `run'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/endpoint.rb:316:in `block in build_stack'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api_guard.rb:266:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-oauth2-2.2.1/lib/rack/oauth2/server/resource.rb:20:in `_call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-oauth2-2.2.1/lib/rack/oauth2/server/resource/bearer.rb:8:in `_call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-oauth2-2.2.1/lib/rack/oauth2/server/abstract/handler.rb:17:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/ip_address.rb:14:in `block in call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ip_address_state.rb:11:in `with'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/ip_address.rb:13:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api_guard.rb:266:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:36:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-oauth2-2.2.1/lib/rack/oauth2/server/resource.rb:20:in `_call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-oauth2-2.2.1/lib/rack/oauth2/server/resource/bearer.rb:8:in `_call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-oauth2-2.2.1/lib/rack/oauth2/server/abstract/handler.rb:17:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/error.rb:39:in `block in call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/error.rb:38:in `catch'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/error.rb:38:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape_logging-1.8.4/lib/grape_logging/middleware/request_logger.rb:60:in `block in call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape_logging-1.8.4/lib/grape_logging/middleware/request_logger.rb:58:in `catch'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape_logging-1.8.4/lib/grape_logging/middleware/request_logger.rb:58:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/middleware/base.rb:29:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/head.rb:12:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/endpoint.rb:224:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/endpoint.rb:218:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/router/route.rb:58:in `exec'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/router.rb:120:in `process_route'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/router.rb:74:in `block in identity'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/router.rb:94:in `transaction'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/router.rb:72:in `identity'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/router.rb:56:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/router.rb:136:in `with_optimization'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/router.rb:55:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/api/instance.rb:165:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/api/instance.rb:70:in `call!'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/grape-2.0.0/lib/grape/api/instance.rb:65:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/routing/mapper.rb:31:in `block in <class:Constraints>'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/routing/mapper.rb:60:in `serve'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/journey/router.rb:51:in `block in serve'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/action_dispatch_journey_router.rb:52:in `block in find_routes'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/action_dispatch_journey_router.rb:25:in `map!'
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/action_dispatch_journey_router.rb:25:in `find_routes'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/journey/router.rb:32:in `serve'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/routing/route_set.rb:882:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/gitlab-experiment-0.9.1/lib/gitlab/experiment/middleware.rb:19:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/flipper-0.28.3/lib/flipper/middleware/memoizer.rb:72:in `memoized_call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/flipper-0.28.3/lib/flipper/middleware/memoizer.rb:37: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/sidekiq_shard_awareness_validation.rb:20:in `block in call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/sidekiq_sharding/validator.rb:42:in `enabled'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/sidekiq_shard_awareness_validation.rb:20: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/database/load_balancing/rack_middleware.rb:23: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/etag_caching/middleware.rb:21: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/middleware/go.rb:21:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/query_analyzer.rb:11:in `block in call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/query_analyzer.rb:83:in `within'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/query_analyzer.rb:11:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/ci/job_token/middleware.rb:11:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/batch-loader-2.0.5/lib/batch_loader/middleware.rb:11:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-attack-6.7.0/lib/rack/attack.rb:103:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/apollo_upload_server-2.1.6/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/3.2.0/gems/rack-attack-6.7.0/lib/rack/attack.rb:127:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/warden-1.2.9/lib/warden/manager.rb:36:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `catch'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-cors-2.0.2/lib/rack/cors.rb:102:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/tempfile_reaper.rb:15:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/etag.rb:27:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/conditional_get.rb:40:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/head.rb:12:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/http/permissions_policy.rb:36:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/http/content_security_policy.rb:36:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/read_only/controller.rb:40:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/read_only.rb:18:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/unauthenticated_session_expiry.rb:18:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/session/abstract/id.rb:266:in `context'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/session/abstract/id.rb:260:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/secure_headers.rb:11:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/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/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/activesupport-7.1.5.1/lib/active_support/callbacks.rb:101:in `run_callbacks'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/sentry-rails-5.23.0/lib/sentry/rails/rescued_exception_interceptor.rb:14:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/path_traversal_check.rb:40:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/sentry-ruby-5.23.0/lib/sentry/rack/capture_exceptions.rb:30:in `block (2 levels) in call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/sentry-ruby-5.23.0/lib/sentry/hub.rb:299:in `with_session_tracking'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/sentry-ruby-5.23.0/lib/sentry-ruby.rb:428:in `with_session_tracking'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/sentry-ruby-5.23.0/lib/sentry/rack/capture_exceptions.rb:21:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/sentry-ruby-5.23.0/lib/sentry/hub.rb:89:in `with_scope'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/sentry-ruby-5.23.0/lib/sentry-ruby.rb:408:in `with_scope'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/sentry-ruby-5.23.0/lib/sentry/rack/capture_exceptions.rb:20:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/basic_health_check.rb:25:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/lograge-0.11.2/lib/lograge/rails_ext/rack/logger.rb:15:in `call_app'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/railties-7.1.5.1/lib/rails/rack/logger.rb:24:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/activesupport-7.1.5.1/lib/active_support/tagged_logging.rb:139:in `block in tagged'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/activesupport-7.1.5.1/lib/active_support/tagged_logging.rb:39:in `tagged'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/activesupport-7.1.5.1/lib/active_support/tagged_logging.rb:139:in `tagged'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/activesupport-7.1.5.1/lib/active_support/broadcast_logger.rb:241:in `method_missing'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/railties-7.1.5.1/lib/rails/rack/logger.rb:24:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/remote_ip.rb:92: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:15:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/request_store-1.7.0/lib/request_store/middleware.rb:19:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/method_override.rb:24:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/runtime.rb:22:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-timeout-0.7.0/lib/rack/timeout/core.rb:154:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-timeout-0.7.0/lib/rack/timeout/support/timeout.rb:19:in `timeout'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-timeout-0.7.0/lib/rack/timeout/core.rb:153: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:44:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/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/service/gitlab-rails/lib/gitlab/metrics/requests_rack_middleware.rb:83:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/gitlab-labkit-0.39.0/lib/labkit/middleware/rack.rb:22:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/gitlab-labkit-0.39.0/lib/labkit/context.rb:35:in `with_context'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/gitlab-labkit-0.39.0/lib/labkit/middleware/rack.rb:21:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/sendfile.rb:110:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/request_id.rb:28:in `call'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/railties-7.1.5.1/lib/rails/engine.rb:536:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/railties-7.1.5.1/lib/rails/railtie.rb:226:in `public_send'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/railties-7.1.5.1/lib/rails/railtie.rb:226:in `method_missing'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/middleware/release_env.rb:12:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/urlmap.rb:74:in `block in call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/urlmap.rb:58:in `each'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/rack-2.2.17/lib/rack/urlmap.rb:58:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/puma-6.6.1/lib/puma/configuration.rb:279:in `call'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/puma-6.6.1/lib/puma/request.rb:99:in `block in handle_request'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/puma-6.6.1/lib/puma/thread_pool.rb:390:in `with_force_shutdown'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/puma-6.6.1/lib/puma/request.rb:98:in `handle_request'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/puma-6.6.1/lib/puma/server.rb:472:in `process_client'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/puma-6.6.1/lib/puma/server.rb:254:in `block in run'
/opt/gitlab/embedded/lib/ruby/gems/3.2.0/gems/puma-6.6.1/lib/puma/thread_pool.rb:167:in `block in spawn_thread'
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(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`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(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)
Possible fixes
https://gitlab.com/gitlab-org/gitlab/-/blob/8f0f0ef209a1890bb0b7734381459db3d529f203/lib/api/commits.rb#L40 is where I believe the error is happening which was changed recently in !198801 (merged)
Patch release information for backports
If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.
Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.
High-severity bug remediation
To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.