NOTBUSY
RedisERRORCommonCommand ErrorHIGH confidence

No background task is running

Production Risk

Very Low. It's an informational error for an administrative command.

What this means

This error is returned by the `SCRIPT KILL` command when there is no Lua script currently executing on the server. It's a signal that the condition for the command to be useful is not met.

Why it happens
  1. 1Running `SCRIPT KILL` when no script is running.
  2. 2The script that was intended to be killed finished executing before the `SCRIPT KILL` command was received.
  3. 3Running the command on the wrong Redis instance.
How to reproduce

An administrator runs `SCRIPT KILL` on an idle Redis server.

trigger — this will error
trigger — this will error
SCRIPT KILL

expected output

(error) NOTBUSY No background task is running.

Fix 1

Verify a script is running before killing

WHEN Before attempting to kill a script

Verify a script is running before killing
# You would typically do this based on application monitoring
# that has detected a long-running script. There isn't a simple
# Redis command to check for this state before calling SCRIPT KILL.

Why this works

`SCRIPT KILL` is an administrative command. It should only be used when monitoring has indicated a script is stuck. If the script is not stuck, this error is expected.

Fix 2

Ensure you are targeting the correct Redis instance

WHEN If you are certain a script should be running

Ensure you are targeting the correct Redis instance
redis-cli -h correct-host -p correct-port SCRIPT KILL

Why this works

In a distributed environment, it's easy to accidentally connect to the wrong server. Double-check the host and port.

What not to do

Build application logic that depends on this error

This is a response to a manual, administrative command. Application logic should not be trying to kill scripts as a normal operational pattern.

Sources
Official documentation ↗

Lua scripting engine state management.

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Redis errors