GDK: Gitlab::GitalyClient::TooManyInvocationsError on GET /api/v4/groups
Summary
GET /api/v4/groups/:id returns 500 with Gitlab::GitalyClient::TooManyInvocationsError in the GDK logs.
NOTE: This is only on local installation with GDK. Works fine in production and in CI (using nightly omnibus docker images). The bug doesn't occur after disabling request limits.
Steps to reproduce
- On GDK, create a group with a subgroup and 14 projects
curl -s --header "PRIVATE-TOKEN: xxxxxxxxxxxxxxxxxxxx" http://localhost:3000/api/v4/groups/:id
What is the current bug behavior?
The request returns {"message":"500 Internal Server Error"} and the logs appear as below.
What is the expected correct behavior?
The request returns status 200 and the group data.
Relevant logs and/or screenshots
11:16:21 rails-web.1 | caught error of type Gitlab::GitalyClient::TooManyInvocationsError in after callback inside Grape::Middleware::Formatter : GitalyClient#call called 36 times from single request. Potential n+1?
11:16:21 rails-web.1 | The following call site called into Gitaly 9 times:
11:16:21 rails-web.1 | lib/gitlab/gitaly_client.rb:129:in `call'
11:16:21 rails-web.1 | lib/gitlab/gitaly_client/commit_service.rb:425:in `call_find_commit'
11:16:21 rails-web.1 | lib/gitlab/gitaly_client/commit_service.rb:254:in `find_commit'
11:16:21 rails-web.1 | lib/gitlab/git/commit.rb:66:in `block in find'
11:16:21 rails-web.1 | lib/gitlab/git/repository.rb:893:in `wrapped_gitaly_errors'
11:16:21 rails-web.1 | lib/gitlab/git/commit.rb:65:in `find'
11:16:21 rails-web.1 | app/models/repository.rb:1023:in `find_commit'
11:16:21 rails-web.1 | app/models/repository.rb:105:in `commit'
11:16:21 rails-web.1 | app/models/repository.rb:639:in `head_commit'
11:16:21 rails-web.1 | app/models/repository.rb:650:in `tree'
11:16:21 rails-web.1 | app/models/repository.rb:574:in `readme'
11:16:21 rails-web.1 | app/models/project.rb:978:in `readme_url'
11:16:21 rails-web.1 | lib/gitlab/query_limiting/middleware.rb:17:in `block in call'
11:16:21 rails-web.1 | lib/gitlab/query_limiting/transaction.rb:37:in `run'
11:16:21 rails-web.1 | lib/gitlab/query_limiting/middleware.rb:16:in `call'
11:16:21 rails-web.1 | lib/gitlab/webpack/dev_server_middleware.rb:25:in `perform_request'
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 18.04 Current User: mark Using RVM: no Ruby Version: 2.4.4p296 Gem Version: 2.6.14.1 Bundler Version:1.16.4 Rake Version: 12.3.1 Redis Version: 4.0.9 Git Version: 2.18.0 Sidekiq Version:5.2.1 Go Version: go1.11 linux/amd64
GitLab information Version: 11.3.0-pre Revision: 1111396dd18 Directory: /home/mark/dev/gitlab/gitlab-ce DB Adapter: postgresql URL: http://192.168.0.91:3000 HTTP Clone URL: http://192.168.0.91:3000/some-group/some-project.git SSH Clone URL: ssh://mark@192.168.0.91:2222/some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 8.3.3 Repository storage paths: default: /home/mark/dev/gdk-ce/repositories Hooks: /home/mark/dev/gdk-ce/gitlab-shell/hooks Git: /usr/bin/git