Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documation fix for django 1.7 "App registry isn't ready yet" #2126

Closed
thenewguy opened this issue Jul 7, 2014 · 41 comments
Closed

documation fix for django 1.7 "App registry isn't ready yet" #2126

thenewguy opened this issue Jul 7, 2014 · 41 comments

Comments

@thenewguy
Copy link

The celery app file needs to call django.setup in django 1.7 or you get an exception stating "App registry isn't ready yet" when a task is run.

See https://docs.djangoproject.com/en/dev/releases/1.7/#standalone-scripts

The documentation for first steps with django (http://docs.celeryproject.org/en/master/django/first-steps-with-django.html) need to be updated to reflect this.

@ask
Copy link
Contributor

ask commented Jul 9, 2014

This is fixed in 3.1 branch, and will be part of 3.1.13

@ask ask closed this as completed Jul 9, 2014
@ask
Copy link
Contributor

ask commented Jul 9, 2014

Looking into it, this should already have been fixed in 3.1.12.

It definitely also works for me when starting the worker? Exactly when are you having a problem?

The proj/celery.py module should most definitely not call django.setup(), it's handled by the "django fixups" when the worker starts.

@ask ask reopened this Jul 9, 2014
@thenewguy
Copy link
Author

I think this was an issue with my virtualenv. I uninstalled and reinstalled celery and am not seeing the issue now after your last comment.

@mpasternak
Copy link

Looks like this is NOT fixed in 3.1.13

@ask
Copy link
Contributor

ask commented Jul 18, 2014

What do you mean by looks?

@mpasternak
Copy link

Well, I am struggling with this problem now. I'm unable to access any models in my tasks.py file, because of AppRegistryNotReady . I am using 3.1.13 from PyPI.

One question, as I am debugging stuff... should celery.fixups.django.DjangoWorkerFixup.validate_models be called once when the celery daemon starts, or once per each worker?

It looks like it is called once and the stack looks like this by that time:

image

@mpasternak
Copy link

And yes, I am on Windows 8 + Python 2.7 32-bit.

@mpasternak
Copy link

As for 3.1.13, please re-open this bug.

Even if django.setup() procedure is called in django.py, I am getting this traceback.

[2014-07-18 16:15:35,117: ERROR/Worker-1] bpp.tasks.zaktualizuj_opis[8e93003c-fca4-4970-8be3-32eeede5fbb1]: Problem z pobraniem obiektu
Traceback (most recent call last):
  File "C:/Users/dotz/Desktop/django-bpp\bpp\tasks.py", line 79, in zaktualizuj_opis
    obj = klasa.objects.get(pk=pk)
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\query.py", line 345, in get
    clone = self.filter(*args, **kwargs)
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\query.py", line 689, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\query.py", line 707, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\sql\query.py", line 1287, in add_q
    clause, require_inner = self._add_q(where_part, self.used_aliases)
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\sql\query.py", line 1314, in _add_q
    current_negated=current_negated, connector=connector)
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\sql\query.py", line 1138, in build_filter
    lookups, parts, reffed_aggregate = self.solve_lookup_type(arg)
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\sql\query.py", line 1076, in solve_lookup_type
    _, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\sql\query.py", line 1339, in names_to_path
    field, model, direct, m2m = opts.get_field_by_name(name)
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\options.py", line 416, in get_field_by_name
    cache = self.init_name_map()
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\options.py", line 445, in init_name_map
    for f, model in self.get_all_related_m2m_objects_with_model():
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\options.py", line 561, in get_all_related_m2m_objects_with_model
    cache = self._fill_related_many_to_many_cache()
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\db\models\options.py", line 575, in _fill_related_many_to_many_cache
    for klass in self.apps.get_models():
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\utils\lru_cache.py", line 101, in wrapper
    result = user_function(*args, **kwds)
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\apps\registry.py", line 156, in get_models
    self.check_ready()
  File "c:\users\dotz\desktop\django-bpp\venv\lib\site-packages\django\apps\registry.py", line 119, in check_ready
    raise AppRegistryNotReady()
AppRegistryNotReady

@ask
Copy link
Contributor

ask commented Jul 18, 2014

It's not the same issue though, under no circumstances should users add django.setup() to proj/celery.py.

Windows does not have fork, so it emulates it by starting a brand new process (like exec in posix). May very well be that the fix ups should be applied to the child processes as well.

@mpasternak
Copy link

What would be the best place to call django.setup() in worker code?

I added django.setup() celery.apps.worker.Worker.on_after_init , without any success.

@ask
Copy link
Contributor

ask commented Jul 18, 2014

worker_process_init signal perhaps

@j7nn7k
Copy link

j7nn7k commented Aug 5, 2014

Same here. My setup Django 1.7c2, celery 3.1.13.

send_messages.delay(self) # <- self is a model_onstance

@shared_task
def send_messages(jmodel_instance):

    if job_model_instance.field_type == 'SM':
        do_stuff()

Error:

raise AppRegistryNotReady("Models aren't loaded yet.")

@hheimbuerger
Copy link

I just had the same issue with Django 1.7rc2 and celery 3.1.13 in a basically empty test project. I don't even have or want any models, so I can confirm that this in my tasks.py fixed the issue for me:

from celery.signals import worker_process_init
@worker_process_init.connect
def configure_workers(*args, **kwargs):
    import django
    django.setup()

@j7nn7k
Copy link

j7nn7k commented Aug 6, 2014

Doesn't work for me unfortunately.

@ask
Copy link
Contributor

ask commented Aug 6, 2014

Are you all using Windows? Do you not get a traceback when this happens?

@j7nn7k
Copy link

j7nn7k commented Aug 6, 2014

