Add approval rule Approvers dropdown sometimes fails to load
Summary
The Approvers
dropdown in the Add approval rule
modal sometimes fails to load.
Steps to reproduce
It's not clear what conditions are required to reproduce the bug. Possibly related to having many many groups?
- Create an MR.
- Attempt to add an approval rule.
- Enter a user or group to filter the
Approvers
dropdown.
Example Project
It happens frequently on projects created in the gitlab-qa-sandbox-group
group as part of the QA tests on Staging. For example: https://staging.gitlab.com/gitlab-qa-sandbox-group/qa-test-2020-11-26-08-54-27-cf4fca2b42a29d99/approval-rules-b01350a2d5aa2e0c
What is the current bug behavior?
Sometimes "Searching..." and the loading spinner appear but the drop-down is never populated.
The network request for api/v4/groups.json
returns 500 Internal Server Error
.
What is the expected correct behavior?
The API request is successful and the drop-down loads.
OR the API request is unsuccessful and the UI displays an appropriate error message.
Relevant logs and/or screenshots
Example failed request on Staging: https://nonprod-log.gitlab.net/app/discover#/doc/ed942d00-5186-11ea-ad8a-f3610a492295/pubsub-rails-inf-gstg-000174?id=F9hz-HUBMSr4hBJbb_V_
Expand for stacktrace
{
"_index": "pubsub-rails-inf-gstg-000174",
"_type": "_doc",
"_id": "F9hz-HUBMSr4hBJbb_V_",
"_score": 1,
"_ignored": [
"json.remote_ip"
],
"_source": {
"@timestamp": "2020-11-24T04:11:54.810Z",
"json": {
"redis_calls": 8,
"fqdn": "api-03-sv-gstg.c.gitlab-staging-1.internal",
"route": "/api/:version/groups",
"tag": "rails.api",
"remote_ip": "180.150.39.121, 10.224.14.20, 180.150.39.121",
"redis_cache_write_bytes": 283,
"params": [
{
"key": "all_available",
"value": "true"
},
{
"key": "per_page",
"value": "20"
},
{
"key": "search",
"value": "gitlab-qa-user1"
}
],
"redis_cache_calls": 4,
"db_duration_s": 10.00993,
"path": "/api/v4/groups.json",
"exception.class": "ActiveRecord::QueryCanceled",
"meta.user": "gitlab-qa",
"meta.caller_id": "/api/:version/groups",
"environment": "gstg",
"username": "gitlab-qa",
"ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36",
"redis_cache_duration_s": 0.002524,
"redis_shared_state_write_bytes": 1063,
"tier": "sv",
"method": "GET",
"time": "2020-11-24T04:10:55.014Z",
"redis_write_bytes": 1346,
"redis_shared_state_duration_s": 0.00285,
"user_id": 1614863,
"correlation_id": "GRlh9SHxfk7",
"redis_shared_state_calls": 4,
"redis_duration_s": 0.005374,
"meta.feature_category": "subgroups",
"view_duration_s": 0.54844,
"host": "staging.gitlab.com",
"hostname": "api-03-sv-gstg",
"exception.backtrace": [
"ee/lib/gitlab/database/load_balancing/connection_proxy.rb:72:in `block in read_using_load_balancer'",
"ee/lib/gitlab/database/load_balancing/load_balancer.rb:84:in `block in read_write'",
"ee/lib/gitlab/database/load_balancing/load_balancer.rb:130:in `retry_with_backoff'",
"ee/lib/gitlab/database/load_balancing/load_balancer.rb:83:in `read_write'",
"ee/lib/gitlab/database/load_balancing/connection_proxy.rb:71:in `read_using_load_balancer'",
"ee/lib/gitlab/database/load_balancing/connection_proxy.rb:44:in `select_all'",
"config/initializers/kaminari_active_record_relation_methods_with_limit.rb:29:in `total_count_with_limit'",
"lib/gitlab/pagination/offset_pagination.rb:32:in `paginate_with_limit_optimization'",
"lib/gitlab/pagination/offset_pagination.rb:14:in `paginate'",
"lib/api/helpers/pagination.rb:7:in `paginate'",
"lib/api/groups.rb:111:in `present_groups'",
"lib/api/groups.rb:154:in `block (2 levels) in <class:Groups>'",
"ee/lib/gitlab/middleware/ip_restrictor.rb:14:in `block in call'",
"ee/lib/gitlab/ip_address_state.rb:10:in `with'",
"ee/lib/gitlab/middleware/ip_restrictor.rb:13:in `call'",
"lib/api/api_guard.rb:208:in `call'",
"ee/lib/omni_auth/strategies/group_saml.rb:41:in `other_phase'",
"lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'",
"lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'",
"lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'",
"lib/gitlab/metrics/transaction.rb:61:in `run'",
"lib/gitlab/metrics/rack_middleware.rb:16:in `call'",
"lib/gitlab/request_profiler/middleware.rb:17:in `call'",
"ee/lib/gitlab/database/load_balancing/rack_middleware.rb:39:in `call'",
"lib/gitlab/jira/middleware.rb:19:in `call'",
"lib/gitlab/middleware/go.rb:20:in `call'",
"lib/gitlab/etag_caching/middleware.rb:21:in `call'",
"lib/gitlab/middleware/multipart.rb:234:in `call'",
"lib/gitlab/middleware/read_only/controller.rb:50:in `call'",
"lib/gitlab/middleware/read_only.rb:18:in `call'",
"lib/gitlab/middleware/same_site_cookies.rb:27:in `call'",
"lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'",
"lib/gitlab/middleware/basic_health_check.rb:25:in `call'",
"lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'",
"lib/gitlab/middleware/request_context.rb:23:in `call'",
"config/initializers/fix_local_cache_middleware.rb:9:in `call'",
"lib/gitlab/metrics/requests_rack_middleware.rb:76:in `call'",
"lib/gitlab/middleware/release_env.rb:12:in `call'"
],
"redis_read_bytes": 463,
"type": "api",
"exception.message": "PG::QueryCanceled: ERROR: canceling statement due to statement timeout\n",
"redis_shared_state_read_bytes": 212,
"stage": "main",
"shard": "default",
"redis_cache_read_bytes": 251,
"queue_duration_s": 0.031951,
"duration_s": 10.55837,
"status": 500,
"severity": "INFO"
},
"ecs": {
"version": "1.5.0"
},
"host": {
"name": "pubsubbeat-pubsub-rails-inf-gstg-649f4ddfb6-zxdhn"
},
"type": "pubsubbeat-pubsub-rails-inf-gstg-649f4ddfb6-zxdhn",
"message_id": "1654483922664452",
"publish_time": "2020-11-24T04:11:54.781Z"
},
"fields": {
"json.user_id": [
"1.614863e+06"
],
"@timestamp": [
"2020-11-24T04:11:54.810Z"
],
"publish_time": [
"2020-11-24T04:11:54.781Z"
],
"json.time": [
"2020-11-24T04:10:55.014Z"
]
}
}
Output of checks
This bug happens on staging.gitLab.com