Skip to content

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

Description

@krju13

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions