question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting Error running script while connecting to Redis Cluster

See original GitHub issue

Hi, 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:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
aKzenTcommented, Dec 14, 2021

@sufyannisar I’m sorry. I forgot to actually create the PR after forking.

1reaction
aKzenTcommented, Dec 8, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found