Abhishek Chauhan
Abhishek Chauhan

Reputation: 107

Cannot connect to redis://localhost:6379/0: Error 99 connecting to localhost:6379. Cannot assign requested address

ACCOUNTS_SESSION_REDIS_URL=redis://cache:6379/1"
CACHE_REDIS_URL=redis://cache:6379/0
CACHE_TYPE=redis
CELERY_RESULT_BACKEND=redis://cache:6379/2

it is configured as given above in .yml file for docker

the configuration in flask app is given below

CACHE_KEY_PREFIX = "cache::"
#: Host
CACHE_REDIS_HOST = "localhost"
#: Port
CACHE_REDIS_PORT = 6379
#: DB
CACHE_REDIS_DB = 0
#: URL of Redis db.
CACHE_REDIS_URL = "redis://{0}:{1}/{2}".format(
    CACHE_REDIS_HOST, CACHE_REDIS_PORT, CACHE_REDIS_DB)
#: Default cache type.
CACHE_TYPE = "redis"

i am unable to find out what is causing this error.

Upvotes: 3

Views: 9295

Answers (1)

Abhishek Chauhan
Abhishek Chauhan

Reputation: 107

This error is due to wrong configuration of celery. Different versions of celery use slightly different set of configurations so changing them accordingly solved this error for me.

Check this link http://docs.celeryproject.org/en/4.0/userguide/configuration.html to find celery settings for version 4.0

Upvotes: 1

Related Questions