# Errors

> Every error reply HotKV sends, by prefix, with the exact text, when it happens and what to do about it.

URL: https://docs.hotkv.com/reference/errors/


An error reply is a RESP error (`-` on the wire). Its first word is an
upper-case prefix that tells your code what kind of error it is; the rest is a
message for people. Client libraries usually raise an exception that carries
both. Match on the prefix, not on the message text.

HotKV uses the same prefixes as Redis, so error handling written for Redis
clients works unchanged. The texts below are exactly what the server sends;
`<...>` marks a part that varies.

## Generic errors

### ERR

The general-purpose prefix. Common messages:

| Message | Meaning |
| --- | --- |
| `ERR unknown command '<name>', with args beginning with: '<arg>' ...` | No such command. Check the spelling and the [command list](https://docs.hotkv.com/commands/index.md). |
| `ERR unknown subcommand '<sub>'. Try <COMMAND> HELP.` | The container command (`CLIENT`, `CONFIG`, ...) has no such subcommand. |
| `ERR wrong number of arguments for '<command>' command` | Too many or too few arguments. Subcommands are named as `client\|kill`. |
| `ERR syntax error` | An option is misspelled, repeated or in the wrong place. |
| `ERR value is not an integer or out of range` | An argument that must be a 64-bit integer is not one. |
| `ERR value is not a valid float` | An argument that must be a number is not one. |
| `ERR DB index is out of range` | `SELECT`, `MOVE`, `COPY ... DB` or `SWAPDB` named a database past [`databases`](https://docs.hotkv.com/reference/configuration/index.md#databases). |
| `ERR SELECT is not allowed in cluster mode` | A cluster node has one database unless [`cluster-databases`](https://docs.hotkv.com/reference/configuration/index.md#cluster-databases) is raised, and `SELECT` of another index is refused. |
| `ERR max number of clients reached` | [`maxclients`](https://docs.hotkv.com/reference/configuration/index.md#maxclients) connections are open. The server sends this to a new plain-text connection and closes it (a new TLS connection is closed without a message). |
| `ERR MULTI calls can not be nested`, `ERR EXEC without MULTI`, `ERR DISCARD without MULTI`, `ERR WATCH inside MULTI is not allowed` | Transaction commands used out of order. |
| `ERR Protocol error: invalid RESP data` | The client sent something that is not valid RESP, or a bulk string or array past the [protocol limits](https://docs.hotkv.com/reference/protocol/index.md#protocol-limits). The server closes the connection after this reply. |
| `ERR CONFIG SET failed (possibly related to argument '<name>') - <reason>` | `CONFIG SET` refused a value. `<reason>` says why, for example `can't set immutable config` or `can't set protected config`. |
| `ERR Unknown option or number of arguments for CONFIG SET - '<name>'` | The setting does not exist or cannot be set with `CONFIG SET`. See the [configuration reference](https://docs.hotkv.com/reference/configuration/index.md). |
| `ERR DEBUG command not allowed. If the enable-debug-command option is set to "local", ...` | `DEBUG` is off. See [`enable-debug-command`](https://docs.hotkv.com/reference/configuration/index.md#enable-debug-command). |
| `ERR PREFIX option requires BCAST mode to be enabled`, `ERR OPTIN and OPTOUT are not compatible with BCAST`, `ERR You can't specify both OPTIN mode and OPTOUT mode`, `ERR Prefix '<a>' overlaps with ...`, `ERR The client ID you want redirect to does not exist`, `ERR You can't switch BCAST mode on/off ...` | `CLIENT TRACKING` was given options that do not go together, or tracking is already on in a different mode. See [CLIENT TRACKING](https://docs.hotkv.com/commands/client-tracking/index.md#return-value). |
| `ERR CLIENT CACHING can be called only when the client is in tracking mode with OPTIN or OPTOUT mode enabled` | `CLIENT CACHING` was sent while tracking is off. See [CLIENT CACHING](https://docs.hotkv.com/commands/client-caching/index.md). |
| `ERR Module loading is not supported in this build. ...` | `MODULE LOAD` is not available. HotKV has its data types built in. |
| `ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?` | `AUTH` with a password while none is set. |
| `ERR Can't execute '<command>': only (P\|S)SUBSCRIBE / (P\|S)UNSUBSCRIBE / PING / QUIT / RESET are allowed in this context` | A RESP2 connection is subscribed to pub/sub channels. Use another connection for regular commands, or switch to RESP3, where a subscribed connection can run any command. |

Scripts and functions report their errors with `ERR` too, with the script
location appended, unless the script raised an error with its own prefix.

### WRONGTYPE

```text
WRONGTYPE Operation against a key holding the wrong kind of value
```

The command works on one data type and the key holds another (for example
`LPUSH` on a string). Check the key with [`TYPE`](https://docs.hotkv.com/commands/type/index.md) or use a
different key name.

## Authentication and permissions

### NOAUTH

```text
NOAUTH Authentication required.
```

The server has a password and the connection has not authenticated. Send
[`AUTH`](https://docs.hotkv.com/commands/auth/index.md) (or `HELLO 3 AUTH <user> <password>`) first.

`HELLO` without `AUTH` on such a server replies
`NOAUTH HELLO must be called with the client already authenticated, otherwise the HELLO <proto> AUTH <user> <pass> option can be used to authenticate the client and select the RESP protocol version at the same time`.

### WRONGPASS

```text
WRONGPASS invalid username-password pair or user is disabled.
```

The user name or password is wrong, or the user is disabled (`off`). The
attempt is recorded in [`ACL LOG`](https://docs.hotkv.com/commands/acl-log/index.md).

### NOPERM

The authenticated user's [ACL](https://docs.hotkv.com/operate/acl/index.md) does not allow the request:

| Message | Meaning |
| --- | --- |
| `NOPERM User <user> has no permissions to run the '<command>' command` | The command (or subcommand) is not in the user's allowed commands. |
| `NOPERM No permissions to access a key` | A key the command touches is outside the user's key patterns. |
| `NOPERM No permissions to access a channel` | A pub/sub channel is outside the user's channel patterns. |
| `NOPERM User <user> no longer exists` | The user was deleted while the connection was open. |

`SORT` with `BY` or `GET` patterns the user may not read replies
`ERR BY option of SORT denied due to insufficient ACL permissions.` (or the
`GET` equivalent). Every denial is recorded in [`ACL LOG`](https://docs.hotkv.com/commands/acl-log/index.md).

### DENIED

```text
DENIED HotKV is running in protected mode because protected mode is on and the default user has no password: only clients on the loopback interface are served. ...
```

The client connected from another host while
[`protected-mode`](https://docs.hotkv.com/reference/configuration/index.md#protected-mode) is on and the
`default` user has no password. The server sends this and closes the
connection. Set a password ([`requirepass`](https://docs.hotkv.com/reference/configuration/index.md#requirepass)
or an ACL), or turn protected mode off where the network already keeps
strangers out.

### NOPROTO

```text
NOPROTO unsupported protocol version
```

`HELLO` was given a protocol version other than `2` or `3`.

### NOLICENSE

```text
NOLICENSE <feature> requires a HotKV license. Contact sales@hotkv.com
```

An On-Premise server ran a command whose feature its license does not
include. `<feature>` is the license feature name, for example `prompt-cache`
or `semantic-cache`. Check what the installed license covers with
[`LICENSE.INFO`](https://docs.hotkv.com/commands/license-info/index.md). On HotKV Cloud, features follow your
plan.

## Memory, persistence and replicas

### OOM

```text
OOM command not allowed when used memory > 'maxmemory'.
```

Memory use is at [`maxmemory`](https://docs.hotkv.com/reference/configuration/index.md#maxmemory) and the
command would add data, either because the policy is `noeviction` or because
nothing more could be evicted. Free memory, raise `maxmemory`, or choose an
evicting [`maxmemory-policy`](https://docs.hotkv.com/reference/configuration/index.md#maxmemory-policy).
Reads and deletes still work.

### MISCONF

The server cannot keep data safe on disk, so it refuses commands that change
data:

```text
MISCONF The last background save failed, so commands that change data are refused (stop-writes-on-bgsave-error is yes). The server log says why; they are accepted again once a save succeeds.
```

```text
MISCONF The AOF cannot be written to disk (<reason>), so commands that change data are refused until it can. The server log has the details.
```

Fix the disk problem (space, permissions) shown in the log. Writes are
accepted again once a snapshot or AOF write succeeds. See
[`stop-writes-on-bgsave-error`](https://docs.hotkv.com/reference/configuration/index.md#stop-writes-on-bgsave-error).

### READONLY

```text
READONLY You can't write against a read only replica.
```

The connection is to a replica, which refuses writes from clients
([`replica-read-only`](https://docs.hotkv.com/reference/configuration/index.md#replica-read-only)). Send
writes to the primary.

### LOADING

```text
LOADING HotKV is loading the dataset in memory
```

A replica is replacing its data with a full copy from its primary. Retry after
a short wait.

### NOREPLICAS

```text
NOREPLICAS Not enough good replicas to write.
```

A cluster slot change ([`CLUSTER SETSLOT`](https://docs.hotkv.com/commands/cluster-setslot/index.md)) timed
out waiting for the primary's replicas to acknowledge it. Check the replicas'
links, then retry.

## Scripts and functions

### BUSY

```text
BUSY HotKV is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE.
```

A script or function has run longer than
[`busy-reply-threshold`](https://docs.hotkv.com/reference/configuration/index.md#busy-reply-threshold).
Wait, or stop it with [`SCRIPT KILL`](https://docs.hotkv.com/commands/script-kill/index.md) or
[`FUNCTION KILL`](https://docs.hotkv.com/commands/function-kill/index.md).

### NOSCRIPT

```text
NOSCRIPT No matching script. Please use EVAL.
```

`EVALSHA` named a script the server does not have cached (never loaded, or
removed by `SCRIPT FLUSH`, a restart, or the cap on scripts added by `EVAL`).
Send the script with [`EVAL`](https://docs.hotkv.com/commands/eval/index.md) or
[`SCRIPT LOAD`](https://docs.hotkv.com/commands/script-load/index.md) and retry. Most client libraries do
this for you.

### UNKILLABLE

```text
UNKILLABLE Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in a hard way using the SHUTDOWN NOSAVE command.
```

`SCRIPT KILL` or `FUNCTION KILL` cannot stop a script that has already
written, because that would leave its changes half done.

### NOTBUSY

```text
NOTBUSY No scripts in execution right now.
```

`SCRIPT KILL` or `FUNCTION KILL` was sent while nothing was running.

## Transactions

### EXECABORT

```text
EXECABORT Transaction discarded because of previous errors.
```

A command queued after `MULTI` was refused (unknown command, wrong number of
arguments, ACL denial), so `EXEC` runs nothing. Fix the command and send the
transaction again.

When the server's state refuses the whole transaction at `EXEC` (memory at
`maxmemory`, a read-only replica, a replica loading data, or a disk error),
the reply is `EXECABORT Transaction discarded because of: <error>`, where
`<error>` is the `OOM`, `READONLY`, `LOADING` or `MISCONF` message.

## Cluster

These replies only come from a node in [cluster mode](https://docs.hotkv.com/clustering/index.md).
Cluster-aware client libraries handle `MOVED`, `ASK` and `TRYAGAIN` on their
own.

### MOVED

```text
MOVED <slot> <host>:<port>
```

Another node serves the key's hash slot. Send the command there and update
your slot map. `<host>` follows
[`cluster-preferred-endpoint-type`](https://docs.hotkv.com/reference/configuration/index.md#cluster-preferred-endpoint-type),
and TLS clients get the node's TLS port.

### ASK

```text
ASK <slot> <host>:<port>
```

The slot is being migrated and the key is already on the target node. Send
`ASKING` and then the command to that node, for this one request only. Do not
update your slot map.

### TRYAGAIN

| Message | Meaning |
| --- | --- |
| `TRYAGAIN Multiple keys request during rehashing of slot` | A multi-key command's keys are split between the two nodes of a slot migration. |
| `TRYAGAIN this node is handing the slot's AI data off` | An AI feature's data for this slot is moving to another node. |

Retry after a short delay.

### CROSSSLOT

```text
CROSSSLOT Keys in request don't hash to the same slot
```

A command or transaction uses keys in different hash slots. Put related keys
in one slot with a hash tag, for example `{user:42}:profile` and
`{user:42}:cart`.

### CLUSTERDOWN

| Message | Meaning |
| --- | --- |
| `CLUSTERDOWN Hash slot not served` | No node serves the key's slot. |
| `CLUSTERDOWN The cluster is down` | The cluster is in the `fail` state. |
| `CLUSTERDOWN The cluster is down and only accepts read commands` | The cluster is down, [`cluster-allow-reads-when-down`](https://docs.hotkv.com/reference/configuration/index.md#cluster-allow-reads-when-down) is on, and the command writes. |

Check [`CLUSTER INFO`](https://docs.hotkv.com/commands/cluster-info/index.md) and the node logs. See also
[`cluster-require-full-coverage`](https://docs.hotkv.com/reference/configuration/index.md#cluster-require-full-coverage)
and [Cluster troubleshooting](https://docs.hotkv.com/clustering/troubleshooting/index.md#clusterdown).

### IOERR

```text
IOERR error or timeout connecting to the specified instance
```

[`MIGRATE`](https://docs.hotkv.com/commands/migrate/index.md) could not reach the target node, or the target
stopped answering (`IOERR error or timeout reading to target instance`). Check
the address, the network and the timeout argument, then retry.

## Data type errors

### BUSYKEY

```text
BUSYKEY Target key name already exists.
```

`RESTORE` (or `MIGRATE` without `REPLACE`) would overwrite an existing key.
Add `REPLACE` or delete the key first.

### BUSYGROUP

```text
BUSYGROUP Consumer Group name already exists
```

`XGROUP CREATE` named a group the stream already has.

### NOGROUP

```text
NOGROUP No such consumer group '<group>' for key name '<key>'
```

The stream or the consumer group does not exist. Create the group with
[`XGROUP CREATE`](https://docs.hotkv.com/commands/xgroup-create/index.md) (add `MKSTREAM` to create the
stream too). `XREADGROUP` replies
`NOGROUP No such key '<key>' or consumer group '<group>' in XREADGROUP with GROUP option`.

### INVALIDOBJ

```text
INVALIDOBJ Corrupted HLL object detected
```

A HyperLogLog command found a string that is not a valid HyperLogLog. Delete
the key or use another one.

### UNBLOCKED

```text
UNBLOCKED client unblocked via CLIENT UNBLOCK
```

A blocking command (`BLPOP`, `XREAD BLOCK`, ...) was ended by another client
with [`CLIENT UNBLOCK <id> ERROR`](https://docs.hotkv.com/commands/client-unblock/index.md).

> **Tip**
> Retry only the errors that can clear on their own: `LOADING`, `TRYAGAIN`,
> `BUSY`, `CLUSTERDOWN`, `IOERR` and `MOVED`/`ASK` (after redirecting). The
> others need a change in the request, the data or the configuration.