ERR
redis
runtime_error
ai_generated
true
ERR SCRIPT KILL failed - no script in execution right now
ID: redis/redis-script-kill-failed-no-script-running
92%Fix Rate
90%Confidence
1Evidence
2023-08-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| redis 6.0 | active | — | — | — |
| redis 6.2 | active | — | — | — |
| redis 7.0 | active | — | — | — |
| redis 7.2 | active | — | — | — |
Root Cause
A user attempted to run SCRIPT KILL when no Lua script is currently executing, either because the script already finished or the server is not busy.
generic中文
用户尝试执行SCRIPT KILL时,没有正在执行的Lua脚本,可能是因为脚本已经完成或服务器不忙碌。
Official Documentation
https://redis.io/docs/latest/commands/script-kill/Workarounds
-
95% success Verify script execution status with `CLIENT LIST` to see if any client is executing a script (look for 'script' flag). If no script is running, the error is harmless; ignore it.
Verify script execution status with `CLIENT LIST` to see if any client is executing a script (look for 'script' flag). If no script is running, the error is harmless; ignore it.
-
80% success If a script appears stuck but SCRIPT KILL fails, use `MEMORY DOCTOR` to check for memory issues or `SLOWLOG GET` to find long-running commands that may be blocking.
If a script appears stuck but SCRIPT KILL fails, use `MEMORY DOCTOR` to check for memory issues or `SLOWLOG GET` to find long-running commands that may be blocking.
-
90% success Set a Lua script timeout in redis.conf: `lua-time-limit 5000` (5 seconds) to prevent scripts from running indefinitely, reducing the need for manual SCRIPT KILL.
Set a Lua script timeout in redis.conf: `lua-time-limit 5000` (5 seconds) to prevent scripts from running indefinitely, reducing the need for manual SCRIPT KILL.
中文步骤
Verify script execution status with `CLIENT LIST` to see if any client is executing a script (look for 'script' flag). If no script is running, the error is harmless; ignore it.
If a script appears stuck but SCRIPT KILL fails, use `MEMORY DOCTOR` to check for memory issues or `SLOWLOG GET` to find long-running commands that may be blocking.
Set a Lua script timeout in redis.conf: `lua-time-limit 5000` (5 seconds) to prevent scripts from running indefinitely, reducing the need for manual SCRIPT KILL.
Dead Ends
Common approaches that don't work:
-
Repeatedly calling SCRIPT KILL until it works
95% fail
Calling SCRIPT KILL when no script is running just returns the same error each time; it does not help kill a script that may have already ended.
-
Restarting Redis to clear any phantom scripts
70% fail
Restarting is unnecessary if no script is running; it causes downtime and may not address the real issue (e.g., a script that finished but left side effects).
-
Using SHUTDOWN NOSAVE to force stop
85% fail
SHUTDOWN NOSAVE is a drastic measure that discards all data; it is only needed when a script is stuck and SCRIPT KILL is refused, not when no script is running.