I' using a Mac. Here's the complete trace.

    DecodeError: (AppRegistryNotReady("Models aren't loaded yet.",), <function model_unpickle at 0x10d44f668>, (('jobs', 'Job'), [], <function simple_class_factory at 0x10d44f5f0>))
    [2014-08-06 19:59:00,636: CRITICAL/MainProcess] Can't decode message body: DecodeError(AppRegistryNotReady(AppRegistryNotReady("Models aren't loaded yet.",), <function model_unpickle at 0x10d44f668>, (('jobs', 'Job'), [], <function simple_class_factory at 0x10d44f5f0>)),) [type:u'application/x-python-serialize' encoding:u'binary' headers:{}]

    body: '\x80\x02}q\x01(U\x07expiresq\x02NU\x03utcq\x03\x88U\x04argsq\x04cdjango.db.models.base\nmodel_unpickle\nq\x05U\x04jobsq\x06U\x03Jobq\x07\x86]cdjango.db.models.base\nsimple_class_factory\nq\x08\x87Rq\t}q\n(U\x0f_schedule_cacheNU\x0btemplate_idK\x01U\x11_created_by_cachecdjango.contrib.auth.models\nUser\nq\x0b)\x81q\x0c}q\r(U\x08usernameq\x0eX\x06\x00\x00\x00jannikU\nfirst_nameq\x0fX\x00\x00\x00\x00U\tlast_nameq\x10X\x00\x00\x00\x00U\tis_activeq\x11\x88U\x06_stateq\x12cdjango.db.models.base\nModelState\nq\x13)\x81q\x14}q\x15(U\x06addingq\x16\x89U\x02dbq\x17U\x07defaultq\x18ubU\x05emailq\x19X\x17\x00\x00\x00jannikweyrich@gmail.comU\x0cis_superuserq\x1a\x88U\x08is_staffq\x1b\x88U\nlast_loginq\x1ccdatetime\ndatetime\nq\x1dU\n\x07\xde\x08\x05\x1255\x07x\x0ccpytz\n_UTC\nq\x1e)Rq\x1f\x86Rq... (1211b)
    Traceback (most recent call last):
      File "MYPROJECT/venv/lib/python2.7/site-packages/kombu/messaging.py", line 586, in _receive_callback
        decoded = None if on_m else message.decode()
      File "MYPROJECT/venv/lib/python2.7/site-packages/kombu/message.py", line 142, in decode
        self.content_encoding, accept=self.accept)
      File "MYPROJECT/venv/lib/python2.7/site-packages/kombu/serialization.py", line 184, in loads
        return decode(data)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "MYPROJECT/venv/lib/python2.7/site-packages/kombu/serialization.py", line 59, in _reraise_errors
        reraise(wrapper, wrapper(exc), sys.exc_info()[2])
      File "MYPROJECT/venv/lib/python2.7/site-packages/kombu/serialization.py", line 55, in _reraise_errors
        yield
      File "MYPROJECT/venv/lib/python2.7/site-packages/kombu/serialization.py", line 184, in loads
        return decode(data)
      File "MYPROJECT/venv/lib/python2.7/site-packages/kombu/serialization.py", line 64, in pickle_loads
        return load(BytesIO(s))
      File "MYPROJECT/venv/lib/python2.7/site-packages/django/db/models/base.py", line 1471, in model_unpickle
        model = apps.get_model(*model_id)
      File "MYPROJECT/venv/lib/python2.7/site-packages/django/apps/registry.py", line 199, in get_model
        self.check_models_ready()
      File "MYPROJECT/venv/lib/python2.7/site-packages/django/apps/registry.py", line 131, in check_models_ready
        raise AppRegistryNotReady("Models aren't loaded yet.")
    DecodeError: (AppRegistryNotReady("Models aren't loaded yet.",), <function model_unpickle at 0x10d44f668>, (('jobs', 'Job'), [], <function simple_class_factory at 0x10d44f5f0>))

@ask
Copy link
Contributor

ask commented Aug 8, 2014

Commit 0882ab5 should fix this on Windows

@ask ask reopened this Aug 8, 2014
@ask
Copy link
Contributor

ask commented Aug 8, 2014

@j7nn7k You're 100% sure you don't use djcelery.setup_loader()?

@hheimbuerger
Copy link

I am using djcelery.setup_loader(), why would I not?

It's in the instructions, and if I don't have it, then the BROKER_BACKEND = 'django' in my settings.py seems to be ignored and celery complains about being unable to connect to amqp://guest:**@127.0.0.1:5672/ (correct, because I don't have that) instead of using the Django backend.

@j7nn7k
Copy link

j7nn7k commented Aug 10, 2014

I don't use djcelery.setup_loader()

@j7nn7k
Copy link

j7nn7k commented Aug 10, 2014

Figured it out.
I made two mistakes.

1.) I didn't start celery with the app param (-A).

wrong:
celery worker

right:
celery worker -A proj # <- executed from manage.py dir

2.)
Didn't reference the correct django settings in celery.py. This is my config for development.

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings_dev')

Sorry guys and thanks for your help!

@ask
Copy link
Contributor

ask commented Aug 11, 2014

That documentation is old and using setup_loader will disable the core celery integration. It will simply assume that you are using the old django-celery integration.

The canonical docs are here: http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
Don't mix and match the new and old tutorials, so if you insist on using the old django-celery integration,
you probably shouldn't have a celery.py either, and especially not one that sets the DJANGO_SETTINGS_MODULE environment.

If you use setup_loader then you have use manage.py celery and add djcelery to installed apps,
like in the old days.

@ask
Copy link
Contributor

ask commented Aug 11, 2014

@j7nn7k Good to know it's working. the -A must be used so that it finds your Celery app instance, and when it imports the celery.py module it will also have the correct DJANGO_SETTINGS_MODULE set.
(-A proj is short for -A proj.celery:app which means the worker will do a from proj.celery import app)

@limpbrains
Copy link

I have similar error when I'm trying to use django.utils.translation.ugettext in my models.py
I'm on linux, Django 1.7 rc2, Celery v3.1.13

Everything accoding to http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
Trace:

(env)limpbrains@omg:~/dev/cc$ celery -A tst worker --loglevel=debug
Traceback (most recent call last):
  File "/home/limpbrains/dev/cc/env/bin/celery", line 11, in <module>
    sys.exit(main())
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/__main__.py", line 30, in main
    main()
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/bin/celery.py", line 81, in main
    cmd.execute_from_commandline(argv)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/bin/celery.py", line 769, in execute_from_commandline
    super(CeleryCommand, self).execute_from_commandline(argv)))
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/bin/base.py", line 307, in execute_from_commandline
    return self.handle_argv(self.prog_name, argv[1:])
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/bin/celery.py", line 761, in handle_argv
    return self.execute(command, argv)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/bin/celery.py", line 693, in execute
    ).run_from_argv(self.prog_name, argv[1:], command=argv[0])
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/bin/worker.py", line 179, in run_from_argv
    return self(*args, **options)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/bin/base.py", line 270, in __call__
    ret = self.run(*args, **kwargs)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/bin/worker.py", line 212, in run
    state_db=self.node_format(state_db, hostname), **kwargs
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/worker/__init__.py", line 95, in __init__
    self.app.loader.init_worker()
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/loaders/base.py", line 128, in init_worker
    self.import_default_modules()
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/loaders/base.py", line 116, in import_default_modules
    signals.import_modules.send(sender=self.app)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/utils/dispatch/signal.py", line 166, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/amqp/utils.py", line 42, in __call__
    self.set_error_state(exc)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/amqp/utils.py", line 39, in __call__
    **dict(self.kwargs, **kwargs) if self.kwargs else kwargs
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/app/base.py", line 329, in _autodiscover_tasks
    self.loader.autodiscover_tasks(packages, related_name)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/loaders/base.py", line 251, in autodiscover_tasks
    related_name) if mod)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/loaders/base.py", line 272, in autodiscover_tasks
    return [find_related_module(pkg, related_name) for pkg in packages]
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/celery/loaders/base.py", line 291, in find_related_module
    return importlib.import_module('{0}.{1}'.format(package, related_name))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/limpbrains/dev/cc/env/src/django-cc/cc/tasks.py", line 9, in <module>
    from cc.models import Wallet
  File "/home/limpbrains/dev/cc/env/src/django-cc/cc/models.py", line 18, in <module>
    class Wallet(models.Model):
  File "/home/limpbrains/dev/cc/env/src/django-cc/cc/models.py", line 19, in Wallet
    currency = models.CharField(_('Currency'), max_length=3, choices=currencies_coices())
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 83, in ugettext
    return _trans.ugettext(message)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 325, in ugettext
    return do_translate(message, 'ugettext')
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 306, in do_translate
    _default = translation(settings.LANGUAGE_CODE)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 209, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/home/limpbrains/dev/cc/env/local/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 189, in _fetch
    "The translation infrastructure cannot be initialized before the "
