Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Lock method does not work #20

Open
RafaelAcostaQ2 opened this issue Dec 9, 2016 · 2 comments
Open

Lock method does not work #20

RafaelAcostaQ2 opened this issue Dec 9, 2016 · 2 comments

Comments

@RafaelAcostaQ2
Copy link

RafaelAcostaQ2 commented Dec 9, 2016

Hi,
I'm not sure what am I doing wrong but I haven't being able to use this package. It is exactly what I need but for some reason it throws an error when I try to lock a resource.

redis_version:2.4.10

python version 3.5.2

This is my code

from redlock import Redlock
dlm = Redlock([{"host": "REDIS_SERVER_IP", "port": 6379, "db": 0}, ])

Acquire lock for 1 minute

my_lock = dlm.lock("this_is_my_key",1000)

ERROR:root:Error unlocking resource this_is_my_key in server StrictRedis<ConnectionPool<Connection<host=X.X.X.X,port=6379,db=0>>>
Traceback (most recent call last):
File "/home/redis/apps/Proj/env/lib/python3.5/site-packages/redlock/init.py", line 80, in unlock_instance
server.eval(self.unlock_script, 1, resource, val)
File "/home/redis/apps/Proj/env/lib/python3.5/site-packages/redis/client.py", line 1932, in eval
return self.execute_command('EVAL', script, numkeys, *keys_and_args)
File "/home/redis/apps/Proj/env/lib/python3.5/site-packages/redis/client.py", line 573, in execute_command
return self.parse_response(connection, command_name, **options)
File "/home/redis/apps/Proj/env/lib/python3.5/site-packages/redis/client.py", line 585, in parse_response
response = connection.read_response()
File "/home/redis/apps/Proj/env/lib/python3.5/site-packages/redis/connection.py", line 582, in read_response
raise response
redis.exceptions.ResponseError: unknown command 'EVAL'

Thanks in advanced!

@NadiaSama
Copy link

Hi my english is not very well.
It seems the version of your redis server is too low you should update it to v2.6.0 or later.EVAL command

@jheld
Copy link

jheld commented Dec 28, 2017

Can this result in a different raised exception? Something to the tune of your version of redis-server is too old?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants