Redis::MultiStore misbehaves on code reload
Summary
When code changes in GDK, pages fail to load with a NoMethodError
from Redis::MultiStore
. An excerpt from log/exceptions_json.log
:
"exception.class": "NoMethodError",
"exception.message": "undefined method `get' for nil:NilClass",
"exception.backtrace": [
"lib/gitlab/redis/multi_store.rb:177:in `block (2 levels) in <class:MultiStore>'",
"lib/gitlab/redis/multi_store_connection_pool.rb:10:in `block in with'",
"lib/gitlab/redis/multi_store_connection_pool.rb:9:in `with'",
"lib/gitlab/repository_cache.rb:33:in `read'",
"lib/gitlab/repository_cache.rb:41:in `fetch_without_caching_false'",
"lib/gitlab/repository_cache_adapter.rb:190:in `block (2 levels) in cache_method_output_asymmetrically'",
"lib/gitlab/repository_cache.rb:25:in `fetch'",
"lib/gitlab/repository_cache_adapter.rb:189:in `block in cache_method_output_asymmetrically'",
"lib/gitlab/repository_cache_adapter.rb:203:in `block in memoize_method_output'",
"lib/gitlab/repository_cache_adapter.rb:212:in `no_repository_fallback'",
"lib/gitlab/repository_cache_adapter.rb:202:in `memoize_method_output'",
"lib/gitlab/repository_cache_adapter.rb:188:in `cache_method_output_asymmetrically'",
"lib/gitlab/repository_cache_adapter.rb:94:in `block in cache_method_asymmetrically'",
"app/models/repository.rb:573:in `empty?'",
"app/models/concerns/has_repository.rb:71:in `empty_repo?'",
"app/models/protected_branch.rb:47:in `protected?'",
"lib/gitlab/user_access.rb:140:in `protected?'",
Steps to reproduce
With an up-to-date and freshly restarted GDK, change any line of backend code and try to load e.g. the GDK home page
Example Project
What is the current bug behavior?
The page fails to load with the above NoMethodError
What is the expected correct behavior?
The page should load
Relevant logs and/or screenshots
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
Edited by Hordur Freyr Yngvason