錯誤碼分類 | 錯誤碼 | 說明 |
Redis Cluster 架構限制 | -ERR for redis cluster, eval/evalsha number of keys can't be negative or zero\r\n
| 執行Lua時必須帶有Key,Proxy會根據Key決定將Lua轉寄到哪個DB分區上執行。
# 正確樣本
EVAL "return redis.call('get', KEYS[1])" 1 fooeval
# 錯誤樣本
EVAL "return redis.call('get', 'foo')" 0
|
-ERR 'xxx' command keys must in same slot
| Lua指令碼中的多個Key必須屬於同一個Slot。
# 正確樣本:
EVAL "return redis.call('mget', KEYS[1], KEYS[2])" 2 foo {foo}bar
# 錯誤樣本:
EVAL "return redis.call('mget', KEYS[1], KEYS[2])" 2 foo foobar
|
Proxy Lua語法檢查導致的額外限制 (關閉 script_check_enable 配置可以避免該檢查) | -ERR bad lua script for redis cluster, nested redis.call/redis.pcall
| 不支援Redis嵌套方式調用,您可以使用局部變數的方式進行調用。
# 正確樣本
EVAL "local value = redis.call('GET', KEYS[1]); redis.call('SET', KEYS[2], value)" 2 foo bar
# 錯誤樣本
EVAL "redis.call('SET', KEYS[1], redis.call('GET', KEYS[2]))" 2 foo bar
|
-ERR bad lua script for redis cluster, first parameter of redis.call/redis.pcall must be a single literal string
| redis.call/pcall中調用的命令必須是字串常量。
# 正確樣本
eval "redis.call('GET', KEYS[1])" 1 foo
# 錯誤樣本
eval "local cmd = 'GET'; redis.call(cmd, KEYS[1])" 1 foo
|
-ERR bad lua script for redis cluster, all the keys that the script uses should be passed using the KEYS array\r\n
| 所有Key都應該由KEYS數組來傳遞,redis.call/pcall中調用的命令,Key的位置必須是KEYS array,且不能使用Lua變數替換KEYS。 說明 僅Redis開源版 5.0版本(小版本5.0.8以下)、4.0及以下版本執行個體或Proxy代理版本較低(雲原生版7.0.2以下 、經典版6.8.12以下)存在該限制。 如果執行個體版本、代理版本都符合要求但仍存在限制,請修改任意參數(例如query_cache_expire參數),等待1分鐘後重試。
# 正確樣本:
EVAL "return redis.call('mget', KEYS[1], KEYS[2])" 2 foo {foo}bar
# 錯誤樣本:
EVAL "return redis.call('mget', KEYS[1], '{foo}bar')" 1 foo # '{foo}bar'作為Key,應該使用KEYS數組進行傳遞。
EVAL "local i = 2 return redis.call('mget', KEYS[1], KEYS[i])" 2 foo {foo}bar # 在代理模式(Proxy)不允許執行此指令碼,因為KEYS資料的索引是變數,但在直連模式中無此限制。
EVAL "return redis.call('mget', KEYS[1], ARGV[1])" 1 foo {foo}bar # 不應該使用ARGV[1]資料元素作為Key。
|
-ERR bad lua script for redis cluster, all the keys that the script uses should be passed using the KEYS array, include destination, and KEYS should not be in expression
| ZUNIONSTORE、ZINTERSTORE命令的destination參數必須用KEYS傳遞。 說明 僅Redis開源版 5.0版本(小版本5.0.8以下)、4.0及以下版本執行個體或Proxy代理版本較低(雲原生版7.0.2以下 、經典版6.8.12以下)存在該限制。 如果執行個體版本、代理版本都符合要求但仍存在限制,請修改任意參數(例如query_cache_expire參數),等待1分鐘後重試。 |
-ERR bad lua script for redis cluster, ZUNIONSTORE/ZINTERSTORE numkeys parameter should be a single number and not expression
| ZUNIONSTORE、ZINTERSTORE命令的numkeys參數不是常量。 說明 僅Redis開源版 5.0版本(小版本5.0.8以下)、4.0及以下版本執行個體或Proxy代理版本較低(雲原生版7.0.2以下 、經典版6.8.12以下)存在該限制。 如果執行個體版本、代理版本都符合要求但仍存在限制,請修改任意參數(例如query_cache_expire參數),等待1分鐘後重試。 |
-ERR bad lua script for redis cluster, ZUNIONSTORE/ZINTERSTORE numkeys value is not an integer or out of range
| ZUNIONSTORE、ZINTERSTORE命令的numkeys參數不是數字。 說明 僅Redis開源版 5.0版本(小版本5.0.8以下)、4.0及以下版本執行個體或Proxy代理版本較低(雲原生版7.0.2以下 、經典版6.8.12以下)存在該限制。 如果執行個體版本、代理版本都符合要求但仍存在限制,請修改任意參數(例如query_cache_expire參數),等待1分鐘後重試。 |
-ERR bad lua script for redis cluster, ZUNIONSTORE/ZINTERSTORE all the keys that the script uses should be passed using the KEYS array
| ZUNIONSTORE、ZINTERSTORE命令的所有Key必須通過KEYS傳遞。 說明 僅Redis開源版 5.0版本(小版本5.0.8以下)、4.0及以下版本執行個體或Proxy代理版本較低(雲原生版7.0.2以下 、經典版6.8.12以下)存在該限制。 如果執行個體版本、代理版本都符合要求但仍存在限制,請修改任意參數(例如query_cache_expire參數),等待1分鐘後重試。 |
-ERR bad lua script for redis cluster, XREAD/XREADGROUP all the keys that the script uses should be passed using the KEYS array | XREAD、XREADGROUP命令的所有Key必須通過KEYS傳遞。 說明 僅Redis開源版 5.0版本(小版本5.0.8以下)、4.0及以下版本執行個體或Proxy代理版本較低(雲原生版7.0.2以下 、經典版6.8.12以下)存在該限制。 如果執行個體版本、代理版本都符合要求但仍存在限制,請修改任意參數(例如query_cache_expire參數),等待1分鐘後重試。 |
-ERR bad lua script for redis cluster, all the keys that the script uses should be passed using the KEYS array, and KEYS should not be in expression, sort command store key does not meet the requirements
| SORT命令的Key必須通過KEYS傳遞。 說明 僅Redis開源版 5.0版本(小版本5.0.8以下)、4.0及以下版本執行個體或Proxy代理版本較低(雲原生版7.0.2以下 、經典版6.8.12以下)存在該限制。 如果執行個體版本、代理版本都符合要求但仍存在限制,請修改任意參數(例如query_cache_expire參數),等待1分鐘後重試。 |
讀寫權限問題 | -ERR Write commands are not allowed from read-only scripts
| 通過EVAL_RO命令發送的Lua中不能包含寫命令。 |
-ERR bad write command in no write privilege
| 唯讀帳號發送的Lua中不能包含寫命令。 |
命令未支援 | -ERR script debug not support
| Proxy當前不支援SCRIPT DEBUG命令。 |
-ERR bad lua script for redis cluster, redis.call/pcall unkown redis command xxx
| Lua中包含Proxy不支援的命令。更多資訊請參見叢集架構與讀寫分離執行個體的命令限制。 |
Lua 語法錯誤 | -ERR bad lua script for redis cluster, redis.call/pcall expect '('
-ERR bad lua script for redis cluster, redis.call/redis.pcall definition is not complete, expect ')'
| Lua語法錯誤,redis.call 後面必須包含完整的( 與) 。 |
-ERR bad lua script for redis cluster, at least 1 input key is needed for ZUNIONSTORE/ZINTERSTORE
| ZUNIONSTORE、ZINTERSTORE命令的numkeys參數必須大於0。 |
-ERR bad lua script for redis cluster, ZUNIONSTORE/ZINTERSTORE key count < numkeys
| ZUNIONSTORE、ZINTERSTORE命令的實際Key數量小於numkeys值。 |
-ERR bad lua script for redis cluster, xread/xreadgroup command syntax error
| XREAD、XREADGROUP命令的文法不對,請檢查參數個數。 |
-ERR bad lua script for redis cluster, xread/xreadgroup command syntax error, streams must be specified
| XREAD、XREADGROUP命令必須需要有streams參數。 |
-ERR bad lua script for redis cluster, sort command syntax error
| SORT命令的語法錯誤。 |