Closed
Description
There is an error when start celery workers through manage.py command.
celery 3.1.25
django 1.11.2
(mr) vlad-mbp:mr novarg$ ./manage.py celery worker -P gevent -l DEBUG -Q default,celery,ldapsync_tasks,email_release_tasks
master
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_from_command_line(sys.argv)
File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/django/core/management/__init__.py", line 205, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/django/core/management/__init__.py", line 40, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__
result = _import(*args, **kwargs)
File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/djcelery/management/commands/celery.py", line 11, in <module>
class Command(CeleryCommand):
File "/Users/novarg/.virtualenvs/mr/lib/python2.7/site-packages/djcelery/management/commands/celery.py", line 23, in Command
preload_options)
TypeError: can only concatenate list (not "tuple") to list
It seems that base.preload_options is tuple while others are lists.
Activity
stuaxo commentedon Jun 17, 2019
Confirming.
Installing 3.2.2 works as a workaround.
stuaxo commentedon Jun 17, 2019
You can trigger it with most options, e.g.
python manage.py celery list bindings
.maxmalysh commentedon Jun 17, 2019
Python 3.7.3
django==1.11.21
celery==3.1.26.post2
django-celery==3.3.0
3.2.2 works fine.
jttttttttttttt commentedon Jul 11, 2019
Python 3.6.8
django==2.1.10
celery==3.1.26.post2
django-celery==3.3.0
TypeError: can only concatenate list (not "tuple") to list
django-celery 3.2.2 works fine.
Foolproof prevention via strict tuples. Fix celery#573
stuaxo commentedon Jul 11, 2019
Thank you!
Nice elegant solution :)
frost-nzcr4 commentedon Jul 12, 2019
That fix also closes #560 and #575
Foolproof prevention via strict tuples. Fix celery#573 (celery#576)
lhypj commentedon Jan 6, 2020
python3.7 cannot run with celery?
frost-nzcr4 commentedon Feb 11, 2020
@SUNNYWILLHAPPEN this error not about Python version, you're need django-celery==3.3.1 at least.