Gitlab has issues when Redis is configured to use authentication
Created by: brodock
I have setup Redis on a remote machine (for some reasons) and it requires authentication (AUTH command).
To setup sidekiq I have changed resque.yml file to include the password as following:
production: redis://user:heregoesmypassword@remoteserveraddress:6379
I also had to edit initializers/session_store.rb because it's running on an external server:
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index f80b67a..f1f3f56 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,4 +1,11 @@
# Be sure to restart your server when you modify this file.
+ config_file = Rails.root.join('config', 'resque.yml')
+
+ resque_url = if File.exists?(config_file)
+ YAML.load_file(config_file)[Rails.env]
+ else
+ "redis://localhost:6379"
+ end
Gitlab::Application.config.session_store(
:redis_store, # Using the cookie_store would enable session replay attacks.
@@ -6,5 +13,6 @@ Gitlab::Application.config.session_store(
key: '_gitlab_session',
secure: Gitlab.config.gitlab.https,
httponly: true,
- path: (Rails.application.config.relative_url_root.nil?) ? '/' : Rails.application.config.relative_url_root
+ path: (Rails.application.config.relative_url_root.nil?) ? '/' : Rails.application.config.relative_url_root,
+ servers: resque_url
)
this is the output of rake gitlab:check:
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories: OK
/home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.6
Send ping to redis server: (error) NOAUTH Authentication required.
gitlab-shell self-check successful
Everything works fine if I don't use AUTH. If I start using authentication, It "apears" to work ok, except for the check rake task, but it doesn't receive/process any sidekiq task. Acessing sidekiq dashboard shows zeroed stats.