Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis-sentinel connection error "AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?" #610

Open
krju13 opened this issue Jun 9, 2022 · 5 comments
Labels

Comments

@krju13
Copy link

krju13 commented Jun 9, 2022

Hi exports.
I am in the troble with django-redis.
I use django-redis version django-redis>=5.0.0,<5.1.0.
and I make docker image with django application.
and I try to connect to redis-sentinel.
but the django application just return the error like below.
ERROR - create_cache: AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?

here is the my settings.py

# redis connection factory
DJANGO_REDIS_CONNECTION_FACTORY = 'django_redis.pool.SentinelConnectionFactory'

# These sentinels are shared between all the examples, and are passed
# directly to redis Sentinel. These can also be defined inline.
SENTINELS = [
    (env('REDIS_SENTINEL_IP_1'), 26379),
    (env('REDIS_SENTINEL_IP_2'), 26379),
    (env('REDIS_SENTINEL_IP_3'), 26379)
]

CACHES = {
    "default": {
        "BACKEND": env('DJANGO_CACHE_BACKEND_REDIS'),
        # THE HOSTNAME IN LOCATION is the primary (service/master) name
        # example : redis://dev-redis/db
        # example : redis://staging-redis/db
        "LOCATION": env('DJANGO_CACHE_LOCATION_REDIS'),
        "OPTIONS": {
            # django_redis.client.SentinelClient
            "CLIENT_CLASS": env('DJANGO_CACHE_CLIENT_CLASS'),
            "SENTINELS": SENTINELS,
            "SENTINEL_KWARGS":{'password':env('REDIS_PASSWORD_VALUE')},
            'PASSWORD': env('REDIS_PASSWORD_VALUE'),
            "CONNECTION_POOL_CLASS": "redis.sentinel.SentinelConnectionPool",
        },
        "KEY_PREFIX": "mapsvc"
    }
}

How can I connect with redis-sentinel???
the redis version

# Server
redis_version:6.2.6

Please help me.


  • plus. I tried django-redis version 5.2.0 and the same error comes..

+environment explane
I am in the kubernetes cluster.
the redis-sentinel is the 3 node out of the kubernetes cluster.
but it can connect redis-sentinel's node and kubernetes pod.
I tried redis-cli -h {master-ip} -p 6379 -a {password} in the redis pod and I can connect to redis.

when I tried in other kubernetes cluster a month before.
I used helm to install redis-sentinel.
and that time I can easilly connect to redis-sentinel in django.

but can't not this time.

@krju13 krju13 added the question label Jun 9, 2022
@WisdomPill
Copy link
Member

I am no expert in sentinel, @terencehonles coukd you help with this?

Otherwise I will dig in the code sometime in the next few days

@frederickishimwe-absa
Copy link

also have the same error

@navjotjsingh
Copy link

navjotjsingh commented Dec 27, 2022

Getting the same error with Redis. I am not using Sentinel. This happens with Redis 6+.

@navjotjsingh
Copy link

A simple solution is to set the password for the default user.

acl setuser default >password

This worked for me.

@frederickishimwe-absa
Copy link

frederickishimwe-absa commented Jan 4, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants