# ERR wrong number of arguments: Argument count is wrong

> The command name is known but the argument count is not: each command declares a minimum, and fixed-arity commands also refuse extra arguments.

Source: https://sqlly.app/errors/redis/wrong-number-of-arguments
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).
Note: Quoted error message text belongs to its database vendor.

- Error prefix: `ERR wrong number of arguments`
- Category: Data types and commands

Error message:

```text
ERR wrong number of arguments for 'get' command
```

## What it means

Every Redis command declares an arity: how many arguments it accepts, counting the command name itself. When the client sends fewer arguments than the minimum, or more than a fixed-arity command allows, Redis refuses with this message naming the command. The check happens before anything executes, so a rejected call has written nothing: SETNX k v extra fails with this message and leaves k unset. SET takes a variable number of arguments, so a stray token there gives ERR syntax error instead.

The usual source is the client layer: a nil argument dropped from the array, an option appended twice, or a driver joining arguments into one string instead of sending them as separate bulk strings. Commands with fixed shapes such as GET are strict; SET is deliberately loose because it takes many option forms.

## Common causes

- A nil or empty value was dropped by the client library, leaving a gap in the argument list.
- Arguments were joined into one string or split wrongly instead of being sent as separate RESP bulk strings.
- An option was repeated, or an extra positional argument was appended to a fixed-arity command.

## How to fix it

1. Check the exact arity Redis expects; a negative value means 'at least':

   ```sql
   COMMAND INFO get
   # arity 2: GET key, exactly
   COMMAND INFO set
   # arity -3: SET key value [options...], at least
   ```
2. Log the argument array the client actually builds, including nils and empty strings, and compare it with the intended call.
3. Run the command by hand with the intended arguments to separate a client bug from a usage bug:

   ```sql
   GET mykey
   # (nil) is a missing key, not an error
   GET
   # (error) ERR wrong number of arguments for 'get' command
   ```

## Reproduce it safely

```sql
redis-cli GET
# (error) ERR wrong number of arguments for 'get' command
redis-cli GET mykey extra
# (error) ERR wrong number of arguments for 'get' command
redis-cli GET mykey
# (nil)
```

## How SQLly helps

The reply is printed as sent, naming the exact command, and COMMAND INFO for the arity runs in the SQLly editor while you read the message, which settles at-least versus exact without opening the docs.

## Questions

### Does the argument count include the command name?

Yes. GET has arity 2: the word GET plus one key. That is why a bare GET is reported against the get command.

### Can a command accept unlimited arguments?

Commands such as RPUSH, SADD and DEL have negative arity, meaning 'at least N'. For them the error means you dropped below the minimum, not above a maximum.

## Related errors

- [`ERR unknown command`](https://sqlly.app/errors/redis/unknown-command): Redis does not know this command
- [`42601`](https://sqlly.app/errors/postgresql/42601): PostgreSQL: syntax error at or near
- [`156`](https://sqlly.app/errors/sql-server/156): SQL Server: Incorrect syntax near the keyword

The code and message text are from the [Redis documentation and source code](https://redis.io/docs/latest/).
