joanvila/aioredlock

aioredis.errors.ReplyError: ERR ERROR

Opened this issue · 2 comments

image

image
image
when I run this code in a FastApi app, I got error below:

Traceback (most recent call last):
  File "/usr/local/python3.9/lib/python3.9/site-packages/aioredlock/redis.py", line 198, in set_lock
    await redis.evalsha(
aioredis.errors.ReplyError: ERR ERROR

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/python3.9/lib/python3.9/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/usr/local/python3.9/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/python3.9/lib/python3.9/site-packages/fastapi/applications.py", line 276, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/python3.9/lib/python3.9/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/python3.9/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/usr/local/python3.9/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/python3.9/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/usr/local/python3.9/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/python3.9/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/usr/local/python3.9/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/python3.9/lib/python3.9/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/python3.9/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/usr/local/python3.9/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/usr/local/python3.9/lib/python3.9/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/usr/local/python3.9/lib/python3.9/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/home/martin/main.py", line 765, in sale
    lock = await lock_manager.lock(key, lock_timeout=10,
  File "/usr/local/python3.9/lib/python3.9/site-packages/aioredlock/algorithm.py", line 142, in lock
    await self._set_lock(resource, lock_identifier, lease_time)
  File "/usr/local/python3.9/lib/python3.9/site-packages/aioredlock/algorithm.py", line 92, in _set_lock
    raise error
  File "/usr/local/python3.9/lib/python3.9/site-packages/aioredlock/algorithm.py", line 77, in _set_lock
    elapsed_time = await self.redis.set_lock(resource, lock_identifier, lease_time)
  File "/usr/local/python3.9/lib/python3.9/site-packages/aioredlock/redis.py", line 355, in set_lock
    raise_error(successes, 'Can not acquire the lock "%s"' % resource)
  File "/usr/local/python3.9/lib/python3.9/site-packages/aioredlock/redis.py", line 26, in raise_error
    raise [e for e in errors if type(e) is LockAcquiringError][0]
  File "/usr/local/python3.9/lib/python3.9/site-packages/aioredlock/redis.py", line 208, in set_lock
    raise LockAcquiringError('Can not set lock') from exc
aioredlock.errors.LockAcquiringError: Can not set lock

Same proplem! Any ideas for this?

Is this repo no longer maintained? BTW, I saw that some plans for aioredis 2.0 support seem to have been shelved.