Getting Error running script while connecting to Redis Cluster
See original GitHub issueHi, We are getting error on all calls when using radis cluster with Rate Limiting. It works fine with Radis single installation but generates error when on cluster.
This is the error message: ERR Error running script (call to f_994f13794c36f8e043af773c406a67b398d52fd6): @user_script:1: @user_script: 1: Lua script attempted to access a non local key in a cluster node
Here is the error stack:
at AspNetCoreRateLimit.Redis.RedisProcessingStrategy.IncrementAsync(String counterId, TimeSpan interval, Func`1 RateIncrementer) in C:\Users\User\Documents\Github\AspNetCoreRateLimit\src\AspNetCoreRateLimit.Redis\RedisProcessingStrategy.cs:line 38
at AspNetCoreRateLimit.Redis.RedisProcessingStrategy.ProcessRequestAsync(ClientRequestIdentity requestIdentity, RateLimitRule rule, ICounterKeyBuilder counterKeyBuilder, RateLimitOptions rateLimitOptions, CancellationToken cancellationToken) in C:\Users\User\Documents\Github\AspNetCoreRateLimit\src\AspNetCoreRateLimit.Redis\RedisProcessingStrategy.cs:line 28
at AspNetCoreRateLimit.IpRateLimitProcessor.ProcessRequestAsync(ClientRequestIdentity requestIdentity, RateLimitRule rule, CancellationToken cancellationToken) in C:\Users\User\Documents\Github\AspNetCoreRateLimit\src\AspNetCoreRateLimit\Core\IpRateLimitProcessor.cs:line 52
at AspNetCoreRateLimit.RateLimitMiddleware`1.Invoke(HttpContext context) in C:\Users\User\Documents\Github\AspNetCoreRateLimit\src\AspNetCoreRateLimit\Middleware\RateLimitMiddleware.cs:line 56
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to fix the "Redis is busy running a script" error
The error means that there's a long-running server-side Lua script. Such a script is invoked by the EVAL or the EVALSHA Redis commands....
Read more >ReplyError: MOVED error after connecting to Redis Cluster ...
The MOVED error is caused by using the Redis client directly and the configuration endpoint of ElastiCache (Redis Cluster Mode).
Read more >Why can't I connect to my ElastiCache for Redis cluster?
Short description. Connectivity issues can have multiple root causes. The most common issues are: The cluster isn't ready. The cluster is unhealthy.
Read more >Script execution on redis-cluster reports "Lua ...
When I connect to redis using redis-cli and cluster mode, everything works fine. In my connection string I have tried setting only one...
Read more >ApsaraDB for Redis:Common Errors and Troubleshooting
This error is common in cluster instances. Solution: Modify the Lua script. You can query the slot in which a key resides by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sufyannisar I’m sorry. I forgot to actually create the PR after forking.
I have added a pull request for this issue. StackExchangeRedis automatically adds parameters to the necessary KEYS collection when passing the parameter as a “RedisKey” object. See https://stackexchange.github.io/StackExchange.Redis/Scripting.html
There should be no need to split the script into two separate scripts as they both use the same key.