V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ddmkchan
V2EX  ›  Python

django-rq 使用 django_redis, NOAUTH 异常

  •  
  •   ddmkchan · 2017-01-13 11:39:13 +08:00 · 2983 次点击
    这是一个创建于 2871 天前的主题,其中的信息可能已经有所发展或是发生改变。

    django-rq 使用 django_redis, redis.conf 未设置 password , 突然报 NOAUTH Authentication required.

    settings :

    CACHES = {
        "default": {
            "BACKEND": "django_redis.cache.RedisCache",
            "LOCATION": "redis://127.0.0.1:6379/0",
            "OPTIONS": {
                "CLIENT_CLASS": "django_redis.client.DefaultClient",
            }
        }
    }
    

    redis.conf, requirepass 行 未打开注释

    # Warning: since Redis is pretty fast an outside user can try up to
    # 150k passwords per second against a good box. This means that you should
    # use a very strong password otherwise it will be very easy to break.
    #
    #requirepass foobared
    
    

    django-rq exception

    2017-01-13 02:50:13,312 DEBG 'rqworker_high' stderr output:
        output = self.handle(*args, **options)
      File "/home/ec2-user/Envs/dev/local/lib/python2.7/site-packages/django_rq/management/commands/rqworker.py", line 76, in handle
        w.work(burst=options.get('burst', False))
      File "/home/ec2-user/Envs/dev/local/lib/python2.7/site-packages/rq/worker.py", line 340, in work
        self.register_birth()
      File "/home/ec2-user/Envs/dev/local/lib/python2.7/site-packages/rq/worker.py", line 206, in register_birth
        if self.connection.exists(self.key) and \
      File "/home/ec2-user/Envs/dev/local/lib/python2.7/site-packages/redis/client.py", line 838, in exists
    
    2017-01-13 02:50:13,312 DEBG 'rqworker_high' stderr output:
        return self.execute_command('EXISTS', name)
      File "/home/ec2-user/Envs/dev/local/lib/python2.7/site-packages/redis/client.py", line 565, in execute_command
        return self.parse_response(connection, command_name, **options)
      File "/home/ec2-user/Envs/dev/local/lib/python2.7/site-packages/redis/client.py", line 577, in parse_response
    
    2017-01-13 02:50:13,312 DEBG 'rqworker_high' stderr output:
        response = connection.read_response()
      File "/home/ec2-user/Envs/dev/local/lib/python2.7/site-packages/redis/connection.py", line 574, in read_response
        raise response
    
    2017-01-13 02:50:13,313 DEBG 'rqworker_high' stderr output:
    redis.exceptions.ResponseError: NOAUTH Authentication required.
    
    
    1 条回复    2017-01-14 00:38:40 +08:00
    xiaodiyu
        1
    xiaodiyu  
       2017-01-14 00:38:40 +08:00
    Try restarting redis server without the redis.conf file.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2628 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 05:06 · PVG 13:06 · LAX 21:06 · JFK 00:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.