2

I have a redis-cli script that I can run locally (from Win10) but it fails when I run it against the server (Linux) with rename command.

After connecting with redis-cli (from Win10), I run the following:

SET "someinstance.domain.us:mytenant:MyDailyData:2018.1.10" "Hello123"
GET "someinstance.domain.us:mytenant:MyDailyData:2018.1.10"
RENAME "someinstance.domain.us:mytenant:MyDailyData:2018.1.10" "TEMP:someinstance.domain.us:mytenant:MyDailyData:2018.1.10"
DEL "TEMP:someinstance.domain.us:mytenant:MyDailyData:2018.1.10"
GET "TEMP:someinstance.domain.us:mytenant:MyDailyData:2018.1.10"

while locally everything is OK, when I run it against the server, I get the following output:

my-redis-address:6379> SET "someinstance.domain.us:mytenant:MyDailyData:2018.1.10" "Hello123"
OK
my-redis-address:6379> GET "someinstance.domain.us:mytenant:MyDailyData:2018.1.10"
"Hello123"
my-redis-address:6379> RENAME "someinstance.domain.us:mytenant:MyDailyData:2018.1.10" "TEMP:someinstance.domain.us:mytenant:MyDailyData:2018.1.10"

(error) ERR unknown command `RENAME`, with args beginning with: `someinstance.domain.us:mytenant:MyDailyData:2018.1.10`, `TEMP:someinstance.domain.us:mytenant:MyDailyData:2018.1.10`,

my-redis-address:6379> DEL "TEMP:someinstance.domain.us:mytenant:MyDailyData:2018.1.10"
(integer) 0
my-redis-address:6379> GET "TEMP:someinstance.domain.us:mytenant:MyDailyData:2018.1.10"
(nil)
my-redis-address:6379>

(error) ERR unknown command RENAME, with args beginning with: someinstance.domain.us:mytenant:MyDailyData:2018.1.10, TEMP:someinstance.domain.us:mytenant:MyDailyData:2018.1.10,

redis server details:

gcc_version 5.4.0
os  Linux 4.4.0-176-generic x86_64
redis_build_id  452d9690a8de23a2
redis_mode  standalone
redis_version   5.0.7

What am I doing wrong here? Is it that I am running Win10 cli against Linux Redis server that causes it?

thanks!

tridy
  • 1,166
  • 1
  • 12
  • 21

1 Answers1

2

Conclusion

The RENAME command has been rename to something meaningless on your server.

Solution

Check the redis.conf file on the server whether there is a line rename-command RENAME xxx. If so, comment it and restart the Redis server.(if the server is online, contact the administrator first)

From redis.conf:

# It is possible to change the name of dangerous commands in a shared
# environment. For instance the CONFIG command may be renamed into something
# hard to guess so that it will still be available for internal-use tools
# but not available for general clients.
#
# Example:
#
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
llinvokerl
  • 1,029
  • 10
  • 25
  • you are right, the command was "disabled" in the configuration. I did not know it was possible to disable certain commands via configuration this way but I know now. Also, the Redis message could be a bit more descriptive that would include "or was renamed" "or was configured", well something like this. Anyway, thanks for the help! – tridy Mar 25 '20 at 08:42