First reconfigure on HA Redis nodes results in failure due to `gitlab-rake cache:clear`
In testing Omnibus HA Redis by following the docs at https://docs.gitlab.com/ee/administration/high_availability/redis.html, I ran into an initial reconfigure failure.
Non-application nodes should not attempt a cache clear.
Configuration
# Specify server role as 'redis_master_role'
roles ['redis_master_role']
gitlab_rails['auto_migrate'] = false
# IP address pointing to a local IP that the other machines can reach to.
# You can also set bind to '0.0.0.0' which listen in all interfaces.
# If you really need to bind to an external accessible IP, make
# sure you add extra firewall rules to prevent unauthorized access.
redis['bind'] = '123.123.123.123'
# Define a port so Redis can listen for TCP requests which will allow other
# machines to connect to it.
redis['port'] = 6379
# Set up password authentication for Redis (use the same password in all nodes).
redis['password'] = 'super_secret'
Reconfigure failure
================================================================================
Error executing action `run` on resource 'execute[clear the gitlab-rails cache]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received ''
---- Begin output of /opt/gitlab/bin/gitlab-rake cache:clear ----
STDOUT:
STDERR:
---- End output of /opt/gitlab/bin/gitlab-rake cache:clear ----
Ran /opt/gitlab/bin/gitlab-rake cache:clear returned
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb
368: execute "clear the gitlab-rails cache" do
369: command "/opt/gitlab/bin/gitlab-rake cache:clear"
370: action :nothing
371: not_if { omnibus_helper.not_listening?('redis') || !node['gitlab']['gitlab-rails']['rake_cache_clear'] }
372: end
373:
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb:368:in `from_file'
execute("clear the gitlab-rails cache") do
action [:nothing]
retries 0
retry_delay 2
default_guard_interpreter :execute
command "/opt/gitlab/bin/gitlab-rake cache:clear"
backup 5
returns 0
declared_type :execute
cookbook_name "gitlab"
recipe_name "gitlab-rails"
not_if { #code block }
end
Platform:
---------
x86_64-linux
Recipe: gitlab::redis
* ruby_block[reload redis svlogd configuration] action create
- execute the ruby block reload redis svlogd configuration
Recipe: gitlab::logrotate
* ruby_block[reload logrotate svlogd configuration] action create
- execute the ruby block reload logrotate svlogd configuration
Recipe: gitlab::node-exporter
* ruby_block[reload node-exporter svlogd configuration] action create
- execute the ruby block reload node-exporter svlogd configuration
Recipe: gitlab::redis-exporter
* ruby_block[reload redis-exporter svlogd configuration] action create
- execute the ruby block reload redis-exporter svlogd configuration
Running handlers:
There was an error running gitlab-ctl reconfigure:
execute[clear the gitlab-rails cache] (gitlab::gitlab-rails line 368) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ''
---- Begin output of /opt/gitlab/bin/gitlab-rake cache:clear ----
STDOUT:
STDERR:
---- End output of /opt/gitlab/bin/gitlab-rake cache:clear ----
Ran /opt/gitlab/bin/gitlab-rake cache:clear returned