4

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:

enter image description here

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.

enter image description here

Are there other issues that might throw this exception?

EDIT: Upgraded to 2.0. Still suffering from the same issues.

asked Dec 8, 2019 at 7:43

1 Answer 1

1

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.

answered Dec 9, 2019 at 8:59
Sign up to request clarification or add additional context in comments.

2 Comments

Sadly, the 2.+ packages suffer from other issues I am unable to work around (see this). In short, even when using Nuget to download packages and dependencies, it still fails to find certain specific versions of dlls (such as System.Memory)
Updated (through a lot of effort) to the 2.0+ packages, and now I have the exact same issue :(

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.