-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restart redis than get Redis::CommandError: NOSCRIPT No matching script. Please use EVAL. #148
Comments
I had the exact same issue. After debugging for a few hours, I found that this was due to a change in
As for the solution, I downgraded the gem to # config/initializers/redlock.rb
module Redlock
class Client
private
class RedisInstance
private
def recover_from_script_flush
retry_on_noscript = true
begin
yield
rescue RedisClient::CommandError, Redis::CommandError => e # <= ADDED Redis::CommandError
# When somebody has flushed the Redis instance's script cache, we might
# want to reload our scripts. Only attempt this once, though, to avoid
# going into an infinite loop.
if retry_on_noscript && e.message.include?('NOSCRIPT')
load_scripts
retry_on_noscript = false
retry
else
raise
end
end
end
end
end
end |
Wouldn't the "recommended" fix be, to use Note that you would probably need redis 6+ with RESP3 support. |
… script. Please use EVAL." error. See leandromoreira/redlock-rb#148 for more info.
… script. Please use EVAL.' error. See leandromoreira/redlock-rb#148 for more info.
Thank you @jakephot for the monkey-patch! It saved my day. I wonder why this bug is still not solved though. |
Hmm, in my case I didn't need the entire monkey-patch. I was already trying to rescue |
Updating the from |
Hello redlock team,
I just started to use redlock yesterday.
After I restart my redis server, I get this error when using
Redlock::Client lock
It seems redis cannot find the script.
Do you know how to fix this?
Thanks,
Larry
The text was updated successfully, but these errors were encountered: