saad
saad

Reputation: 1364

Err Unknown command scan, redis-cli

Installed the redis on ubuntu using https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-18-04

redis-server -v gives

Redis server v=4.0.9 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=76095d16786fbcba

redis-cli -v gives

redis-cli 4.0.9

While redis-cli info gives

redis_version:2.4.6
redis_git_sha1:26cdd13a
redis_git_dirty:0
arch_bits:64
multiplexing_api:winsock2
gcc_version:4.6.1

When run the scan command redis-cli scan 0 it gives error

(error) ERR unknown command 'scan'

Learned that scan only works on redis version 2.8+, so tried to update redis sudo apt install redis-server but it says

redis-server is already the newest version (5:4.0.9-1ubuntu0.1).

How can we run the SCAN command?

Upvotes: 2

Views: 8119

Answers (1)

Atiq Ur Rehman
Atiq Ur Rehman

Reputation: 240

Problem is with your previous version of Cli: https://redis.io/commands/scan

upgrade your cli version to 2.8.0 or higher

I got the same issue due to install redis(2.4.0) on window 10 and donwload ubuntu from windows store and install latest version of redis(5.0.2) in Ubuntu but still redis-cli showed 2.4.6

To resolve this problem just uninstall redis-server from window and restart redis-server on Ubuntu

Upvotes: 4

Related Questions