Error when Redis password contains chars that should be URL-encoded
Using official Docker image gitlab/gitlab-ce:9.5.9-ce.0
I get the following error if the Redis password contains characters that should be URL-encoded.
Example, with a password of git/lab, I receive the following stack trace:
URI::InvalidURIError: bad URI(is not URI?): redis://:git/lab@glce-redis/
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis.rb:74:in `redis_store_options'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis.rb:54:in `params'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis.rb:15:in `params'
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:146:in `<class:Application>'
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:8:in `<module:Gitlab>'
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:7:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/Rakefile:5:in `require'
/opt/gitlab/embedded/service/gitlab-rails/Rakefile:5:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:22:in `load'
/opt/gitlab/embedded/bin/bundle:22:in `<main>'
(See full trace by running task with --trace)
It's clear that the URI is malformed because the password was not URL-encoded before it was used in constructing the connection string.
I've been unable to test this with a newer version of GitLab CE (I'm admittedly using an older, deprecated Helm chart and cannot assume compatibility between it and GitLab CE 10.x), but perusing the code, I am fairly certain this issue still exists right here: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/libraries/redis_uri.rb#L45-49
fwiw, I have tried to work around this by pre-URL-encoding the password myself. It avoids the error reported above, but still seems not to work, as I receive an "invalid password" error. (Sorry-- don't have the trace for that handy.) Presumably, this is because there is elsewhere in the code that the password is being used other than in that connection string and its wrong because of the encoding I pre-applied.