andymccurdy/redis-py — Issue #228: ResponseError: Client sent AUTH, but no password is set
Author: gigimon
Created: 2012-02-28 12:08:25+00:00
State: open

Hello

In redis 2.4.7 with auth I'm have problem, after create a connection (r = redis.Redis(password='password', host='123.123.123.123') any first command create this exception. This problem only, if I'm connect to slave node. Commands after first work normal.

Full traceback

```python
In [14]: r = redis.Redis(password='password', host='123.123.123.123)

In [15]: r.set('asdasd','cxvcxv')
---------------------------------------------------------------------------
ResponseError Traceback (most recent call last)
/Users/aliens/Downloads/ in ()
----> 1 r.set('asdasd','cxvcxv')

/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/redis/client.pyc in set(self, name, value)
502 def set(self, name, value):
503 "Set the value at key ``name`` to ``value``"
--> 504 return self.execute_command('SET', name, value)
505 __setitem__ = set
506

/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/redis/client.pyc in execute_command(self, *args, **options)
276 connection = pool.get_connection(command_name, **options)
277 try:
--> 278 connection.send_command(*args)
279 return self.parse_response(connection, command_name, **options)
280 except ConnectionError:

/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/redis/connection.pyc in send_command(self, *args)
256 def send_command(self, *args):
257 "Pack and send a command to the Redis server"
--> 258 self.send_packed_command(self.pack_command(*args))
259
260 def read_response(self):

/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/redis/connection.pyc in send_packed_command(self, command)
239 "Send an already packed command to the Redis server"
240 if not self._sock:
--> 241 self.connect()
242 try:
243 self._sock.sendall(command)

/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/redis/connection.pyc in connect(self)
190
191 self._sock = sock
--> 192 self.on_connect()
193
194 def _connect(self):

/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/redis/connection.pyc in on_connect(self)
216 if self.password:
217 self.send_command('AUTH', self.password)
--> 218 if self.read_response() != 'OK':
219 raise AuthenticationError('Invalid Password')
220

/usr/local/Cellar/python/2.7.1/lib/python2.7/site-packages/redis/connection.pyc in read_response(self)
266 raise
267 if response.__class__ == ResponseError:
--> 268 raise response
269 return response
270

ResponseError: Client sent AUTH, but no password is set
```