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

2019-09-10 19:59:15 +08:00
 wuwukai007
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
2639 次点击
所在节点    Python
6 条回复
Hopetree
2019-09-10 20:36:52 +08:00
为啥我看最后一行日志是在说读写权限问题?
BBCCBB
2019-09-10 20:40:54 +08:00
You can't write against a read only slave.

你这是写到了 slave 上了?
wuwukai007
2019-09-11 08:27:42 +08:00
看了下 redis 日志,莫名其妙有主从了,把 redis 重装了一下,不知道怎么样
lolizeppelin
2019-09-11 11:50:12 +08:00
写个代码的人,那么抵触读英文?
julyclyde
2019-09-11 15:33:53 +08:00
@wuwukai007 你居然不研究原因就无脑重装了一下
John60676
2019-09-11 15:55:33 +08:00
AttributeError: module 'celery_ta' has no attribute 'tasks_new'

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/599763

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX