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
wuwukai007
V2EX  ›  Python

celery+redis 定时任务,每过一两天就挂掉,错误日志显示项目路径错误?但是已经跑了一两天了啊

  •  
  •   wuwukai007 · 2019-09-10 19:59:15 +08:00 · 2761 次点击
    这是一个创建于 1934 天前的主题,其中的信息可能已经有所发展或是发生改变。
    190587 [2019-09-10 01:53:06,549: INFO/ForkPoolWorker-2] Task celery_ta.tasks_new.run[fc97244c-6511-4572-9313-db220bc6ff9e] succeeded in 784.9328733524308s: None
    190588 [2019-09-10 02:08:58,151: INFO/MainProcess] beat: Shutting down...
    190589
    190590 -------------- celery@VM-0-9-ubuntu v4.2.0 (windowlicker)
    190591 ---- **** -----
    190592 --- * *** * -- Linux-4.4.0-130-generic-x86_64-with-Ubuntu-16.04-xenial 2019-09-09 07:31:13
    190593 -- * - **** ---
    190594 - ** ---------- [config]
    190595 - ** ---------- .> app: celery_ta.tasks_new:0x7f5b60bd69e8
    190596 - ** ---------- .> transport: redis://localhost:6379/0
    190597 - ** ---------- .> results: redis://localhost:6379/1
    190598 - *** --- * --- .> concurrency: 1 (prefork)
    190599 -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
    190600 --- ***** -----
    190601 -------------- [queues]
    190602 .> celery exchange=celery(direct) key=celery

    190605 [tasks]
    190606 . celery_ta.tasks_new.run
    190607
    190608 Traceback (most recent call last):
    190609 File "/usr/local/lib/python3.5/dist-packages/celery/app/utils.py", line 359, in find_app
    190610 sym = symbol_by_name(app, imp=imp)
    190611 File "/usr/local/lib/python3.5/dist-packages/celery/bin/base.py", line 504, in symbol_by_name
    190612 return imports.symbol_by_name(name, imp=imp)
    190613 File "/usr/local/lib/python3.5/dist-packages/kombu/utils/imports.py", line 62, in symbol_by_name
    190614 return getattr(module, cls_name) if cls_name else module
    190615 AttributeError: module 'celery_ta' has no attribute 'tasks_new'
    190616
    190617 During handling of the above exception, another exception occurred:
    190618
    190619 Traceback (most recent call last):
    190620 File "/usr/local/lib/python3.5/dist-packages/kombu/connection.py", line 431, in _reraise_as_library_errors
    190621 yield
    190622 File "/usr/local/lib/python3.5/dist-packages/kombu/connection.py", line 510, in _ensured
    190623 return fun(*args, **kwargs)
    190624 File "/usr/local/lib/python3.5/dist-packages/kombu/messaging.py", line 203, in _publish
    190625 mandatory=mandatory, immediate=immediate,
    190626 File "/usr/local/lib/python3.5/dist-packages/kombu/transport/virtual/base.py", line 608, in basic_publish
    190627 return self._put(routing_key, message, **kwargs)
    190628 File "/usr/local/lib/python3.5/dist-packages/kombu/transport/redis.py", line 779, in _put
    190629 client.lpush(self._q_for_pri(queue, pri), dumps(message))
    190630 File "/usr/local/lib/python3.5/dist-packages/redis/client.py", line 1611, in lpush
    190631 return self.execute_command('LPUSH', name, *values)
    190632 File "/usr/local/lib/python3.5/dist-packages/redis/client.py", line 775, in execute_command
    190633 return self.parse_response(connection, command_name, **options)
    190634 File "/usr/local/lib/python3.5/dist-packages/redis/client.py", line 789, in parse_response
    190635 response = connection.read_response()
    190636 File "/usr/local/lib/python3.5/dist-packages/redis/connection.py", line 642, in read_response
    190637 raise response
    190638 redis.exceptions.ReadOnlyError: You can't write against a read only slave.
    190639
    6 条回复    2019-09-11 15:55:33 +08:00
    Hopetree
        1
    Hopetree  
       2019-09-10 20:36:52 +08:00
    为啥我看最后一行日志是在说读写权限问题?
    BBCCBB
        2
    BBCCBB  
       2019-09-10 20:40:54 +08:00
    You can't write against a read only slave.

    你这是写到了 slave 上了?
    wuwukai007
        3
    wuwukai007  
    OP
       2019-09-11 08:27:42 +08:00 via Android
    看了下 redis 日志,莫名其妙有主从了,把 redis 重装了一下,不知道怎么样
    lolizeppelin
        4
    lolizeppelin  
       2019-09-11 11:50:12 +08:00
    写个代码的人,那么抵触读英文?
    julyclyde
        5
    julyclyde  
       2019-09-11 15:33:53 +08:00
    @wuwukai007 你居然不研究原因就无脑重装了一下
    John60676
        6
    John60676  
       2019-09-11 15:55:33 +08:00
    AttributeError: module 'celery_ta' has no attribute 'tasks_new'
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3825 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 05:09 · PVG 13:09 · LAX 21:09 · JFK 00:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.