question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

./manage.py celeryd failed with django 1.10

See original GitHub issue

I have django-celery master installed with rev 838f59a367de746d27739c50675ddda8de9d6e0a I start the django-celery by ./manage.py celeyd, raise error

Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/djcelery/management/base.py", line 101, in run_from_argv
    return super(CeleryCommand, self).run_from_argv(argv)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/base.py", line 305, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/djcelery/management/base.py", line 94, in execute
    super(CeleryCommand, self).execute(*args, **options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/base.py", line 356, in execute
    output = self.handle(*args, **options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/djcelery/management/commands/celeryd.py", line 25, in handle
    worker.run(**options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/celery/bin/worker.py", line 199, in run
    hostname = self.host_format(default_nodename(hostname))
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/celery/utils/__init__.py", line 353, in default_nodename
    name, host = nodesplit(hostname or '')
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/celery/utils/__init__.py", line 346, in nodesplit
    parts = nodename.split(NODENAME_SEP, 1)
AttributeError: 'tuple' object has no attribute 'split'

the nodename here is (‘NO’, ‘DEFAULT’)

then if I start with python ./manage.py celeryd -n public.%h, same error raised, but the nodename here is [‘public.%h’].

What strange is python ./manage.py celeryd_detach --pidfile=./worker.pid -n public.%h runs.

Same code runs perfectly with django-celery==3.1.17 and django 1.9

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Stranger6667commented, Sep 2, 2016

Options list, passed to handle method of celeryd command:

{
    'autoreload': ('NO', 'DEFAULT'),
    'autoscale': ('NO', 'DEFAULT'),
    'beat': ('NO', 'DEFAULT'),
    'broker': None,
    'concurrency': 0,
    'detach': ('NO', 'DEFAULT'),
    'exclude_queues': [],
    'executable': None,
    'gid': None,
    'heartbeat_interval': ('NO', 'DEFAULT'),
    'hostname': ('NO', 'DEFAULT'),
    'include': [],
    'logfile': None,
    'loglevel': 'WARN',
    'max_tasks_per_child': None,
    'no_color': False,
    'no_execv': False,
    'optimization': ('NO', 'DEFAULT'),
    'pidfile': None,
    'pool_cls': 'prefork',
    'purge': False,
    'pythonpath': None,
    'queues': [],
    'quiet': ('NO', 'DEFAULT'),
    'schedule_filename': 'celerybeat-schedule',
    'scheduler_cls': ('NO', 'DEFAULT'),
    'send_events': False,
    'settings': None,
    'state_db': None,
    'task_soft_time_limit': None,
    'task_time_limit': None,
    'traceback': False,
    'uid': None,
    'umask': None,
    'verbosity': 1,
    'without_gossip': False,
    'without_heartbeat': False,
    'without_mingle': False,
    'working_directory': None,
}

It seems like ('NO', 'DEFAULT') is used everywhere. It is NO_DEFAULT from optparse

Options on 3.1.17 and Django 1.9.9:

{
    'autoreload': None,
    'autoscale': None,
    'beat': None,
    'broker': None,
    'concurrency': 0,
    'detach': None,
    'exclude_queues': [],
    'executable': None,
    'gid': None,
    'heartbeat_interval': None,
    'hostname': None,
    'include': [],
    'logfile': None,
    'loglevel': 'WARN',
    'max_tasks_per_child': None,
    'no_color': False,
    'no_execv': False,
    'optimization': None,
    'pidfile': None,
    'pool_cls': 'prefork',
    'purge': False,
    'pythonpath': None,
    'queues': [],
    'quiet': None,
    'schedule_filename': 'celerybeat-schedule',
    'scheduler_cls': None,
    'send_events': False,
    'settings': None,
    'state_db': None,
    'task_soft_time_limit': None,
    'task_time_limit': None,
    'traceback': None,
    'uid': None,
    'umask': None,
    'verbosity': 1,
    'without_gossip': False,
    'without_heartbeat': False,
    'without_mingle': False,
    'working_directory': None,
}

Differing options (old value --> new value):

autoreload: None --> ('NO', 'DEFAULT')
detach: None --> ('NO', 'DEFAULT')
autoscale: None --> ('NO', 'DEFAULT')
hostname: None --> ('NO', 'DEFAULT')
quiet: None --> ('NO', 'DEFAULT')
traceback: None --> False
beat: None --> ('NO', 'DEFAULT')
optimization: None --> ('NO', 'DEFAULT')
heartbeat_interval: None --> ('NO', 'DEFAULT')
scheduler_cls: None --> ('NO', 'DEFAULT')
0reactions
yjmadecommented, Sep 8, 2016

@Stranger6667 @auvipy I test with the most recent rev , but it still get problem

python ./manage.py celeryd -B -l info -n public.%h
Traceback (most recent call last):
  File "./manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/djcelery/management/base.py", line 103, in run_from_argv
    return super(CeleryCommand, self).run_from_argv(argv)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/base.py", line 305, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/djcelery/management/base.py", line 96, in execute
    super(CeleryCommand, self).execute(*args, **options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/base.py", line 356, in execute
    output = self.handle(*args, **options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/djcelery/management/commands/celeryd.py", line 25, in handle
    worker.run(**options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/celery/bin/worker.py", line 199, in run
    hostname = self.host_format(default_nodename(hostname))
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/celery/utils/__init__.py", line 353, in default_nodename
    name, host = nodesplit(hostname or '')
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/celery/utils/__init__.py", line 346, in nodesplit
    parts = nodename.split(NODENAME_SEP, 1)
AttributeError: 'list' object has no attribute 'split

the variable nodename is ['public.%h']

after I remove the -n parameter to

python ./manage.py celeryd -B -l info 
Traceback (most recent call last):
  File "./manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/djcelery/management/base.py", line 103, in run_from_argv
    return super(CeleryCommand, self).run_from_argv(argv)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/base.py", line 305, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/djcelery/management/base.py", line 96, in execute
    super(CeleryCommand, self).execute(*args, **options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/django/core/management/base.py", line 356, in execute
    output = self.handle(*args, **options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/djcelery/management/commands/celeryd.py", line 25, in handle
    worker.run(**options)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/celery/bin/worker.py", line 202, in run
    loglevel = mlevel(loglevel)
  File "/Users/yjmade/Envs/pbweb1.10/lib/python2.7/site-packages/celery/utils/log.py", line 119, in mlevel
    return LOG_LEVELS[level.upper()]
AttributeError: 'list' object has no attribute 'upper'

the varable here is ["info"]

after I remove all the parameters, it works

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not supported django 1.10.x yet? · Issue #483 - GitHub
cmd: python manage.py celery worker -l info startup failed: AttributeError: type object 'BaseCommand' has no attribute 'option_list'.
Read more >
Django Celery: manage.py celeryd returns "Unknown ...
As celery 3.1.25 seems to compatible with Django 1.10.7 ? I am getting an error unknown command celery when I removed djcelery from...
Read more >
Asynchronous Tasks With Django and Celery - Real Python
In this tutorial, you'll learn how to integrate Celery and Django using Redis as a message broker. You'll refactor the synchronous email ...
Read more >
How to create custom django-admin commands
In this document, we will be building a custom closepoll command for the polls application from the tutorial. To do this, add a...
Read more >
django-celery-results - PyPI
One such issue is when you try to run python manage.py migrate django_celery_results, you might get the following error: django.db.utils.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found