RedisAI/redisai-py

Client Authentication Timing Out

BnJam opened this issue · 4 comments

BnJam commented

The Client connection times out when trying to perform a tensorset/get after connecting to the remote server that requires a password. It returns a connection object and does not complain about a password being set.

The Client has host, port, and password all passed as arguments but still cannot perform any actions.

Client<ConnectionPool<Connection<host=XXX.XXX.XXX.XXX,port=6370,db=0>>>

Hi @BnJam Thanks for raising the issue. I have tried reproducing your issue in locally without any luck. I'll try to set up a remote and see if network has any effect on this. Can you tell me whether you have a connection timeout issue always or is it only on specific instances like when you try with big tensors etc?

BnJam commented

I always have a connection timeout. I have tried .ping() with no luck.

I should mention that this is trying to connect to a remote VM (in Azure) running the latest docker image of redisai, using the command:
sudo docker run --name test -v /path/to/redis_conf/redis.conf:/redis.conf -p 6379:6379 --gpus all -it --rm redisai/redisai:latest-gpu redis-server /redis.conf

I have bind commented out and requirepass set.
Having 127.0.0.1 or 0.0.0.0 in bind does not change anything.

The client is on a different Azure VM and attempting the following test snippet

import redisai
import numpy as np

if __name__ == '__main__':
     r = redisai.Client(host=<host>, port=<port>, password=<password>, db=0)
     print(r) # prints connection object no problem
     r.ping() # hangs and times out here
     r.tensorset('x', np.array([2]))
     r.tensorget('x')

I'm not even trying a big tensor.

BnJam commented

https://stackoverflow.com/questions/62768421/redisai-client-password-auth-process/62790078#62790078

I solved my issue with this workaround. I suspect that dropping the port argument (although, I can't seen to fully understand why that solved my connection issue) may in fact let me connect with a password.
As of right now, the redisai database is isolated on the VNet in Azure where the workers reside. However, I was first attempting to connect to an exposed database that required a password - I will test and report back here.

Closing this issue as it couldn't be reproduced. Feel free to re-open if you still face issues. Also, it might be worth looking at base redis package since the connection issue doesn't have to be specific to redisai-py