I'm trying to implement Redis in an ASP.NET WebForms application (4.7.2). I downloaded the SessionProvider source code from https://github.com/Azure/aspnet-redis-providers. I'm using StackExchange.Redis 2.0+ .
After the login has been executed, this error is thrown:
Apparently, an attempt to eval
some Lua script was made, and it failed (that was the conclusion for the closure of the StackExchange.Redis related issue).
So, assuming that assumption is correct, I extracted the offending script, and ran it with redis-cli --eval
along with the keys and arguments.
local retArray = {}
local lockValue = ARGV[1]
local locked = redis.call('SETNX',KEYS[1],ARGV[1])
local IsLocked = true
if locked == 0 then
lockValue = redis.call('GET',KEYS[1])
else
redis.call('EXPIRE',KEYS[1],ARGV[2])
IsLocked = false
end
retArray[1] = lockValue
if lockValue == ARGV[1] then retArray[2] = redis.call('HGETALL',KEYS[2]) else retArray[2] = '' end
local SessionTimeout = redis.call('HGET', KEYS[3], 'SessionTimeout')
if SessionTimeout ~= false then
retArray[3] = SessionTimeout
redis.call('EXPIRE',KEYS[2], SessionTimeout)
redis.call('EXPIRE',KEYS[3], SessionTimeout)
else
retArray[3] = '-1'
end
retArray[4] = IsLocked
return retArray
It was successful.
Are there other issues that might throw this exception?
EDIT: Upgraded to 2.0. Still suffering from the same issues.
I tried to research for your issue, and then I found there is an issue No connection is available to service this operation using v.1.2.6 #762 of GitHub StackExchange/StackExchange.Redis
repo which seems to be same with yours.
According to the note of a comment at the bottom of the GitHub issue, the other issue The "network stability" / 2.0 / "pipelines" rollup issue #871, there are some bugs need to be fixed for the version under 2.0
, which likes network connection stability
issue.
So I suggested that you can upgrade your current StackExchange.Redis (V1.2.6)
to a latest stable 2.x
version and try your code again. Meanwhile, please notice the Release Notes
of Azure/aspnet-redis-providers
to make the right and compatible versions to support your current code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With