REDIS Error: ERR unknown command `CONFIG when trying to set dir - redis

I'm trying to run the following
redis-cli --raw -a '<password censored>' 'CONFIG SET dir /var/www/html'
However I keep getting:
ERR unknown command `CONFIG SET dir /var/www/html`, with args beginning with:
Any advice?

Related

Do you know how to exit of the command not found: uname?

I am a beginer and I was trying to connect postgres to a database ig and this happen and can't exist nor clear
Users/kouadiondah/.oh-my-zsh/oh-my-zsh.sh:56: command not found: mkdir
/Users/kouadiondah/.oh-my-zsh/oh-my-zsh.sh:117: command not found: rm
compdump:136: command not found: mv
detect-clipboard:33: command not found: uname
I can't exit of this
Any help??
same problem here. I think it has to do with the FPATH-Variable but I do not get a solution.
My errors are:
/home/weidner.f/ohmyzsh/oh-my-zsh.sh:56: command not found: mkdir
/home/weidner.f/ohmyzsh/oh-my-zsh.sh:56: command not found: mkdir
/home/weidner.f/ohmyzsh/oh-my-zsh.sh:117: command not found: rm
parse_git_dirty:18: command not found: tail
This messages occur in the terminal when I am opening my IDE (IntelliJ)

Unregistering a RedisGears registration using inline redis-cli command results in "ERR unknown command `RG_UNREGISTER`"

When using redis-cli, I can unregister a RedisGears registration like this:
127.0.0.1:16379> RG.UNREGISTER "0000000000000000000000000000000000000000-4"
OK
When running this command as an inline redis-cli command, it fails:
$ redis-cli "RG_UNREGISTER 0000000000000000000000000000000000000000-6"
(error) ERR unknown command `RG_UNREGISTER 0000000000000000000000000000000000000000-6`, with args beginning with:
$ echo "RG_UNREGISTER 0000000000000000000000000000000000000000-6" | redis-cli
(error) ERR unknown command `RG_UNREGISTER`, with args beginning with: `0000000000000000000000000000000000000000-6`,
How do I run RG_UNREGISTER as an inline redis-cli command?
Also:
redis-cli "RG.UNREGISTER" 0000000000000000000000000000000000000000-6
This will unregister a RedisGears registration as an inline redis-cli command:
$ echo "RG.UNREGISTER 0000000000000000000000000000000000000000-8" | redis-cli
This also works:
$ echo "0000000000000000000000000000000000000000-1" redis-cli -x "RG.UNREGISTER"

Redis CLI Rename Key - ERR unknown command RENAME with args

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!
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

Handling DCL ON ERROR actions after first error?

The OpenVMS DCL command HELP ON EXAMPLE displays:
ON
Examples
1.$ ON SEVERE_ERROR THEN CONTINUE
A command procedure that contains this statement continues
to execute normally when a warning or error occurs during
execution. When a severe error occurs, the ON statement signals
the procedure to execute the next statement anyway. Once
the statement has been executed as a result of the severe
error condition, the default action (ON ERROR THEN EXIT) is
reinstated.
According to the help if neither [-]x.for nor [-]y.for exist then the last two lines will not be executed:
$ on error then $ continue
$ rename [-]x.for []
$ rename [-]y.for []
$ type *.for
Is there a way to set the ON ERROR handling as in the first line w/o placing an ON ERROR statement between each line of the script?
If the ON ERROR fires, you have to re-establish it. It looks like you
don't know whether any of the files exists. So the ON ERROR needs to be
re-established after the first failing command.
You can do this in a subroutine, like in:
$ on error then $ gosub on_error
$ rename [-]x.for []
$ rename [-]y.for []
$ on error then $ exit
$ type *.for
$ exit
$
$ on_error:
$ on error then $ gosub on_error
$ return
Also, you can handle this differently, with disabling error checking (SET
NOON):
$ set noon
$ rename [-]x.for []
$ rename [-]y.for []
$ set on
$ type *.for
or establishing error handling only for sever errors (ON SEVERE_ERROR):
$ on severe_error then $ exit
$ rename [-]x.for []
$ rename [-]y.for []
$ on error then $ exit
$ type *.for

How to get error message from ditto command , when it fails to archive

Using ditto command we are archiving folder. When folder contains some files which does not have read permission. It fails to archive. That time ditto command logs error message saying " ditto: "Path" : Permission denied. How to get this error message.
As with any UNIX command, errors are written to stderr, which can be captured by adding 2> file to end of the command:
$ ditto src dst 2> error
$ cat error
ditto: /Users/andy/tmp/src/./x: Permission denied
If you are running ditto from a shell script, then something like this should work:
#!/bin/sh
errfile=/tmp/errors.$$
(cd ~/tmp; ditto src dst 2> $errfile)
if [ $? -ne 0 ]; then
echo There was a problem:
cat $errfile
else
echo Everything is cool
fi