Giter Club home page Giter Club logo

Comments (17)

mikexstudios avatar mikexstudios commented on May 25, 2024

I just encountered this same issue with django 1.3, latest versions of celery and djcelery on pypi. Downgrading both django-celery and celery to 2.2.7 fixed the issue as unthingable noted. Thanks.

from django-celery.

slinkp avatar slinkp commented on May 25, 2024

This just hit me too. I think it was caused by ask@1cac9e5
which fixes one issue and causes another :(

CELERY_RESULT_BACKEND = 'database' used to work, but as of that commit, it causes those tables to be skipped.

Workaround: set the full backend name:
CELERY_RESULT_BACKEND = 'djcelery.backends.database.DatabaseBackend'

from django-celery.

kmike avatar kmike commented on May 25, 2024

CELERY_RESULT_BACKEND = 'database' means SQLAlchemy backend in modern celery, isn't it? See http://celery.readthedocs.org/en/latest/configuration.html#celery-result-backend .

from django-celery.

slinkp avatar slinkp commented on May 25, 2024

I don't think this is documented, but from poking at the source you
can see that celery provides a hook for loaders to specify "override_backends"
and djcelery/loaders.py uses that:

override_backends = {
        "database": "djcelery.backends.database.DatabaseBackend",
        "cache": "djcelery.backends.cache.CacheBackend"}

from django-celery.

kmike avatar kmike commented on May 25, 2024

Yep, you're right, I wrote the patch based on the docs. So my patch is incorrect: known_names should be only BACKEND_ALIASES.values()

from django-celery.

jrasanen avatar jrasanen commented on May 25, 2024

I'm using the latest version (master branch) and I get:

DatabaseError: relation "celery_taskmeta" does not exist
LINE 1: ..."."date_done", "celery_taskmeta"."traceback" FROM "celery_ta.

Even with: CELERY_RESULT_BACKEND = 'djcelery.backends.database.DatabaseBackend' defined.

from django-celery.

ask avatar ask commented on May 25, 2024

Did you do a syncdb?

Ask Solem

On Aug 17, 2011, at 1:28 PM, incidence [email protected] wrote:

I'm using the latest version (master branch) and I get:

DatabaseError: relation "celery_taskmeta" does not exist
LINE 1: ..."."date_done", "celery_taskmeta"."traceback" FROM "celery_ta.

Reply to this email directly or view it on GitHub:
https://github.com/ask/django-celery/issues/62#issuecomment-1825841

from django-celery.

jrasanen avatar jrasanen commented on May 25, 2024

Yes we ran syncdb to a fresh & blank postgresql database.

We changed from MySQL to Postgres, after that celery didn't make the necessary "celery_taskmeta" -table. Django 1.3, psycopg2 and django-celery's commit 16adce6.

from django-celery.

jrasanen avatar jrasanen commented on May 25, 2024

yolk --list gives

django-celery   - 2.3.1        - active development (/Users/incidence/tmp/env/src/django-celery)
celery          - 2.3.1        - active

cd /Users/incidence/tmp/env/src/django-celery

$ git show
commit 16adce6d76930f2665f04a613b61b81f746da4dc
Author: Ask Solem <[email protected]>
Date:   Sat Aug 13 14:53:17 2011 +0100

    Try to fix circular import of DatabaseBackend

Celery log:

[2011-08-19 03:33:49,128: ERROR/MainProcess] Task datasources.services.Main_Task.Main_Task[f81087cc-34be-48a4-942f-3348d6658ca8] raised exception: DatabaseError('relation "celery_taskmeta" does not exist\nLINE 1: ..."."date_done", "celery_taskmeta"."traceback" FROM "celery_ta...\n                                                             ^\n',)
Traceback (most recent call last):
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/celery/worker/job.py", line 107, in execute_safe
    return self.execute(*args, **kwargs)
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/celery/worker/job.py", line 125, in execute
    return super(WorkerTaskTrace, self).execute()
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/celery/execute/trace.py", line 79, in execute
    retval = self._trace()
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/celery/execute/trace.py", line 93, in _trace
    r = handler(trace.retval, trace.exc_type, trace.tb, trace.strtb)
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/celery/worker/job.py", line 140, in handle_success
    self.task.backend.mark_as_done(self.task_id, retval)
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/celery/backends/base.py", line 54, in mark_as_done
    return self.store_result(task_id, result, status=states.SUCCESS)
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/celery/backends/base.py", line 194, in store_result
    return self._store_result(task_id, result, status, traceback, **kwargs)
  File "/Users/incidence/tmp/env/src/django-celery/djcelery/backends/database.py", line 22, in _store_result
    traceback=traceback)
  File "/Users/incidence/tmp/env/src/django-celery/djcelery/managers.py", line 36, in _inner
    return fun(*args, **kwargs)
  File "/Users/incidence/tmp/env/src/django-celery/djcelery/managers.py", line 154, in store_result
    "traceback": traceback})
  File "/Users/incidence/tmp/env/src/django-celery/djcelery/managers.py", line 78, in update_or_create
    return self.get_query_set().update_or_create(**kwargs)
  File "/Users/incidence/tmp/env/src/django-celery/djcelery/managers.py", line 62, in update_or_create
    obj, created = self.get_or_create(**kwargs)
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/django/db/models/query.py", line 378, in get_or_create
    return self.get(**lookup), False
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/django/db/models/query.py", line 344, in get
    num = len(clone)
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/django/db/models/query.py", line 82, in __len__
    self._result_cache = list(self.iterator())
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/django/db/models/query.py", line 273, in iterator
    for row in compiler.results_iter():
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 680, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
    cursor.execute(sql, params)
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/django/db/backends/util.py", line 34, in execute
    return self.cursor.execute(sql, params)
  File "/Users/incidence/tmp/env/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)
DatabaseError: relation "celery_taskmeta" does not exist
LINE 1: ..."."date_done", "celery_taskmeta"."traceback" FROM "celery_ta...
                                                             ^

from django-celery.

skrobul avatar skrobul commented on May 25, 2024

unfortunately this does not seem to be solved. checked out fresh git version, installed but celery_* tables are still not being created.

tried with
CELERY_RESULT_BACKEND = 'djcelery.backends.database.DatabaseBackend'
as well as:
CELERY_RESULT_BACKEND = 'database'

still no luck.

from django-celery.

amccloud avatar amccloud commented on May 25, 2024

I can confirm the "celery_taskmeta" table is still not being created.

Django 1.4-alpha@trunk
South
celery 2.3.1
djcelery@16adce6d76930f2665f04a613b61b81f746da4dc

from django-celery.

ask avatar ask commented on May 25, 2024

Try b09c153

This is on PyPI now as django-celery 2.3.3,
actually it has been since this weekend, I don't know why my commit message wasn't added to this bug :(

from django-celery.

jrasanen avatar jrasanen commented on May 25, 2024

The latest version bumping commit seemed to fix it for me. requirements.txt has: "-e git://github.com/ask/django-celery.git#egg=django-celery"

Thanks.

from django-celery.

ask avatar ask commented on May 25, 2024

@Incidence but did you try the 2.3.3 release on PyPI?

from django-celery.

jrasanen avatar jrasanen commented on May 25, 2024

Yes, its fixed.

from django-celery.

camilonova avatar camilonova commented on May 25, 2024

It's fixed for me too using 2.3.3. Thanks

from django-celery.

ask avatar ask commented on May 25, 2024

phew thank you for your patience :/

from django-celery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.