redis / redis-rb

A Ruby client library for Redis
MIT License
3.97k stars 1.03k forks source link

AUTH failed with valid credentials, only with new versions of redis-tools / redis-cli #1204

Closed collimarco closed 1 year ago

collimarco commented 1 year ago

We have this Dockerfile for a Ruby on Rails application:

FROM ruby:3.2.2
RUN apt-get update && apt-get install -y redis-tools
...

Then we run this command to dump the Redis database:

`redis-cli -u 'redis://:#{Rails.configuration.redis[:password]}@#{Rails.configuration.redis[:host]}:#{Rails.configuration.redis[:port]}' --rdb #{path}`

This command has been working for years and we haven't changed anything (no changes to the credentials, no changes to the command).

Moreover the Rails application can still connect with the same credentials to Redis using the official redis gem.

That command that starts the redis-cli with the exact same credentials has started failing only in the last days. It fails with this error:

Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
AUTH failed: WRONGPASS invalid username-password pair

What has recently changed in redis-tools / redis-cli that can cause this? This seems a bug in the latest versions.

collimarco commented 1 year ago

redis-cli command works properly if I use -h, -p, -a instead of the URL (-u).

This seems a bug with the -u option.

byroot commented 1 year ago

This repo is only about the redis gem. redis-cli is in another repo