Invalid URI error while connecting to Redis backend
Issue
Current configuration has no authentication to backend redis. Below is the existing string.
redis://backend-redis:6379/1
I am trying to implement auth.
I created a new service and changed the string as below.
redis://abcdef@haproxy:6379/1 (where abcdef is the password)
Once setting the above I redeployed the backend-worker deployment.
I saw the initContainer going into error state and below are the logs.
# oc logs -f backend-worker-1-abcde -c backend-redis-svc
`/home` is not writable.
Bundler will use `/tmp/bundler20220531-1-fvsfcy1' as your home directory temporarily.
rake aborted!
ThreeScale::Backend::Storage::InvalidURI: The provided URL "redis://abcedf@haproxy:6379/1\n" is not valid: bad URI(is not URI?): "redis://abcdef@haproxy:6379/1\n"
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/storage_helpers.rb:144:in `rescue in rescue in to_redis_uri'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/storage_helpers.rb:140:in `rescue in to_redis_uri'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/storage_helpers.rb:137:in `to_redis_uri'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/storage_helpers.rb:181:in `ensure_url_param'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/storage_helpers.rb:103:in `config_with'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/queue_storage.rb:9:in `connection'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend.rb:57:in `<top (required)>'
/opt/ruby/apisonator-3.4.3/Rakefile:4:in `require'
/opt/ruby/apisonator-3.4.3/Rakefile:4:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Caused by:
URI::InvalidURIError: bad URI(is not URI?): "redis://abcedf@haproxy:6379/1\n"
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/storage_helpers.rb:157:in `validate_redis_uri'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/storage_helpers.rb:141:in `rescue in to_redis_uri'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/storage_helpers.rb:137:in `to_redis_uri'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/storage_helpers.rb:181:in `ensure_url_param'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/storage_helpers.rb:103:in `config_with'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend/queue_storage.rb:9:in `connection'
/opt/ruby/apisonator-3.4.3/lib/3scale/backend.rb:57:in `<top (required)>'
/opt/ruby/apisonator-3.4.3/Rakefile:4:in `require'
/opt/ruby/apisonator-3.4.3/Rakefile:4:in `<top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Please let me know if we can add auth to Redis connection string related to 3scale backend.
Environment
- Red Hat 3scale API Management
- 2.x On-Premises
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.