Skip to content

Controller Projects::Security::VulnerabilitiesController#show executes more than 100 SQL queries

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

This controller executes more than 100 SQL queries, the maximum number of queries allowed as per MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16466.

We were getting this error in CI, locally, and it's breaking master gitlab-org/quality/engineering-productivity/master-broken-incidents#15416 (closed)


Sample output of the failure:

Gitlab::QueryLimiting::Transaction::ThresholdExceededError:
       Too many SQL queries were executed in Projects::Security::VulnerabilitiesController#show: a maximum of 100 is allowed but 101 SQL queries were executed
       0: SELECT "routes".* FROM "routes" WHERE "routes"."source_type" = 'Project' AND "routes"."path" = 'group1/project-1' LIMIT 1 /*application:test,correlation_id:01K2HDQH7P736EN2N5D5RB36E1,db_config_database:gitlabhq_test,db_config_name:main,line:/app/models/concerns/routable.rb:34:in `find_by_full_path'*/
Edited by 🤖 GitLab Bot 🤖