添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I keep on getting the error message: redis.exceptions.ResponseError: NOAUTH Authentication required.. (I'm using celery to perform background tasks).

My settings.py looks like this:

CELERY_BROKER_URL = 'redis://user:my_strong_password@'+REDIS_IP+':6379/0'

the docker-compose I have:

services:
  redis:
    image: redis:latest
    container_name: jh_redis
    ports:
     - '6379:6379'
    command: redis-server --appendonly yes --requirepass my_strong_password 

you can see that my attempt to provide the password (--requirepass) is exactly as it shown in the settings.py however, while the docker is up and running I still get the subject error message.

I have tried different combination such as:

--requirepass user:my_strong_password

but still didn't work. Note: when I take off the entire command line - it works (but 32 hours after - I get the error message and it stop working).

What should be the appropriate settings in docker-compose to have it work smoothly?

Your Redis server is exposed to the public network and is being connected to by someone who sets a password on the instance at least, if not something worse. Secure your Redis with a password at the very least, if not disconnect it from the world, to reduce the threat. – Itamar Haber Jan 18 at 13:27 @ItamarHaber thanks. Could you share how you secure it on docker? I'm still straggling with the syntax. – adhg Jan 18 at 14:11

According to the celery docs, your broker url should be in this format:

redis://:password@hostname:port/db_number

i.e., you should remove user from the broker_url.

I haven't forgotten your answer! For some reason it takes few days to see if it works not (on the server side). I just revised it based on your strategy and let's see if it can last more then 4 days. Position and hold. Thanks again – adhg Jan 25 at 17:48

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0 with attribution required. rev 2019.6.12.33977