andymccurdy/redis-py — Issue #208: Permission Denied
Author: vikithakar
Created: 2011-11-02 18:00:30+00:00
State: open

I am trying to save a redis key using a simple python cgi script.

This is my Python script (test.py)
#!/usr/bin/python
print 'Content-type: text/html\n\n'
import redis

vred = redis.Redis('192.168.2.3')
vred.set('viuki','askdfh')
vred.save()

when it try to execute this script using http://192.168.2.3/cgi-bin/test.py it gives me following error.

[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] vred.set('viuki','askdfh')
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] File "/usr/lib/python2.6/site-packages/redis/client.py", line 469, in set
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1]
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] return self.execute_command('SET', name, value)
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] File "/usr/lib/python2.6/site-packages/redis/client.py", line 255, in execute_command
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1]
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] connection.send_command(*args)
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] File "/usr/lib/python2.6/site-packages/redis/connection.py", line 218, in send_command
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1]
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] self.send_packed_command(self.pack_command(*args))
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] File "/usr/lib/python2.6/site-packages/redis/connection.py", line 201, in send_packed_command
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1]
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] self.connect()
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] File "/usr/lib/python2.6/site-packages/redis/connection.py", line 149, in connect
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1]
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] raise ConnectionError(self._error_message(e))
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] redis.exceptions
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] .
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] ConnectionError
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] :
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1] Error 13 connecting 192.168.2.3:6379. Permission denied.
[Wed Nov 02 23:07:12 2011] [error] [client 127.0.0.1]

I have compiled the latest redis-2.4.2 version and used it successfully from remote connections too. Please help.

Vivek Thakar
http://www.vivekthakar.me