Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis not allowing any operations

Tags:

redis

I have a Redis server. When I try the ping command or any other command using redis-cli ping I get an error message saying:

(error) ERR operation not permitted

typing only redis-cli takes me to the prompt:

redis 127.0.0.1:6379>

after this any redis command again gives the same error. I have no idea what the issue could be. Any help is appreciated.

like image 631
Vishesh Joshi Avatar asked Jul 18 '12 22:07

Vishesh Joshi


People also ask

Why Redis server is not running?

The best way to know the error is to start redis-server.exe from command prompt. Locate your redis installation (usually C:\Program Files\Redis ) and open the command prompt with that directory as current directory. then Run redis-server.exe by typing it on the prompt.

Are Redis commands blocking?

Redis has a few blocking commands among the built-in set of commands. One of the most used is BLPOP (or the symmetric BRPOP ) which blocks waiting for elements arriving in a list. The interesting fact about blocking commands is that they do not block the whole server, but just the client calling them.

How do you handle Redis failure?

If the Redis server becomes unavailable you must flush it (clean out the entries) before making it available again. Otherwise there's a chance that you might start retrieving cache entries that have incorrect data because of updates that occurred in the meantime.

How do I make sure Redis is running?

To start Redis client, open the terminal and type the command redis-cli. This will connect to your local server and now you can run any command. In the above example, we connect to Redis server running on the local machine and execute a command PING, that checks whether the server is running or not.


2 Answers

In your redis.conf file - is there a requirepass field that is set (and not commented out with #) - if so, you need to authenticate first like this:

AUTH Pwd  (replace Pwd with actual password phrase)

Once authenticated, you can issue new commands.

like image 135
ali haider Avatar answered Sep 28 '22 02:09

ali haider


requirepass option may be enabled in your configuration file redis.conf by default

  • Pass the authenticated with -a argument after redis-cli command:

    $ redis-cli -a YourPass
    
  • exec auth command after redis prompt:

    > auth YourPass
    
like image 34
user1611552 Avatar answered Sep 28 '22 00:09

user1611552