maximkv25
@maximkv25
web-developer

Почему celery пишет ошибку ссылаясь на питон 2,7?

Запускаю и получаю вот такую ошибку
Please specify a different user using the -u option.

User information: uid=0 euid=0 gid=0 egid=0

  uid=uid, euid=euid, gid=gid, egid=egid,

 
 -------------- celery@vm115056.local v4.0.0 (latentcall)
---- **** ----- 
--- * ***  * -- Linux-4.4.0-34-generic-x86_64-with-Ubuntu-14.04-trusty 2017-02-21 13:50:38
-- * - **** --- 
- ** ---------- [config]
- ** ---------- .> app:         backend:0x7fd18c6e6150
- ** ---------- .> transport:   redis://localhost:6379//
- ** ---------- .> results:     redis://localhost:6379/
- *** --- * --- .> concurrency: 1 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- 
 -------------- [queues]
                .> celery           exchange=celery(direct) key=celery
                

[tasks]


[2017-02-21 13:50:39,888: ERROR/PoolWorker-1] Signal handler <bound method ?.on_worker_process_init of <celery.fixups.django.DjangoWorkerFixup object at 0x7fd18c638790>> raised: ImproperlyConfigured(u'Error loading MySQLdb module: No module named MySQLdb',)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/utils/dispatch/signal.py", line 167, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.7/dist-packages/celery/fixups/django.py", line 149, in on_worker_process_init
    for c in self._db.connections.all():
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 227, in all
    return [self[alias] for alias in self]
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 212, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 116, in load_backend
    return import_module('%s.base' % backend_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 28, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
[2017-02-21 13:50:40,184: INFO/MainProcess] Connected to redis://localhost:6379//
[2017-02-21 13:50:40,194: INFO/MainProcess] mingle: searching for neighbors
[2017-02-21 13:50:41,587: INFO/MainProcess] mingle: all alone
/usr/local/lib/python2.7/dist-packages/celery/fixups/django.py:202: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
  warnings.warn('Using settings.DEBUG leads to a memory leak, never '

[2017-02-21 13:50:41,595: WARNING/MainProcess] /usr/local/lib/python2.7/dist-packages/celery/fixups/django.py:202: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
  warnings.warn('Using settings.DEBUG leads to a memory leak, never '

[2017-02-21 13:50:41,595: INFO/MainProcess] celery@vm115056.local ready.


а когда запускаю beat, то он вообще выкидывает и пишет
Configuration ->
    . broker -> redis://localhost:6379//
    . loader -> celery.loaders.app.AppLoader
    . scheduler -> celery.beat.PersistentScheduler
    . db -> celerybeat-schedule
    . logfile -> [stderr]@%INFO
    . maxinterval -> 5.00 minutes (300s)
[2017-02-21 13:52:39,289: INFO/MainProcess] beat: Starting...
[2017-02-21 13:52:39,392: CRITICAL/MainProcess] beat raised exception <type 'exceptions.ValueError'>: ValueError('unsupported pickle protocol: 3',)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/apps/beat.py", line 107, in start_scheduler
    service.start()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 528, in start
    humanize_seconds(self.scheduler.max_interval))
  File "/usr/local/lib/python2.7/dist-packages/kombu/utils/objects.py", line 44, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 572, in scheduler
    return self.get_scheduler()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 567, in get_scheduler
    lazy=lazy,
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 407, in __init__
    Scheduler.__init__(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 204, in __init__
    self.setup_schedule()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 435, in setup_schedule
    self._create_schedule()
  File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 464, in _create_schedule
    self._store[str('entries')]
  File "/usr/lib/python2.7/shelve.py", line 122, in __getitem__
    value = Unpickler(f).load()
ValueError: unsupported pickle protocol: 3
[2017-02-21 13:52:39,394: WARNING/MainProcess] Traceback (most recent call last):
[2017-02-21 13:52:39,394: WARNING/MainProcess] File "/usr/local/bin/celery", line 11, in <module>
[2017-02-21 13:52:39,394: WARNING/MainProcess] sys.exit(main())
[2017-02-21 13:52:39,483: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/__main__.py", line 14, in main
[2017-02-21 13:52:39,483: WARNING/MainProcess] _main()
[2017-02-21 13:52:39,483: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 326, in main
[2017-02-21 13:52:39,484: WARNING/MainProcess] cmd.execute_from_commandline(argv)
[2017-02-21 13:52:39,484: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 488, in execute_from_commandline
[2017-02-21 13:52:39,484: WARNING/MainProcess] super(CeleryCommand, self).execute_from_commandline(argv)))
[2017-02-21 13:52:39,484: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 278, in execute_from_commandline
[2017-02-21 13:52:39,485: WARNING/MainProcess] return self.handle_argv(self.prog_name, argv[1:])
[2017-02-21 13:52:39,485: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 480, in handle_argv
[2017-02-21 13:52:39,485: WARNING/MainProcess] return self.execute(command, argv)
[2017-02-21 13:52:39,485: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 412, in execute
[2017-02-21 13:52:39,486: WARNING/MainProcess] ).run_from_argv(self.prog_name, argv[1:], command=argv[0])
[2017-02-21 13:52:39,486: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 282, in run_from_argv
[2017-02-21 13:52:39,487: WARNING/MainProcess] sys.argv if argv is None else argv, command)
[2017-02-21 13:52:39,487: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 365, in handle_argv
[2017-02-21 13:52:39,487: WARNING/MainProcess] return self(*args, **options)
[2017-02-21 13:52:39,487: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 241, in __call__
[2017-02-21 13:52:39,487: WARNING/MainProcess] ret = self.run(*args, **kwargs)
[2017-02-21 13:52:39,488: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/bin/beat.py", line 107, in run
[2017-02-21 13:52:39,488: WARNING/MainProcess] return beat().run()
[2017-02-21 13:52:39,488: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/apps/beat.py", line 79, in run
[2017-02-21 13:52:39,488: WARNING/MainProcess] self.start_scheduler()
[2017-02-21 13:52:39,488: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/apps/beat.py", line 107, in start_scheduler
[2017-02-21 13:52:39,489: WARNING/MainProcess] service.start()
[2017-02-21 13:52:39,489: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 528, in start
[2017-02-21 13:52:39,489: WARNING/MainProcess] humanize_seconds(self.scheduler.max_interval))
[2017-02-21 13:52:39,489: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/kombu/utils/objects.py", line 44, in __get__
[2017-02-21 13:52:39,490: WARNING/MainProcess] value = obj.__dict__[self.__name__] = self.__get(obj)
[2017-02-21 13:52:39,490: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 572, in scheduler
[2017-02-21 13:52:39,490: WARNING/MainProcess] return self.get_scheduler()
[2017-02-21 13:52:39,583: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 567, in get_scheduler
[2017-02-21 13:52:39,583: WARNING/MainProcess] lazy=lazy,
[2017-02-21 13:52:39,583: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 407, in __init__
[2017-02-21 13:52:39,583: WARNING/MainProcess] Scheduler.__init__(self, *args, **kwargs)
[2017-02-21 13:52:39,583: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 204, in __init__
[2017-02-21 13:52:39,584: WARNING/MainProcess] self.setup_schedule()
[2017-02-21 13:52:39,584: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 435, in setup_schedule
[2017-02-21 13:52:39,584: WARNING/MainProcess] self._create_schedule()
[2017-02-21 13:52:39,584: WARNING/MainProcess] File "/usr/local/lib/python2.7/dist-packages/celery/beat.py", line 464, in _create_schedule
[2017-02-21 13:52:39,584: WARNING/MainProcess] self._store[str('entries')]
[2017-02-21 13:52:39,584: WARNING/MainProcess] File "/usr/lib/python2.7/shelve.py", line 122, in __getitem__
[2017-02-21 13:52:39,584: WARNING/MainProcess] value = Unpickler(f).load()
[2017-02-21 13:52:39,585: WARNING/MainProcess] ValueError
[2017-02-21 13:52:39,585: WARNING/MainProcess] :
[2017-02-21 13:52:39,585: WARNING/MainProcess] unsupported pickle protocol: 3


И это все ссылается на 2,7 хотя у меня 3,4
Почему так?
  • Вопрос задан
  • 625 просмотров
Решения вопроса 1
maximkv25
@maximkv25 Автор вопроса
web-developer
Нашел причину, celery смотрит на второй питон

смотрим настройки celery
head -n 10 /usr/local/bin/celery
если указан
#!/usr/bin/python
собственно меняем на третий
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
@dmtrrr
Backend developer
1) Error loading MySQLdb module - видимо, не установлена библиотека для работы с МуSQL
2) unsupported pickle protocol: 3 - смотрите, что задали в конфиге celery
3) посмотрите версию установленного в системе питона, скорее всего это 2.7 и именно он и запускается
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы