node-redis v4 ReplyError: ERR Error running script
See original GitHub issueHello, I got a weird exception after implementing RateLimiterRedis
like in your wiki: https://github.com/animir/node-rate-limiter-flexible/wiki/Redis
Here is the exception I got:
ReplyError: ERR Error running script (call to f_a1de965f42e177aa339706bd580f049065eca79a): @user_script:1: @user_script: 1: Lua redis() command arguments must be strings or integers
Here is my code:
async consume(ip) {
if (!this.limiter) return;
let res = false;
try {
res = await this.limiter.consume(ip);
} catch (e) {
if (e instanceof Error) {
console.log("RATE LIMITER ERROR:", e.message);
} else {
return false;
}
}
return res;
}
rate-limiter-flexible version: 2.3.1 redis version: 4.0.0-rc.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
ReplyError: ERR Error running script user_script:72: too many ...
I get this error when running in our AWS env which uses an ElasticCache instance for Redis. This error was delivered to the...
Read more >ERR unknown command JSON.SET" with Redis? - Stack ...
Error: ReplyError: ERR unknown command JSON.SET, with args beginning with: test_node, ., {"node":"blah"},.
Read more >Redis giving "ERR Error running script" - memory > maxmemory
Ken, good question. Sitecore maintains an ASP.NET Session state outside the process to share between CDs (in fact 2 session states).
Read more >Redis - npm
Start using redis in your project by running `npm i redis`. ... client.on('error', (err) => console.log('Redis Client Error', err)); ...
Read more >NodeRedis/node_redis - Gitter
ReplyError : ERR Error running script (call to f_f621864bb26fd35dd5dc6c76be7468d449d9f932): @user_script:1: @user_script: 1: Wrong number of args calling Redis ...
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
I solved the problem by using
ioredis
. The reason I choseredis
with the version4.0.0-rc.2
is the support of promises. Butioredis
also have promises and works without any exceptions withrate-limiter-flexible
.In
rate-limiter-flexible
version2.x
redis
package v4+ works withlegacyMode
enabled. See this comment for context.