I got error NOAUTH Authentication required when I connect to Redis server via command: redis-cli
and run ping
to check if Redis is working.
I found answer for NOAUTH Authentication required error which describes that this error only happens when Redis is set a password, but I checked Redis config file at etc/redis/redis.conf
and there is no password setting.
Does anyone know that if there are other settings which can cause this error? Thanks for any help.
p/s: I am using Ruby on Rails web framework, Redis database is used for Sidekiq.
Edited: Redis version is 2.8.4. Server is hosted on AWS.
Currently, I decided to set a password for Redis server so that it can not be set password when it is running.
(When Redis server is restarted, it will work normal. You can run sudo service redis-server restart
to restart Redis server.)
I had the same issue (running on AWS) and discovered our redis port was exposed. You probably had the same. Someone was messing around.
EDIT: The solution: reset your redis password and then (assuming you have it running as a service) restart the service providing the new password
I Have the same problem. after that I'm set
requirepass
for theredis
server.And add that password in
initializer/redis.rb
It works fine
If you have made any changes in configuration file then don't forget to restart redis service with
sudo service redis-server restart
command.Edit: If you are running redis service in production mode then redis requires password to run. For that you need to set password in your config file present at
/etc/redis
.You need to set
requirepass *******
in that file under########### SECURITY ############
section.Then restart your server
sudo service redis-server restart
.After that add that password in your config or initializer file where you have set your hostname and port. Example:
$redis = Redis.new(:host => 'localhost', :port => 6379, :password => "*******")
I Have the same problem, I found it's caused by someone started redis by another
redis.cnf
configure file, So I stoped redis-server and then started redis-server specify a configure file.Then every thing works fine.
Had the exact same problem running Redis on an AWS instance. I would restart redis-server without any password requirements (#requirepass ''), would work fine for a few hours, then would throw "NOAUTH Authentication required" and eventually would have to restart redis-server.
Checked the Security Groups settings in AWS for the instance and saw port 6379 open to the public (0.0.0.0/0). We limited the port access to our only server that needs to access and haven't seen the issue come up ever since!
P.S. This is my first ever contribution to StackOverflow. Thanks for the help!
We also faced a similar issue. Looks like someone went and scanned AWS and connected to all public redis and possibly ran "CONFIG SET REQUIREPASS ''", thus locking down the running instance of redis. Once you restart the redis, the config is restored to normal.
Best thing would be to use AWS security group policy and block port 6379 for public.