Gitlab::GitalyClient::TooManyInvocationsError on GET /api/v4/projects API

Summary

GET /api/v4/projects returns 500 with Gitlab::GitalyClient::TooManyInvocationsError in the GDK logs

NOTE: This is only on local installation with GDK. Works fine in production and Docker.

Steps to reproduce

curl -s --header "PRIVATE-TOKEN: xxxxxxxxxxxxxxxxxxxx" http://localhost:3000/api/v4/projects

What is the expected correct behavior?

API call should return 200 status with projects in the response.

Relevant logs and/or screenshots

3:48:58 rails-web.1              | caught error of type Gitlab::GitalyClient::TooManyInvocationsError in after callback inside Grape::Middleware::Formatter : GitalyClient#call called 52 times from single request. Potential n+1?
13:48:58 rails-web.1              | The following call site called into Gitaly 9 times:
13:48:58 rails-web.1              | lib/gitlab/gitaly_client.rb:129:in `call'
13:48:58 rails-web.1              | lib/gitlab/gitaly_client/repository_service.rb:17:in `exists?'
13:48:58 rails-web.1              | lib/gitlab/git/repository.rb:133:in `exists?'
13:48:58 rails-web.1              | app/models/repository.rb:516:in `exists?'
13:48:58 rails-web.1              | lib/gitlab/repository_cache_adapter.rb:17:in `block (2 levels) in cache_method'
13:48:58 rails-web.1              | lib/gitlab/repository_cache.rb:22:in `fetch'
13:48:58 rails-web.1              | lib/gitlab/repository_cache_adapter.rb:59:in `cache_method_output'
13:48:58 gitlab-workhorse.1       | localhost:3000 127.0.0.1:55897 - - [2018/09/11:13:48:58 +0500] "GET /api/v4/projects HTTP/1.1" 500 39 "" "PostmanRuntime/7.2.0" 1.883
13:48:58 rails-web.1              | lib/gitlab/repository_cache_adapter.rb:16:in `block in cache_method'
13:48:58 rails-web.1              | app/models/project.rb:1361:in `default_branch'
13:48:58 rails-web.1              | lib/gitlab/query_limiting/middleware.rb:17:in `block in call'
13:48:58 rails-web.1              | lib/gitlab/query_limiting/transaction.rb:37:in `run'
13:48:58 rails-web.1              | lib/gitlab/query_limiting/middleware.rb:16:in `call'
13:48:58 rails-web.1              | lib/gitlab/webpack/dev_server_middleware.rb:25:in `perform_request'\nlib/gitlab/gitaly_client.rb:129:in `call'
13:48:58 rails-web.1              | lib/gitlab/gitaly_client/ref_service.rb:40:in `default_branch_name'
13:48:58 rails-web.1              | lib/gitlab/git/repository.rb:108:in `root_ref'
13:48:58 rails-web.1              | app/models/repository.rb:508:in `root_ref'
13:48:58 rails-web.1              | lib/gitlab/repository_cache_adapter.rb:17:in `block (2 levels) in cache_method'
13:48:58 rails-web.1              | lib/gitlab/repository_cache.rb:22:in `fetch'
13:48:58 rails-web.1              | lib/gitlab/repository_cache_adapter.rb:59:in `cache_method_output'
13:48:58 rails-web.1              | lib/gitlab/repository_cache_adapter.rb:16:in `block in cache_method'
13:48:58 rails-web.1              | app/models/project.rb:1361:in `default_branch'
13:48:58 rails-web.1              | lib/gitlab/query_limiting/middleware.rb:17:in `block in call'
13:48:58 rails-web.1              | lib/gitlab/query_limiting/transaction.rb:37:in `run'
13:48:58 rails-web.1              | lib/gitlab/query_limiting/middleware.rb:16:in `call'
13:48:58 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: Current User: sanadliaquat Using RVM: yes RVM Version: 1.29.4 Ruby Version: 2.4.4p296 Gem Version: 2.7.7 Bundler Version:1.16.4 Rake Version: 12.3.1 Redis Version: 4.0.11 Git Version: 2.18.0 Sidekiq Version:5.2.1 Go Version: go1.10.3 darwin/amd64

GitLab information Version: 11.3.0-pre Revision: 2f990e3408d Directory: /Users/sanadliaquat/work/gitlab/gdk-ce/gitlab DB Adapter: postgresql URL: http://localhost:3000 HTTP Clone URL: http://localhost:3000/some-group/some-project.git SSH Clone URL: ssh://sanadliaquat@localhost:2222/some-group/some-project.git Using LDAP: no Using Omniauth: no

GitLab Shell Version: 8.3.1 Repository storage paths:

  • default: /Users/sanadliaquat/work/gitlab/gdk-ce/repositories Hooks: /Users/sanadliaquat/work/gitlab/gdk-ce/gitlab-shell/hooks Git: /usr/local/bin/git
Assignee Loading
Time tracking Loading