1

Q1.

I am running a local server. It was running without any issue. I ran pip install -r requirements.txt to make sure I have all the packages before running it again. Now I keep getting the following error:

django.db.utils.ProgrammingError: relation "celery_taskmeta" does not exist

There is a related question on SO that's rather old and it suggests running manage.py migrate but running it also returns the same error.

Here is the contents of my requirements.txt:

amqp==1.4.6
anyjson==0.3.3
apns-clerk==0.1.1
arrow==0.4.1
backports.ssl-match-hostname==3.4.0.2
billiard==3.3.0.19
bootstrap-admin==0.3.0
boto==2.25.0
celery==3.1.17
certifi==14.5.14
cffi==0.8.6
cryptography==0.7.1
Cython==0.19.1
dill==0.2.1
Django==1.6.1
django-appconf==0.6
django-bower==4.8.1
django-celery==3.1.0
django-compressor==1.3
django-debug-toolbar==1.2
django-extensions==1.4.9
django-gravatar2==1.1.3
django-picklefield==0.3.1
django-resized==0.2.4
django-ses==0.6.0
djangorestframework==2.3.8
enum34==1.0.4
gcm-client==0.1.4
Jinja2==2.7.3
joblib==0.8.0a3
kombu==3.0.24
line-profiler==1.0b3
MarkupSafe==0.23
mlpy==3.5.0
mock==1.0.1
nose==1.3.4
numpy==1.8.0
Pillow==2.7.0
psycopg2==2.4.6
pyasn1==0.1.7
pycparser==2.10
pyOpenSSL==0.14
pyparsing==2.0.3
python-dateutil==2.2
python-memcached==1.48
python-slugify==0.1.0
pytz==2014.10
pyzmq==14.4.1
raven==3.3.7
requests==2.5.1
scipy==0.13.3
six==1.8.0
South==0.7.6
sqlparse==0.1.11
tornado==4.0.2
Unidecode==0.4.17
yattag==1.0.7

I'm not sure what to do to resolve this issue.

Is it an incompatibility between older and newer versions of Django and Celery? My latest install was two weeks old, so is there a release in the past two weeks that might be causing this? Or is it something completely unrelated?

Q2.

I'm a beginner so I'm not even sure what celery_taskmeta is and what is its significance.

Community
  • 1
  • 1
oxtay
  • 3,990
  • 6
  • 30
  • 43
  • Possibly. There are some changes in Django 1.7 which case problems for older modules. The best way to know is to replicate your project in another virtualenv but this time use Django 1.7 to figure this out. – supermario Jan 22 '15 at 21:57
  • I just tried that and it didn't work. Is there another way to re-make `celery_taskmeta`? I am a beginner and I'm not even sure what it is and why is it important. – oxtay Jan 22 '15 at 22:04
  • Have you added to your 'djcelery' to INSTALLED_APPS before making migration? How did you define celery to work with django? – supermario Jan 22 '15 at 22:08
  • Yes, it is already in my `INSTALLED_APPS`. As I said, it was working right before I ran the `pip install` command and actually the `requirements.txt` file hasn't been changed. – oxtay Jan 22 '15 at 22:18
  • If it still matters, I had to run `./manage.py syncdb` to get it to create the tables. The docs say that migrate should work, but it didn't do anything for me. – Andrew Jan 26 '15 at 11:43
  • @AndrewBacker, I tried that as well. I first ran `manage.py syncdb` and then ran `manage.py migrate`. In the middle of writing this comment, I decided to try something else. I typed `manage.py syncdb --all` and it seems the problem is solved. – oxtay Jan 26 '15 at 17:25
  • 1
    Cool. I also heard about the trick with making a fake migration (`./manage.py migrate djcelery 0001 --fake`) so that south thinks it had an empty database before and will now apply a real migration if you ask it to. http://stackoverflow.com/a/9918553/15127 – Andrew Jan 27 '15 at 02:19

1 Answers1

0

The problem in this case was solved by running:

python manage.py syncdb --all

This question points to a mismatch in version between django and celery but reinstalling them didn't change anything. It seems it was an issue in older versions (here too)

Other sources point out that this might work:

python manage.py migrate djcelery

or

python manage.py syncdb python manage.py migrate

But the --all option proved critical in solving this problem. This was the source that was most helpful.

I hope this is useful for anyone

Community
  • 1
  • 1
oxtay
  • 3,990
  • 6
  • 30
  • 43
  • Interesting, I'm getting `manage.py syncdb: error: unrecognized arguments: --all` when trying to do this. – Jesse Dec 01 '15 at 14:43