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.

node-redis v4 ReplyError: ERR Error running script

See original GitHub issue

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

github_iconTop GitHub Comments

2reactions
Feuerhamstercommented, Oct 6, 2021

I solved the problem by using ioredis. The reason I chose redis with the version 4.0.0-rc.2 is the support of promises. But ioredis also have promises and works without any exceptions with rate-limiter-flexible.

1reaction
animircommented, Mar 17, 2022

In rate-limiter-flexible version 2.x redis package v4+ works with legacyMode enabled. See this comment for context.

Read more comments on GitHub >

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

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