GitLab not using Redis AUTH password
Summary
Using a separate Redis install with a password set. GitLab does not use the password, resulting in Redis::CommandError: NOAUTH Authentication required.
Steps to reproduce
Using omnibus with these settings in /etc/gitlabgitlab.rb
redis['enable'] = false
gitlab_rails['redis_socket'] = '/var/run/redis/socket'
gitlab_rails['redis_password'] = 'eqn098qq3t67q79c957q34q34rqkjrtnetbwqef'
When I run gitlab-ctl reconfigure
it adds the password to several files, but then it appears gitlab doesn't use them.
You can see the error by running /opt/gitlab/bin/gitlab-rake cache:clear
and the web logs (plus the web returns 500 errors).
If I disable the requirepass
in /etc/redis/redis.conf
, GitLab works even without a reconfiguration, showing that it isn't trying to use AUTH.
What is the current bug behavior?
GitLab is not using the Redis AUTH command.
What is the expected correct behavior?
GitLab should use Redis AUTH if it is specified in the configuration.
Relevant logs and/or screenshots
gitlab-ctl reconfigure
* templatesymlink[Create a config.yml and create a symlink to Rails root] action create
* template[/var/opt/gitlab/gitlab-shell/config.yml] action create
- update content in file /var/opt/gitlab/gitlab-shell/config.yml from de8ce5 to 6081fb
--- /var/opt/gitlab/gitlab-shell/config.yml 2017-12-27 18:32:03.536858553 -0500
+++ /var/opt/gitlab/gitlab-shell/.chef-config.yml20171227-5772-o4t2gd 2017-12-27 18:34:47.393433044 -0500
@@ -24,6 +24,7 @@
host: 127.0.0.1
port:
socket: /var/run/redis/socket
+ pass: eqn098qq3t67q79c957q34q34rqkjrtnetbwqef
database:
namespace: resque:gitlab
* link[Link /opt/gitlab/embedded/service/gitlab-shell/config.yml to /var/opt/gitlab/gitlab-shell/config.yml] action create (up to date)
rake
error:
root@server:/etc# /opt/gitlab/bin/gitlab-rake cache:clear
rake aborted!
Redis::CommandError: NOAUTH Authentication required.
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:11:in `block (5 levels) in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:10:in `loop'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:10:in `block (4 levels) in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis/wrapper.rb:17:in `block in with'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis/wrapper.rb:17:in `with'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:8:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => cache:clear => cache:clear:redis
(See full trace by running task with --trace)
Results of GitLab environment info
System information
System: Ubuntu 16.04
Current User: git
Using RVM: no
Ruby Version: 2.3.5p376
Gem Version: 2.6.13
Bundler Version:1.13.7
Rake Version: 12.3.0
Redis Version: 3.2.11
Git Version: 2.14.3
Sidekiq Version:5.0.4
Go Version: unknown
GitLab information
Version: 10.3.1
Revision: 63aec1b
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://git.example.com
HTTP Clone URL: https://git.example.com/some-group/some-project.git
SSH Clone URL: git@git.example.com:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 5.10.2
Repository storage paths:
- default: /home2/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
''' Checking GitLab Shell ...
GitLab Shell version >= 5.10.2 ? ... OK (5.10.2) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 4/1 ... ok 8/2 ... ok 31/3 ... ok 8/4 ... repository is empty 8/5 ... repository is empty 8/6 ... repository is empty 8/7 ... repository is empty 6/8 ... ok 6/9 ... ok 6/10 ... repository is empty 6/11 ... repository is empty 9/12 ... ok 2/13 ... ok 11/14 ... ok 11/15 ... ok 9/16 ... ok 14/18 ... ok 6/19 ... ok 6/20 ... ok 9/21 ... ok 1/24 ... ok 1/25 ... ok 8/26 ... ok 17/27 ... ok 1/28 ... ok 4/29 ... ok 18/30 ... ok 19/31 ... ok 2/32 ... ok 5/35 ... ok 5/36 ... ok 4/37 ... ok 20/38 ... ok 1/39 ... ok 2/40 ... ok 21/41 ... ok 19/42 ... repository is empty 2/43 ... ok 2/44 ... ok 22/45 ... ok 1/46 ... ok 2/47 ... ok 19/48 ... ok 2/49 ... ok 26/50 ... ok 26/51 ... ok 4/52 ... ok 2/53 ... ok 2/54 ... ok 29/55 ... ok 2/56 ... ok 2/57 ... ok 4/58 ... ok 31/59 ... ok 29/60 ... ok 31/61 ... ok 31/62 ... ok 31/63 ... ok 31/64 ... ok 34/65 ... ok 20/67 ... ok 20/68 ... ok 2/69 ... ok 2/70 ... ok 34/71 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
IMAP server credentials are correct? ... yes Init.d configured correctly? ... skipped MailRoom running? ... skipped
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 4/1 ... yes 8/2 ... yes 31/3 ... yes 8/4 ... yes 8/5 ... yes 8/6 ... yes 8/7 ... yes 6/8 ... yes 6/9 ... yes 6/10 ... yes 6/11 ... yes 9/12 ... yes 2/13 ... yes 11/14 ... yes 11/15 ... yes 9/16 ... yes 14/18 ... yes 6/19 ... yes 6/20 ... yes 9/21 ... yes 1/24 ... yes 1/25 ... yes 8/26 ... yes 17/27 ... yes 1/28 ... yes 4/29 ... yes 18/30 ... yes 19/31 ... yes 2/32 ... yes 5/35 ... yes 5/36 ... yes 4/37 ... yes 20/38 ... yes 1/39 ... yes 2/40 ... yes 21/41 ... yes 19/42 ... yes 2/43 ... yes 2/44 ... yes 22/45 ... yes 1/46 ... yes 2/47 ... yes 19/48 ... yes 2/49 ... yes 26/50 ... yes 26/51 ... yes 4/52 ... yes 2/53 ... yes 2/54 ... yes 29/55 ... yes 2/56 ... yes 2/57 ... yes 4/58 ... yes 31/59 ... yes 29/60 ... yes 31/61 ... yes 31/62 ... yes 31/63 ... yes 31/64 ... yes 34/65 ... yes 20/67 ... yes 20/68 ... yes 2/69 ... yes 2/70 ... yes 34/71 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.5) Git version >= 2.7.3 ? ... yes (2.14.3) Git user has default SSH configuration? ... yes Active users: ... 10
Checking GitLab ... Finished '''
Possible fixes
Haven't found it yet, but I will keep looking...