Coder Social home page Coder Social logo

Comments (2)

Grokzen avatar Grokzen commented on June 16, 2024

@Vector-Cross Your error is clear as day what the problem is redis.exceptions.ResponseError: WRONGPASS invalid username-password pair or user is disabled. it is not a problem of reaching your nodes in any way. You get there and commands is sent there. The problem is that either your password you provided in your python code is wrong, or you have not deployed the correct password to all nodes in your cluster.

The only case you have here tho is that if you can show you configured the password correct and that you can prove that when sending the authentication command, the password is not the same as your variable REDIS_PASSWORD

from redis-py-cluster.

Vector-Cross avatar Vector-Cross commented on June 16, 2024

I'm pretty sure the REDIS_PASSWORD is correct. My problem is I cann't connect the first node.
How to explain the following cases.
First, check password. code passed.

>>> from rediscluster import RedisCluster
>>> startup_nodes = [
...     {"host": "192.168.0.113", "port": 6379},
...     {"host": "192.168.0.113", "port": 6380},
...     {"host": "192.168.0.114", "port": 6379},   【# key "test" in this Node, can connect when not the first config】
...     {"host": "192.168.0.114", "port": 6380},
...     {"host": "192.168.0.115", "port": 6379},
...     {"host": "192.168.0.115", "port": 6380}
... ]
>>> redis_store = RedisCluster(
...     startup_nodes=startup_nodes,
...     skip_full_coverage_check=True,
...     password='Lj12369874.')
>>> redis_store.get("test")    【# Now can connect, means PASSWORD is correct】
【b'OK'】

Code not pass when Switch the squence of Startup_nodes

>>> from rediscluster import RedisCluster
>>> startup_nodes = [
...     {"host": "192.168.0.114", "port": 6379},   【# key "test" in this Node, switch to top cann't connect】
...     {"host": "192.168.0.113", "port": 6379},
...     {"host": "192.168.0.113", "port": 6380},
...     {"host": "192.168.0.114", "port": 6380},
...     {"host": "192.168.0.115", "port": 6379},
...     {"host": "192.168.0.115", "port": 6380}
... ]
>>> redis_store = RedisCluster(
...     startup_nodes=startup_nodes,
...     skip_full_coverage_check=True,
...     password='Lj12369874.')
>>> redis_store.get("test")    【# Now can not connect, just switch the squence of Startup_nodes】
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/redis/client.py", line 1606, in get
    return self.execute_command('GET', name)
  File "/usr/local/lib/python3.7/site-packages/rediscluster/client.py", line 555, in execute_command
    return self._execute_command(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/rediscluster/client.py", line 714, in _execute_command
    raise e
  File "/usr/local/lib/python3.7/site-packages/rediscluster/client.py", line 630, in _execute_command
    connection.send_command(*args)
  File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 726, in send_command
    check_health=kwargs.get('check_health', True))
  File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 698, in send_packed_command
    self.connect()
  File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 567, in connect
    self.on_connect()
  File "/usr/local/lib/python3.7/site-packages/rediscluster/connection.py", line 60, in on_connect
    super(ClusterConnection, self).on_connect()
  File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 643, in on_connect
    auth_response = self.read_response()
  File "/usr/local/lib/python3.7/site-packages/redis/connection.py", line 756, in read_response
    raise response
redis.exceptions.ResponseError: WRONGPASS invalid username-password pair or user is disabled.

@Grokzen

from redis-py-cluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.