2

I've just installed celery on my local machine (win10) with RabbitMQ and followed their beginners tutorial . But I get the error message TypeError: 'tuple' object is not callable

src>workon clicknstrip
(clicknstrip) src>python manage.py celery beat

celery beat v3.1.18 (Cipater) is starting.
__    -    ... __   -        _
Configuration ->
    . broker -> amqp://guest:**@localhost:5672//
    . loader -> celery.loaders.app.AppLoader
    . scheduler -> celery.beat.PersistentScheduler
    . db -> celerybeat-schedule
    . logfile -> [stderr]@%INFO
    . maxinterval -> now (0s)
[2015-08-13 10:01:13,441: INFO/MainProcess] beat: Starting...
[2015-08-13 10:01:13,466: WARNING/MainProcess] DB Reset: Account for new __version__ field
[2015-08-13 10:01:13,470: CRITICAL/MainProcess] beat raised exception <type 'exceptions.TypeError'>: TypeError("'tuple' object is not callable",)
Traceback (most recent call last):
  File "clicknstrip\lib\site-packages\celery\apps\beat.py", line 112, in start_scheduler
    beat.start()
  File "clicknstrip\lib\site-packages\celery\beat.py", line 454, in start
    humanize_seconds(self.scheduler.max_interval))
  File "clicknstrip\lib\site-packages\kombu\utils\__init__.py", line 322, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "clicknstrip\lib\site-packages\celery\beat.py", line 494, in scheduler
    return self.get_scheduler()
  File "clicknstrip\lib\site-packages\celery\beat.py", line 489, in get_scheduler
    lazy=lazy)
  File "clicknstrip\lib\site-packages\celery\utils\imports.py", line 53, in instantiate
    return symbol_by_name(name)(*args, **kwargs)
  File "clicknstrip\lib\site-packages\celery\beat.py", line 358, in __init__
    Scheduler.__init__(self, *args, **kwargs)
  File "clicknstrip\lib\site-packages\celery\beat.py", line 185, in __init__
    self.setup_schedule()
  File "clicknstrip\lib\site-packages\celery\beat.py", line 406, in setup_schedule
    self.install_default_entries(self.schedule)
  File "clicknstrip\lib\site-packages\celery\beat.py", line 190, in install_default_entries
    not self.app.backend.supports_autoexpire:
  File "clicknstrip\lib\site-packages\kombu\utils\__init__.py", line 322, in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "clicknstrip\lib\site-packages\celery\app\base.py", line 625, in backend
    return self._get_backend()
  File "clicknstrip\lib\site-packages\celery\app\base.py", line 444, in _get_backend
    return backend(app=self, url=url)
TypeError: 'tuple' object is not callable

This is my celery.py

from __future__ import absolute_import
import os
from celery import Celery

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'clicknstrip.settings.local')

from django.conf import settings

app = Celery('clicknstrip')

# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)


@app.task(bind=True)
def debug_task(self):
    print('Request: {0!r}'.format(self.request))

This is my task.py

from __future__ import absolute_import

from celery import shared_task


@shared_task
def add(x, y):
    return x + y


@shared_task
def mul(x, y):
    return x * y


@shared_task
def xsum(numbers):
    return sum(numbers)

1 Answer 1

6

Found my issue because I added an extra comma at the end of

CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend',

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.