Skip to content
Latchkey

Redis "ERR unknown command" from a version feature gap in CI

The server does not recognize the command: "ERR unknown command." In CI this is usually a version gap, the service image pins an older Redis that predates the command (for example newer stream, function, or ACL subcommands) the client expects.

What this error means

A command that works locally fails in CI with "ERR unknown command 'X', with args beginning with: ..." because the pinned service image is an older Redis.

redis-cli
(error) ERR unknown command 'FUNCTION', with args beginning with: 'LIST',

Common causes

The image predates the command

The service pins an old tag (redis:5 or redis:6) that never shipped the command your code uses.

A subcommand added in a later minor

The base command exists but a newer subcommand was added later, so the old server rejects the full invocation.

How to fix it

Pin a Redis version that has the command

  1. Check which Redis version introduced the command.
  2. Bump the service image tag to that version or newer.
  3. Re-run and confirm the command is recognized.
.github/workflows/ci.yml
services:
  redis:
    image: redis:7
    ports: ['6379:6379']

Confirm the server version in a step

Print INFO server so the runtime version is visible in the log when a command is missing.

Terminal
redis-cli -h localhost -p 6379 info server | grep redis_version

How to prevent it

  • Pin the Redis service image to a version that supports every command you use.
  • Match the CI Redis version to production.
  • Log redis_version in CI so gaps are obvious.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →