Open
Description
Version: redis-py
5.0.0, redis
5.0.7-2ubuntu0.1
Platform: Ubuntu 20.04
Description:
The following script works with redis-py
4.6.0 but throws redis.exceptions.AuthenticationError: Authentication required.
with redis-py
5.0.0:
from redis import Redis
if __name__ == '__main__':
redis = Redis(
host='xxx',
port=1234,
ssl=True
)
redis.auth('xxx', 'xxx')
if redis.ping():
print('success')
(I obviously changed the host, port, username, and password).
This is using Ubuntu 20.04, and apt list
shows the redis version as 5.0.7-2ubuntu0.1
.
I'm not sufficiently knowledgeable to guess what information about the redis server would be useful, so please let me know.
Stack trace from v5.0:
Traceback (most recent call last):
File "auth.py", line 10, in <module>
redis.auth(password, username)
File "/home/ubuntu/nate-temp/python_peripheral_tools-0.8.0/venv/lib/python3.8/site-packages/redis/commands/core.py", line 417, in auth
return self.execute_command("AUTH", *pieces, **kwargs)
File "/home/ubuntu/nate-temp/python_peripheral_tools-0.8.0/venv/lib/python3.8/site-packages/redis/client.py", line 505, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File "/home/ubuntu/nate-temp/python_peripheral_tools-0.8.0/venv/lib/python3.8/site-packages/redis/connection.py", line 1073, in get_connection
connection.connect()
File "/home/ubuntu/nate-temp/python_peripheral_tools-0.8.0/venv/lib/python3.8/site-packages/redis/connection.py", line 271, in connect
self.on_connect()
File "/home/ubuntu/nate-temp/python_peripheral_tools-0.8.0/venv/lib/python3.8/site-packages/redis/connection.py", line 372, in on_connect
self.read_response()
File "/home/ubuntu/nate-temp/python_peripheral_tools-0.8.0/venv/lib/python3.8/site-packages/redis/connection.py", line 493, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
File "/home/ubuntu/nate-temp/python_peripheral_tools-0.8.0/venv/lib/python3.8/site-packages/redis/_parsers/resp2.py", line 15, in read_response
result = self._read_response(disable_decoding=disable_decoding)
File "/home/ubuntu/nate-temp/python_peripheral_tools-0.8.0/venv/lib/python3.8/site-packages/redis/_parsers/resp2.py", line 38, in _read_response
raise error
redis.exceptions.AuthenticationError: Authentication required.