Search code examples
redisluaredis-sentinelredis-cli

cannot run passed Lua script to Redis: This Redis command is not allowed from scripts


I have three instances of Redis server running sentinel and a Lua script in order to let the redis_exporter gather the list of connected clients to the Redis server. but when I pass the script to the redis-cli command I get the following error:

(error) ERR Error running script (call to f_4c6be190ef2981eda70d58ec0c959bd1ca2c5352): @user_script:10: @user_script: 10: This Redis command is not allowed from scripts

This is my Lua script:

local r = redis.call("CLIENT", "LIST")
return r

Is there any way to fix this problem?


Solution

  • A quick google seems the issue is coming from the redis server itself, not the library.

    The CLIENT command has a no-script flag

    enter image description here

    https://github.com/antirez/redis/blob/fe5aea38c35e3fc35a744ad2de73543df553ae48/src/sentinel.c