6

I've followed all the steps in the following video:

https://www.youtube.com/watch?v=fvYo6LBZUh8&t=166s

However, I'm not able to connect with "heroku redis", I am using celery to implement periodic tasks. The error is the following:

[2021-04-02 22:00:05,622: ERROR/MainProcess] consumer: Cannot connect to redis://:**@ec2-54-160-13-161.compute-1.amazonaws.com:12880//: Error while reading from socket: (10054, 'Se ha forzado la interrupción de una conexión existente por el host remoto', None, 10054, None).

So, any idea of what could be happening would be great. ¡Thank you so much!

2
  • 3
    in my case, it was working fine for some 2 3 weeks. But today it is showing this error. Commented Jul 18, 2021 at 5:28
  • 2
    @RahulHindocha Heroku keeps changing the URI so run heroku redis:credentials REDIS_URL like Marcos Paolo said and get the updated REDIS_URL. Commented Jan 9, 2022 at 20:09

1 Answer 1

3

It's a good practice to set your redis URL in settings.py with OS os.environ.get('REDIS_URL')

Heroku rotates credentials periodically and updates applications where this datastore is attached.

Heroku recommends using encryption and thus a rediss:// URL instead of redis://

For celery, something like: CELERY_BROKER_URL = 'rediss://:{Password}@{Host}:{Port}'

Heroku command to get this url easy heroku redis:credentials REDIS_URL

Referer: https://devcenter.heroku.com/articles/heroku-redis#using-the-cli

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.