django.core.exceptions.AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.

@hheimbuerger
Copy link

@ask I'm using setup_loader, I have djcelery in my installed apps, I don't have a celery.py and I'm using manage.py celery for all management commands. So as far as I can tell, I'm fully following the "old instructions" and not mix and matching.

@hheimbuerger
Copy link

FYI: the reason I had this issue only in the small test project and not in my main project is that there I'm using CELERYD_POOL = 'celery.concurrency.threads:TaskPool' for development.

@w-
Copy link
Contributor

w- commented Aug 25, 2014

hi. This does not work for me
> cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"

django 1.7rc3
celery 3.1.13

I attempt to run
celery worker -A <project_name>

and I get

django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

Is there something else i should be doing?

@webjunkie
Copy link

I have this error too, same as @limpbrains

The translation infrastructure cannot be initialized before the apps registry is ready

Did anyone find a solution?

@baoyiluo
Copy link

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application() can fix this problem! @webjunkie

@jijingg
Copy link

jijingg commented Nov 25, 2014

i add from django.contrib.auth.admin import User to models.py (i'm sure the issue caused by this line)
then python manage.py syncdb
django1.7 raised:

  File "/home/jijing/lab/django17/lib/python2.7/site-packages/django/db/models/options.py", line 577, in _fill_related_many_to_many_cache
    for klass in self.apps.get_models():
  File "/home/jijing/lab/django17/lib/python2.7/site-packages/django/utils/lru_cache.py", line 101, in wrapper
    result = user_function(*args, **kwds)
  File "/home/jijing/lab/django17/lib/python2.7/site-packages/django/apps/registry.py", line 168, in get_models
    self.check_models_ready()
  File "/home/jijing/lab/django17/lib/python2.7/site-packages/django/apps/registry.py", line 131, in check_models_ready
    raise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

@sreedharbukya
Copy link

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
upgraded django 1.7
This above hasn't fixed my below error for translation

The translation infrastructure cannot be initialized before the apps registry is ready
what other things I should change.

@koliyo
Copy link

koliyo commented Jan 26, 2015

I have the same problem, I updated to django 1.7 and now I get the AppRegistryNotReady exception. I'm using the old django-celery setup.

I am using celeryd daemon to launch the workers. Note that if I launch them manually using
python manage.py celery worker --loglevel=info
it does work. But when using the 'celery multi' command, which is used by celeryd, I get the AppRegistryNotReady exception.

@findsarfaraz
Copy link

I am also facing the same issue.
raise AppRegistryNotReady("Models aren't loaded yet.")

Celery documentation has many links which shows different ways to integrate celery with DJANGO. One says include celery.py in main project. Other has djcelery thing. Everyone thing just melt down to confusion.

I have documented my issue in the following link. Has anyone fixed it please reply.

https://groups.google.com/forum/#!topic/django-users/c_LOQ_nUvmw

@illagrenan
Copy link

I have same problem (AppRegistryNotReady: Models aren't loaded yet.) on Windows 8.1 and Django 1.7 using djcelery==3.1.16.

This worked for me:

$ (env) pip uninstall celery
$ (env) pip install celery

Btw I agree with @findsarfaraz – the documentation about integrating Celery with Django is confusing.

@mkuchen
Copy link

mkuchen commented Feb 27, 2015

@ask I'm facing the same issue. I just upgraded Django from 1.6 to 1.7 (using Heroku/foreman for local development). Celery version is 3.1.17. I also have django-celery installed, version 3.1.16.

My wsgi.py file uses the proper application syntax:

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

...and my Procfile is as follows:

web: newrelic-admin run-program gunicorn -c gunicorn.py.ini wsgi:application
scheduler: newrelic-admin run-program celery beat --loglevel=INFO --app=api.celery:app
worker: newrelic-admin run-program celery worker -Q celery -E --loglevel=INFO --maxtasksperchild=200 --app=api.celery:app
periodic: newrelic-admin run-program celery worker -Q periodic -E --loglevel=INFO --maxtasksperchild=200 --app=api.celery:app

When I remove the scheduler, worker, and periodic lines, foreman start executes properly and runs without a hitch. But when I add the Celery commands back in, I get:

django.core.exceptions.AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.

However, when I run from my command line:

foreman run python manage.py celery worker -Q celery -E --loglevel=INFO --maxtasksperchild=200 --app=api.celery:app

It runs properly. Any thoughts here? It seems to have something to do with the way Celery is loading Django's translations module.

@mkuchen
Copy link

mkuchen commented Feb 27, 2015

@limpbrains @sreedharbukya @ask I was able to fix the error by changing my celery.py file. It was originally:

# ...
app = Celery('api')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings')
# ...

I just switched those 2 lines and the issue was resolved, so:

# ...
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings')
app = Celery('api')
# ...

Hope this helps somebody!

@adambratt
Copy link

@mkuchen hahaha of all people to meet on a github comment :)

Well you just helped me!

@mkuchen
Copy link

mkuchen commented Mar 27, 2015

@adambratt say whaaaat! What a coincidence. IIRC you were the one who introduced me to Celery in the first place. Talk about full-circle!

@barneyjackson
Copy link

Still experiencing this issue running Linux 14.04, Django 1.7, Celery 3.1.18. Is there a known fix/workaround/upgrade for this @ask? The change history in the docs implies 3.1.14/15 fixes it.

@nilliams
Copy link

Adding what worked for me in case it helps anyone:

None of the above solutions I've read in this and other threads worked for me. I'm running Django 1.8, Celery 3.1.18, django-celery 3.1.6 and starting workers via manage.py celery.

What appeared to magically fix the "Models aren't loaded yet." problem for me was disabling CELERYD_FORCE_EXECV as strongly recommended in the celery 3.1.7 release notes: http://docs.celeryproject.org/en/latest/changelog.html#version-3-1-17

(Even though the 2 things don't seem like they should be related).

@ask
Copy link
Contributor

ask commented Dec 5, 2015

I don't think this is an actual issue anymore, more about some common pitfalls when integrating django/celery

@ask ask closed this as completed Dec 5, 2015
vgatica-eb referenced this issue in eventbrite/celery Jul 8, 2021
Changelog Details:
Change history
================
This document contains change notes for bugfix releases in the 3.1.x series
(Cipater), please see :ref:`whatsnew-3.1` for an overview of what's
new in Celery 3.1.
.. _version-3.1.26:
3.1.26
======
:release-date: 2018-23-03 16:00 PM IST
:release-by: Omer Katz
- Fixed a crash caused by tasks cycling between Celery 3 and Celery 4 workers.
.. _version-3.1.25:
3.1.25
======
:release-date: 2016-10-10 12:00 PM PDT
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.37 <kombu:version-3.0.37>`
- Fixed problem with chords in group introduced in 3.1.24 (Issue #3504).
.. _version-3.1.24:
3.1.24
======
:release-date: 2016-09-30 04:21 PM PDT
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.36 <kombu:version-3.0.36>`.
- Now supports Task protocol 2 from the future 4.0 release.
Workers running 3.1.24 are now able to process messages
sent using the `new task message protocol`_ to be introduced
in Celery 4.0.
Users upgrading to Celery 4.0 when this is released are encouraged
to upgrade to this version as an intermediate step, as this
means workers not yet upgraded will be able to process
messages from clients/workers running 4.0.
.. _`new task message protocol`:
http://docs.celeryproject.org/en/master/internals/protocol.html#version-2
- ``Task.send_events`` can now be set to disable sending of events
for that task only.
Example when defining the task:
.. code-block:: python
@app.task(send_events=False)
def add(x, y):
return x + y
- **Utils**: Fixed compatibility with recent :pypi:`psutil` versions
(Issue #3262).
- **Canvas**: Chord now forwards partial arguments to its subtasks.
Fix contributed by Tayfun Sen.
- **App**: Arguments to app such as ``backend``, ``broker``, etc
are now pickled and sent to the child processes on Windows.
Fix contributed by Jeremy Zafran.
- **Deployment**: Generic init scripts now supports being symlinked
in runlevel directories (Issue #3208).
- **Deployment**: Updated CentOS scripts to work with CentOS 7.
Contributed by Joe Sanford.
- **Events**: The curses monitor no longer crashes when the
result of a task is empty.
Fix contributed by Dongweiming.
- **Worker**: ``repr(worker)`` would crash when called early
in the startup process (Issue #2514).
- **Tasks**: GroupResult now defines __bool__ and __nonzero__.
This is to fix an issue where a ResultSet or GroupResult with an empty
result list are not properly tupled with the as_tuple() method when it is
a parent result. This is due to the as_tuple() method performing a logical
and operation on the ResultSet.
Fix contributed by Colin McIntosh.
- **Worker**: Fixed wrong values in autoscale related logging message.
Fix contributed by ``@raducc``.
- Documentation improvements by
* Alexandru Chirila
* Michael Aquilina
* Mikko Ekström
* Mitchel Humpherys
* Thomas A. Neil
* Tiago Moreira Vieira
* Yuriy Syrovetskiy
* ``@dessant``
.. _version-3.1.23:
3.1.23
======
:release-date: 2016-03-09 06:00 P.M PST
:release-by: Ask Solem
- **Programs**: Last release broke support for the ``--hostnmame`` argument
to :program:`celery multi` and :program:`celery worker --detach`
(Issue #3103).
- **Results**: MongoDB result backend could crash the worker at startup
if not configured using an URL.
.. _version-3.1.22:
3.1.22
======
:release-date: 2016-03-07 01:30 P.M PST
:release-by: Ask Solem
- **Programs**: The worker would crash immediately on startup on
``backend.as_uri()`` when using some result backends (Issue #3094).
- **Programs**: :program:`celery multi`/:program:`celery worker --detach`
would create an extraneous logfile including literal formats (e.g. ``%I``)
in the filename (Issue #3096).
.. _version-3.1.21:
3.1.21
======
:release-date: 2016-03-04 11:16 A.M PST
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.34 <kombu:version-3.0.34>`.
- Now depends on :mod:`billiard` 3.3.0.23.
- **Prefork pool**: Fixes 100% CPU loop on Linux epoll (Issue #1845).
Also potential fix for: Issue #2142, Issue #2606
- **Prefork pool**: Fixes memory leak related to processes exiting
(Issue #2927).
- **Worker**: Fixes crash at startup when trying to censor passwords
in MongoDB and Cache result backend URLs (Issue #3079, Issue #3045,
Issue #3049, Issue #3068, Issue #3073).
Fix contributed by Maxime Verger.
- **Task**: An exception is now raised if countdown/expires is less
than -2147483648 (Issue #3078).
- **Programs**: :program:`celery shell --ipython` now compatible with newer
IPython versions.
- **Programs**: The DuplicateNodeName warning emitted by inspect/control
now includes a list of the node names returned.
Contributed by Sebastian Kalinowski.
- **Utils**: The ``.discard(item)`` method of
:class:`~celery.datastructures.LimitedSet` did not actually remove the item
(Issue #3087).
Fix contributed by Dave Smith.
- **Worker**: Node name formatting now emits less confusing error message
for unmatched format keys (Issue #3016).
- **Results**: amqp/rpc backends: Fixed deserialization of JSON exceptions
(Issue #2518).
Fix contributed by Allard Hoeve.
- **Prefork pool**: The `process inqueue damaged` error message now includes
the original exception raised.
- **Documentation**: Includes improvements by:
- Jeff Widman.
.. _version-3.1.20:
3.1.20
======
:release-date: 2016-01-22 06:50 P.M UTC
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.33 <kombu:version-3.0.33>`.
- Now depends on :mod:`billiard` 3.3.0.22.
Includes binary wheels for Microsoft Windows x86 and x86_64!
- **Task**: Error emails now uses ``utf-8`` charset by default (Issue #2737).
- **Task**: Retry now forwards original message headers (Issue #3017).
- **Worker**: Bootsteps can now hook into ``on_node_join``/``leave``/``lost``.
See :ref:`extending-consumer-gossip` for an example.
- **Events**: Fixed handling of DST timezones (Issue #2983).
- **Results**: Redis backend stopped respecting certain settings.
Contributed by Jeremy Llewellyn.
- **Results**: Database backend now properly supports JSON exceptions
(Issue #2441).
- **Results**: Redis ``new_join`` did not properly call task errbacks on chord
error (Issue #2796).
- **Results**: Restores Redis compatibility with redis-py < 2.10.0
(Issue #2903).
- **Results**: Fixed rare issue with chord error handling (Issue #2409).
- **Tasks**: Using queue-name values in :setting:`CELERY_ROUTES` now works
again (Issue #2987).
- **General**: Result backend password now sanitized in report output
(Issue #2812, Issue #2004).
- **Configuration**: Now gives helpful error message when the result backend
configuration points to a module, and not a class (Issue #2945).
- **Results**: Exceptions sent by JSON serialized workers are now properly
handled by pickle configured workers.
- **Programs**: ``celery control autoscale`` now works (Issue #2950).
- **Programs**: ``celery beat --detached`` now runs after fork callbacks.
- **General**: Fix for LRU cache implementation on Python 3.5 (Issue #2897).
Contributed by Dennis Brakhane.
Python 3.5's ``OrderedDict`` does not allow mutation while it is being
iterated over. This breaks "update" if it is called with a dict
larger than the maximum size.
This commit changes the code to a version that does not iterate over
the dict, and should also be a little bit faster.
- **Init scripts**: The beat init script now properly reports service as down
when no pid file can be found.
Eric Zarowny
- **Beat**: Added cleaning of corrupted scheduler files for some storage
backend errors (Issue #2985).
Fix contributed by Aleksandr Kuznetsov.
- **Beat**: Now syncs the schedule even if the schedule is empty.
Fix contributed by Colin McIntosh.
- **Supervisord**: Set higher process priority in supervisord example.
Contributed by George Tantiras.
- **Documentation**: Includes improvements by:
- Bryson
- Caleb Mingle
- Christopher Martin
- Dieter Adriaenssens
- Jason Veatch
- Jeremy Cline
- Juan Rossi
- Kevin Harvey
- Kevin McCarthy
- Kirill Pavlov
- Marco Buttu
- Mayflower
- Mher Movsisyan
- Michael Floering
- michael-k
- Nathaniel Varona
- Rudy Attias
- Ryan Luckie
- Steven Parker
- squfrans
- Tadej Janež
- TakesxiSximada
- Tom S
.. _version-3.1.19:
3.1.19
======
:release-date: 2015-10-26 01:00 P.M UTC
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.29 <kombu:version-3.0.29>`.
- Now depends on :mod:`billiard` 3.3.0.21.
-  **Results**: Fixed MongoDB result backend URL parsing problem
(Issue celery/kombu#375).
- **Worker**: Task request now properly sets ``priority`` in delivery_info.
Fix contributed by Gerald Manipon.
- **Beat**: PyPy shelve may raise ``KeyError`` when setting keys
(Issue #2862).
- **Programs**: :program:`celery beat --deatched` now working on PyPy.
Fix contributed by Krzysztof Bujniewicz.
- **Results**: Redis result backend now ensures all pipelines are cleaned up.
Contributed by Justin Patrin.
- **Results**: Redis result backend now allows for timeout to be set in the
query portion of the result backend URL.
E.g. ``CELERY_RESULT_BACKEND = 'redis://?timeout=10'``
Contributed by Justin Patrin.
- **Results**: ``result.get`` now properly handles failures where the
exception value is set to :const:`None` (Issue #2560).
- **Prefork pool**: Fixed attribute error ``proc.dead``.
- **Worker**: Fixed worker hanging when gossip/heartbeat disabled
(Issue #1847).
Fix contributed by Aaron Webber and Bryan Helmig.
- **Results**: MongoDB result backend now supports pymongo 3.x
(Issue #2744).
Fix contributed by Sukrit Khera.
- **Results**: RPC/amqp backends did not deserialize exceptions properly
(Issue #2691).
Fix contributed by Sukrit Khera.
- **Programs**: Fixed problem with :program:`celery amqp`'s
``basic_publish`` (Issue #2013).
- **Worker**: Embedded beat now properly sets app for thread/process
(Issue #2594).
- **Documentation**: Many improvements and typos fixed.
Contributions by:
Carlos Garcia-Dubus
D. Yu
jerry
Jocelyn Delalande
Josh Kupershmidt
Juan Rossi
kanemra
Paul Pearce
Pavel Savchenko
Sean Wang
Seungha Kim
Zhaorong Ma
.. _version-3.1.18:
3.1.18
======
:release-date: 2015-04-22 05:30 P.M UTC
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.25 <kombu:version-3.0.25>`.
- Now depends on :mod:`billiard` 3.3.0.20.
- **Django**: Now supports Django 1.8 (Issue #2536).
Fix contributed by Bence Tamas and Mickaël Penhard.
- **Results**: MongoDB result backend now compatible with pymongo 3.0.
Fix contributed by Fatih Sucu.
- **Tasks**: Fixed bug only happening when a task has multiple callbacks
(Issue #2515).
Fix contributed by NotSqrt.
- **Commands**: Preload options now support ``--arg value`` syntax.
Fix contributed by John Anderson.
- **Compat**: A typo caused ``celery.log.setup_logging_subsystem`` to be
undefined.
Fix contributed by Gunnlaugur Thor Briem.
- **init scripts**: The celerybeat generic init script now uses
``/bin/sh`` instead of bash (Issue #2496).
Fix contributed by Jelle Verstraaten.
- **Django**: Fixed a :exc:`TypeError` sometimes occurring in logging
when validating models.
Fix contributed by Alexander.
- **Commands**: Worker now supports new ``--executable`` argument that can
be used with ``--detach``.
Contributed by Bert Vanderbauwhede.
- **Canvas**: Fixed crash in chord unlock fallback task (Issue #2404).
- **Worker**: Fixed rare crash occurring with ``--autoscale`` enabled
(Issue #2411).
- **Django**: Properly recycle worker Django database connections when the
Django ``CONN_MAX_AGE`` setting is enabled (Issue #2453).
Fix contributed by Luke Burden.
.. _version-3.1.17:
3.1.17
======
:release-date: 2014-11-19 03:30 P.M UTC
:release-by: Ask Solem
.. admonition:: Do not enable the :setting:`CELERYD_FORCE_EXECV` setting!
Please review your configuration and disable this option if you're using the
RabbitMQ or Redis transport.
Keeping this option enabled after 3.1 means the async based prefork pool will
be disabled, which can easily cause instability.
- **Requirements**
- Now depends on :ref:`Kombu 3.0.24 <kombu:version-3.0.24>`.
Includes the new Qpid transport coming in Celery 3.2, backported to
support those who may still require Python 2.6 compatibility.
- Now depends on :mod:`billiard` 3.3.0.19.
- ``celery[librabbitmq]`` now depends on librabbitmq 1.6.1.
- **Task**: The timing of ETA/countdown tasks were off after the example ``LocalTimezone``
implementation in the Python documentation no longer works in Python 3.4.
(Issue #2306).
- **Task**: Raising :exc:`~celery.exceptions.Ignore` no longer sends
``task-failed`` event (Issue #2365).
- **Redis result backend**: Fixed unbound local errors.
Fix contributed by Thomas French.
- **Task**: Callbacks was not called properly if ``link`` was a list of
signatures (Issuse #2350).
- **Canvas**: chain and group now handles json serialized signatures
(Issue #2076).
- **Results**: ``.join_native()`` would accidentally treat the ``STARTED``
state as being ready (Issue #2326).
This could lead to the chord callback being called with invalid arguments
when using chords with the :setting:`CELERY_TRACK_STARTED` setting
enabled.
- **Canvas**: The ``chord_size`` attribute is now set for all canvas primitives,
making sure more combinations will work with the ``new_join`` optimization
for Redis (Issue #2339).
- **Task**: Fixed problem with app not being properly propagated to
``trace_task`` in all cases.
Fix contributed by kristaps.
- **Worker**: Expires from task message now associated with a timezone.
Fix contributed by Albert Wang.
- **Cassandra result backend**: Fixed problems when using detailed mode.
When using the Cassandra backend in detailed mode, a regression
caused errors when attempting to retrieve results.
Fix contributed by Gino Ledesma.
- **Mongodb Result backend**: Pickling the backend instance will now include
the original url (Issue #2347).
Fix contributed by Sukrit Khera.
- **Task**: Exception info was not properly set for tasks raising
:exc:`~celery.exceptions.Reject` (Issue #2043).
- **Worker**: Duplicates are now removed when loading the set of revoked tasks
from the worker state database (Issue #2336).
- **celery.contrib.rdb**: Fixed problems with ``rdb.set_trace`` calling stop
from the wrong frame.
Fix contributed by llllllllll.
- **Canvas**: ``chain`` and ``chord`` can now be immutable.
- **Canvas**: ``chord.apply_async`` will now keep partial args set in
``self.args`` (Issue #2299).
- **Results**: Small refactoring so that results are decoded the same way in
all result backends.
- **Logging**: The ``processName`` format was introduced in Py2.6.2 so for
compatibility this format is now excluded when using earlier versions
(Issue #1644).
.. _version-3.1.16:
3.1.16
======
:release-date: 2014-10-03 06:00 P.M UTC
:release-by: Ask Solem
- **Worker**: 3.1.15 broke ``-Ofair`` behavior (Issue #2286).
This regression could result in all tasks executing
in a single child process if ``-Ofair`` was enabled.
- **Canvas**: ``celery.signature`` now properly forwards app argument
in all cases.
- **Task**: ``.retry()`` did not raise the exception correctly
when called without a current exception.
Fix contributed by Andrea Rabbaglietti.
- **Worker**: The ``enable_events`` remote control command
disabled worker-related events by mistake (Issue #2272).
Fix contributed by Konstantinos Koukopoulos.
- **Django**: Adds support for Django 1.7 class names in INSTALLED_APPS
when using ``app.autodiscover_tasks()``  (Issue #2248).
- **Sphinx**: ``celery.contrib.sphinx`` now uses ``getfullargspec``
on Python 3 (Issue #2302).
- **Redis/Cache Backends**: Chords will now run at most once if one or more tasks
in the chord are executed multiple times for some reason.
.. _version-3.1.15:
3.1.15
======
:release-date: 2014-09-14 11:00 P.M UTC
:release-by: Ask Solem
- **Django**: Now makes sure ``django.setup()`` is called
before importing any task modules (Django 1.7 compatibility, Issue #2227)
- **Results**: ``result.get()`` was misbehaving by calling
``backend.get_task_meta`` in a finally call leading to
AMQP result backend queues not being properly cleaned up (Issue #2245).
.. _version-3.1.14:
3.1.14
======
:release-date: 2014-09-08 03:00 P.M UTC
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.22 <kombu:version-3.0.22>`.
- **Init scripts**: The generic worker init scripts ``status`` command
now gets an accurate pidfile list (Issue #1942).
- **Init scripts**: The generic beat script now implements the ``status``
command.
Contributed by John Whitlock.
- **Commands**: Multi now writes informational output to stdout instead of stderr.
- **Worker**: Now ignores not implemented error for ``pool.restart``
(Issue #2153).
- **Task**: Retry no longer raises retry exception when executed in eager
mode (Issue #2164).
- **AMQP Result backend**: Now ensured ``on_interval`` is called at least
every second for blocking calls to properly propagate parent errors.
- **Django**: Compatibility with Django 1.7 on Windows (Issue #2126).
- **Programs**: `--umask` argument can be now specified in both octal (if starting
with 0) or decimal.
.. _version-3.1.13:
3.1.13
======
eventbritebuild referenced this issue in eventbrite/celery Jul 8, 2021
Changelog Details:
Change history
================
This document contains change notes for bugfix releases in the 3.1.x series
(Cipater), please see :ref:`whatsnew-3.1` for an overview of what's
new in Celery 3.1.
.. _version-3.1.26:
3.1.26
======
:release-date: 2018-23-03 16:00 PM IST
:release-by: Omer Katz
- Fixed a crash caused by tasks cycling between Celery 3 and Celery 4 workers.
.. _version-3.1.25:
3.1.25
======
:release-date: 2016-10-10 12:00 PM PDT
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.37 <kombu:version-3.0.37>`
- Fixed problem with chords in group introduced in 3.1.24 (Issue #3504).
.. _version-3.1.24:
3.1.24
======
:release-date: 2016-09-30 04:21 PM PDT
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.36 <kombu:version-3.0.36>`.
- Now supports Task protocol 2 from the future 4.0 release.
Workers running 3.1.24 are now able to process messages
sent using the `new task message protocol`_ to be introduced
in Celery 4.0.
Users upgrading to Celery 4.0 when this is released are encouraged
to upgrade to this version as an intermediate step, as this
means workers not yet upgraded will be able to process
messages from clients/workers running 4.0.
.. _`new task message protocol`:
http://docs.celeryproject.org/en/master/internals/protocol.html#version-2
- ``Task.send_events`` can now be set to disable sending of events
for that task only.
Example when defining the task:
.. code-block:: python
@app.task(send_events=False)
def add(x, y):
return x + y
- **Utils**: Fixed compatibility with recent :pypi:`psutil` versions
(Issue #3262).
- **Canvas**: Chord now forwards partial arguments to its subtasks.
Fix contributed by Tayfun Sen.
- **App**: Arguments to app such as ``backend``, ``broker``, etc
are now pickled and sent to the child processes on Windows.
Fix contributed by Jeremy Zafran.
- **Deployment**: Generic init scripts now supports being symlinked
in runlevel directories (Issue #3208).
- **Deployment**: Updated CentOS scripts to work with CentOS 7.
Contributed by Joe Sanford.
- **Events**: The curses monitor no longer crashes when the
result of a task is empty.
Fix contributed by Dongweiming.
- **Worker**: ``repr(worker)`` would crash when called early
in the startup process (Issue #2514).
- **Tasks**: GroupResult now defines __bool__ and __nonzero__.
This is to fix an issue where a ResultSet or GroupResult with an empty
result list are not properly tupled with the as_tuple() method when it is
a parent result. This is due to the as_tuple() method performing a logical
and operation on the ResultSet.
Fix contributed by Colin McIntosh.
- **Worker**: Fixed wrong values in autoscale related logging message.
Fix contributed by ``@raducc``.
- Documentation improvements by
* Alexandru Chirila
* Michael Aquilina
* Mikko Ekström
* Mitchel Humpherys
* Thomas A. Neil
* Tiago Moreira Vieira
* Yuriy Syrovetskiy
* ``@dessant``
.. _version-3.1.23:
3.1.23
======
:release-date: 2016-03-09 06:00 P.M PST
:release-by: Ask Solem
- **Programs**: Last release broke support for the ``--hostnmame`` argument
to :program:`celery multi` and :program:`celery worker --detach`
(Issue #3103).
- **Results**: MongoDB result backend could crash the worker at startup
if not configured using an URL.
.. _version-3.1.22:
3.1.22
======
:release-date: 2016-03-07 01:30 P.M PST
:release-by: Ask Solem
- **Programs**: The worker would crash immediately on startup on
``backend.as_uri()`` when using some result backends (Issue #3094).
- **Programs**: :program:`celery multi`/:program:`celery worker --detach`
would create an extraneous logfile including literal formats (e.g. ``%I``)
in the filename (Issue #3096).
.. _version-3.1.21:
3.1.21
======
:release-date: 2016-03-04 11:16 A.M PST
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.34 <kombu:version-3.0.34>`.
- Now depends on :mod:`billiard` 3.3.0.23.
- **Prefork pool**: Fixes 100% CPU loop on Linux epoll (Issue #1845).
Also potential fix for: Issue #2142, Issue #2606
- **Prefork pool**: Fixes memory leak related to processes exiting
(Issue #2927).
- **Worker**: Fixes crash at startup when trying to censor passwords
in MongoDB and Cache result backend URLs (Issue #3079, Issue #3045,
Issue #3049, Issue #3068, Issue #3073).
Fix contributed by Maxime Verger.
- **Task**: An exception is now raised if countdown/expires is less
than -2147483648 (Issue #3078).
- **Programs**: :program:`celery shell --ipython` now compatible with newer
IPython versions.
- **Programs**: The DuplicateNodeName warning emitted by inspect/control
now includes a list of the node names returned.
Contributed by Sebastian Kalinowski.
- **Utils**: The ``.discard(item)`` method of
:class:`~celery.datastructures.LimitedSet` did not actually remove the item
(Issue #3087).
Fix contributed by Dave Smith.
- **Worker**: Node name formatting now emits less confusing error message
for unmatched format keys (Issue #3016).
- **Results**: amqp/rpc backends: Fixed deserialization of JSON exceptions
(Issue #2518).
Fix contributed by Allard Hoeve.
- **Prefork pool**: The `process inqueue damaged` error message now includes
the original exception raised.
- **Documentation**: Includes improvements by:
- Jeff Widman.
.. _version-3.1.20:
3.1.20
======
:release-date: 2016-01-22 06:50 P.M UTC
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.33 <kombu:version-3.0.33>`.
- Now depends on :mod:`billiard` 3.3.0.22.
Includes binary wheels for Microsoft Windows x86 and x86_64!
- **Task**: Error emails now uses ``utf-8`` charset by default (Issue #2737).
- **Task**: Retry now forwards original message headers (Issue #3017).
- **Worker**: Bootsteps can now hook into ``on_node_join``/``leave``/``lost``.
See :ref:`extending-consumer-gossip` for an example.
- **Events**: Fixed handling of DST timezones (Issue #2983).
- **Results**: Redis backend stopped respecting certain settings.
Contributed by Jeremy Llewellyn.
- **Results**: Database backend now properly supports JSON exceptions
(Issue #2441).
- **Results**: Redis ``new_join`` did not properly call task errbacks on chord
error (Issue #2796).
- **Results**: Restores Redis compatibility with redis-py < 2.10.0
(Issue #2903).
- **Results**: Fixed rare issue with chord error handling (Issue #2409).
- **Tasks**: Using queue-name values in :setting:`CELERY_ROUTES` now works
again (Issue #2987).
- **General**: Result backend password now sanitized in report output
(Issue #2812, Issue #2004).
- **Configuration**: Now gives helpful error message when the result backend
configuration points to a module, and not a class (Issue #2945).
- **Results**: Exceptions sent by JSON serialized workers are now properly
handled by pickle configured workers.
- **Programs**: ``celery control autoscale`` now works (Issue #2950).
- **Programs**: ``celery beat --detached`` now runs after fork callbacks.
- **General**: Fix for LRU cache implementation on Python 3.5 (Issue #2897).
Contributed by Dennis Brakhane.
Python 3.5's ``OrderedDict`` does not allow mutation while it is being
iterated over. This breaks "update" if it is called with a dict
larger than the maximum size.
This commit changes the code to a version that does not iterate over
the dict, and should also be a little bit faster.
- **Init scripts**: The beat init script now properly reports service as down
when no pid file can be found.
Eric Zarowny
- **Beat**: Added cleaning of corrupted scheduler files for some storage
backend errors (Issue #2985).
Fix contributed by Aleksandr Kuznetsov.
- **Beat**: Now syncs the schedule even if the schedule is empty.
Fix contributed by Colin McIntosh.
- **Supervisord**: Set higher process priority in supervisord example.
Contributed by George Tantiras.
- **Documentation**: Includes improvements by:
- Bryson
- Caleb Mingle
- Christopher Martin
- Dieter Adriaenssens
- Jason Veatch
- Jeremy Cline
- Juan Rossi
- Kevin Harvey
- Kevin McCarthy
- Kirill Pavlov
- Marco Buttu
- Mayflower
- Mher Movsisyan
- Michael Floering
- michael-k
- Nathaniel Varona
- Rudy Attias
- Ryan Luckie
- Steven Parker
- squfrans
- Tadej Janež
- TakesxiSximada
- Tom S
.. _version-3.1.19:
3.1.19
======
:release-date: 2015-10-26 01:00 P.M UTC
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.29 <kombu:version-3.0.29>`.
- Now depends on :mod:`billiard` 3.3.0.21.
-  **Results**: Fixed MongoDB result backend URL parsing problem
(Issue celery/kombu#375).
- **Worker**: Task request now properly sets ``priority`` in delivery_info.
Fix contributed by Gerald Manipon.
- **Beat**: PyPy shelve may raise ``KeyError`` when setting keys
(Issue #2862).
- **Programs**: :program:`celery beat --deatched` now working on PyPy.
Fix contributed by Krzysztof Bujniewicz.
- **Results**: Redis result backend now ensures all pipelines are cleaned up.
Contributed by Justin Patrin.
- **Results**: Redis result backend now allows for timeout to be set in the
query portion of the result backend URL.
E.g. ``CELERY_RESULT_BACKEND = 'redis://?timeout=10'``
Contributed by Justin Patrin.
- **Results**: ``result.get`` now properly handles failures where the
exception value is set to :const:`None` (Issue #2560).
- **Prefork pool**: Fixed attribute error ``proc.dead``.
- **Worker**: Fixed worker hanging when gossip/heartbeat disabled
(Issue #1847).
Fix contributed by Aaron Webber and Bryan Helmig.
- **Results**: MongoDB result backend now supports pymongo 3.x
(Issue #2744).
Fix contributed by Sukrit Khera.
- **Results**: RPC/amqp backends did not deserialize exceptions properly
(Issue #2691).
Fix contributed by Sukrit Khera.
- **Programs**: Fixed problem with :program:`celery amqp`'s
``basic_publish`` (Issue #2013).
- **Worker**: Embedded beat now properly sets app for thread/process
(Issue #2594).
- **Documentation**: Many improvements and typos fixed.
Contributions by:
Carlos Garcia-Dubus
D. Yu
jerry
Jocelyn Delalande
Josh Kupershmidt
Juan Rossi
kanemra
Paul Pearce
Pavel Savchenko
Sean Wang
Seungha Kim
Zhaorong Ma
.. _version-3.1.18:
3.1.18
======
:release-date: 2015-04-22 05:30 P.M UTC
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.25 <kombu:version-3.0.25>`.
- Now depends on :mod:`billiard` 3.3.0.20.
- **Django**: Now supports Django 1.8 (Issue #2536).
Fix contributed by Bence Tamas and Mickaël Penhard.
- **Results**: MongoDB result backend now compatible with pymongo 3.0.
Fix contributed by Fatih Sucu.
- **Tasks**: Fixed bug only happening when a task has multiple callbacks
(Issue #2515).
Fix contributed by NotSqrt.
- **Commands**: Preload options now support ``--arg value`` syntax.
Fix contributed by John Anderson.
- **Compat**: A typo caused ``celery.log.setup_logging_subsystem`` to be
undefined.
Fix contributed by Gunnlaugur Thor Briem.
- **init scripts**: The celerybeat generic init script now uses
``/bin/sh`` instead of bash (Issue #2496).
Fix contributed by Jelle Verstraaten.
- **Django**: Fixed a :exc:`TypeError` sometimes occurring in logging
when validating models.
Fix contributed by Alexander.
- **Commands**: Worker now supports new ``--executable`` argument that can
be used with ``--detach``.
Contributed by Bert Vanderbauwhede.
- **Canvas**: Fixed crash in chord unlock fallback task (Issue #2404).
- **Worker**: Fixed rare crash occurring with ``--autoscale`` enabled
(Issue #2411).
- **Django**: Properly recycle worker Django database connections when the
Django ``CONN_MAX_AGE`` setting is enabled (Issue #2453).
Fix contributed by Luke Burden.
.. _version-3.1.17:
3.1.17
======
:release-date: 2014-11-19 03:30 P.M UTC
:release-by: Ask Solem
.. admonition:: Do not enable the :setting:`CELERYD_FORCE_EXECV` setting!
Please review your configuration and disable this option if you're using the
RabbitMQ or Redis transport.
Keeping this option enabled after 3.1 means the async based prefork pool will
be disabled, which can easily cause instability.
- **Requirements**
- Now depends on :ref:`Kombu 3.0.24 <kombu:version-3.0.24>`.
Includes the new Qpid transport coming in Celery 3.2, backported to
support those who may still require Python 2.6 compatibility.
- Now depends on :mod:`billiard` 3.3.0.19.
- ``celery[librabbitmq]`` now depends on librabbitmq 1.6.1.
- **Task**: The timing of ETA/countdown tasks were off after the example ``LocalTimezone``
implementation in the Python documentation no longer works in Python 3.4.
(Issue #2306).
- **Task**: Raising :exc:`~celery.exceptions.Ignore` no longer sends
``task-failed`` event (Issue #2365).
- **Redis result backend**: Fixed unbound local errors.
Fix contributed by Thomas French.
- **Task**: Callbacks was not called properly if ``link`` was a list of
signatures (Issuse #2350).
- **Canvas**: chain and group now handles json serialized signatures
(Issue #2076).
- **Results**: ``.join_native()`` would accidentally treat the ``STARTED``
state as being ready (Issue #2326).
This could lead to the chord callback being called with invalid arguments
when using chords with the :setting:`CELERY_TRACK_STARTED` setting
enabled.
- **Canvas**: The ``chord_size`` attribute is now set for all canvas primitives,
making sure more combinations will work with the ``new_join`` optimization
for Redis (Issue #2339).
- **Task**: Fixed problem with app not being properly propagated to
``trace_task`` in all cases.
Fix contributed by kristaps.
- **Worker**: Expires from task message now associated with a timezone.
Fix contributed by Albert Wang.
- **Cassandra result backend**: Fixed problems when using detailed mode.
When using the Cassandra backend in detailed mode, a regression
caused errors when attempting to retrieve results.
Fix contributed by Gino Ledesma.
- **Mongodb Result backend**: Pickling the backend instance will now include
the original url (Issue #2347).
Fix contributed by Sukrit Khera.
- **Task**: Exception info was not properly set for tasks raising
:exc:`~celery.exceptions.Reject` (Issue #2043).
- **Worker**: Duplicates are now removed when loading the set of revoked tasks
from the worker state database (Issue #2336).
- **celery.contrib.rdb**: Fixed problems with ``rdb.set_trace`` calling stop
from the wrong frame.
Fix contributed by llllllllll.
- **Canvas**: ``chain`` and ``chord`` can now be immutable.
- **Canvas**: ``chord.apply_async`` will now keep partial args set in
``self.args`` (Issue #2299).
- **Results**: Small refactoring so that results are decoded the same way in
all result backends.
- **Logging**: The ``processName`` format was introduced in Py2.6.2 so for
compatibility this format is now excluded when using earlier versions
(Issue #1644).
.. _version-3.1.16:
3.1.16
======
:release-date: 2014-10-03 06:00 P.M UTC
:release-by: Ask Solem
- **Worker**: 3.1.15 broke ``-Ofair`` behavior (Issue #2286).
This regression could result in all tasks executing
in a single child process if ``-Ofair`` was enabled.
- **Canvas**: ``celery.signature`` now properly forwards app argument
in all cases.
- **Task**: ``.retry()`` did not raise the exception correctly
when called without a current exception.
Fix contributed by Andrea Rabbaglietti.
- **Worker**: The ``enable_events`` remote control command
disabled worker-related events by mistake (Issue #2272).
Fix contributed by Konstantinos Koukopoulos.
- **Django**: Adds support for Django 1.7 class names in INSTALLED_APPS
when using ``app.autodiscover_tasks()``  (Issue #2248).
- **Sphinx**: ``celery.contrib.sphinx`` now uses ``getfullargspec``
on Python 3 (Issue #2302).
- **Redis/Cache Backends**: Chords will now run at most once if one or more tasks
in the chord are executed multiple times for some reason.
.. _version-3.1.15:
3.1.15
======
:release-date: 2014-09-14 11:00 P.M UTC
:release-by: Ask Solem
- **Django**: Now makes sure ``django.setup()`` is called
before importing any task modules (Django 1.7 compatibility, Issue #2227)
- **Results**: ``result.get()`` was misbehaving by calling
``backend.get_task_meta`` in a finally call leading to
AMQP result backend queues not being properly cleaned up (Issue #2245).
.. _version-3.1.14:
3.1.14
======
:release-date: 2014-09-08 03:00 P.M UTC
:release-by: Ask Solem
- **Requirements**
- Now depends on :ref:`Kombu 3.0.22 <kombu:version-3.0.22>`.
- **Init scripts**: The generic worker init scripts ``status`` command
now gets an accurate pidfile list (Issue #1942).
- **Init scripts**: The generic beat script now implements the ``status``
command.
Contributed by John Whitlock.
- **Commands**: Multi now writes informational output to stdout instead of stderr.
- **Worker**: Now ignores not implemented error for ``pool.restart``
(Issue #2153).
- **Task**: Retry no longer raises retry exception when executed in eager
mode (Issue #2164).
- **AMQP Result backend**: Now ensured ``on_interval`` is called at least
every second for blocking calls to properly propagate parent errors.
- **Django**: Compatibility with Django 1.7 on Windows (Issue #2126).
- **Programs**: `--umask` argument can be now specified in both octal (if starting
with 0) or decimal.
.. _version-3.1.13:
3.1.13
======
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests