ERR unknown command

The server doesn't recognize the command name.

Redis returns this error when it doesn't recognize the command you sent. The message repeats the command name and its first arguments, so you can see exactly what the server received. For a command without arguments, the message ends after the command name: ERR unknown command 'FOO'.

ERR unknown command 'FOO', with args beginning with: 'bar'

In client libraries

Client libraryException or error typeMessage
redis-py ResponseError unknown command '<command>', with args beginning with: <args>
Jedis JedisDataException ERR unknown command '<command>', with args beginning with: <args>
node-redis SimpleError ERR unknown command '<command>', with args beginning with: <args>
Lettuce
The async API wraps the exception in an ExecutionException (get()) or a CompletionException (join()).
RedisCommandExecutionException ERR unknown command '<command>', with args beginning with: <args>
go-redis redis.Error ERR unknown command '<command>', with args beginning with: <args>
ioredis ReplyError ERR unknown command '<command>', with args beginning with: <args>
StackExchange.Redis
NRedisStack uses StackExchange.Redis, so it raises the same exceptions. The sync and async APIs raise the same exceptions.
RedisServerException ERR unknown command '<command>', with args beginning with: <args>
Predis Predis\Response\ServerException ERR unknown command '<command>', with args beginning with: <args>
redis-rb Redis::CommandError ERR unknown command '<command>', with args beginning with: <args> (redis://<host>:<port>)
redis-rs
The sync and async APIs raise the same errors.
ErrorKind::Server(ServerErrorKind::ResponseError) ResponseError: unknown command '<command>', with args beginning with: <args>

Example

> FOO bar
(error) ERR unknown command 'FOO', with args beginning with: 'bar'

A command that has subcommands, such as CONFIG, gives a similar error for a subcommand it doesn't know:

> CONFIG FOO
(error) ERR unknown subcommand 'FOO'. Try CONFIG HELP.

How to fix it

  • The command name is misspelled. Check the name on the command's page, such as GET.
  • The command is newer than your server. Each command page shows the version that added the command, under Available since. To find your server's version, run INFO server and look at the redis_version field. Upgrade the server if you need the command.
  • The command needs a feature that the server doesn't include. For example, JSON.SET and FT.SEARCH only work when the server includes JSON and Redis Search. Some Redis builds and packages don't include them. To see which modules the server has loaded, run MODULE LIST.
  • The server's configuration renamed or disabled the command. The rename-command setting can give a command a different name, or remove it. See Disallowing specific commands.

In a transaction, an unknown command also makes EXEC fail with EXECABORT.

RATE THIS PAGE
Back to top ↑