django.db.models.fields:FieldDoesNotExist errors after upgrade

Hi there.

We’ve just upgraded our sentry from version 8.16.0 to 8.22.0 and now we have lots of django.db.models.fields:FieldDoesNotExist: GroupTagValue has no field named 'project_id' exceptions.

Trying to figure out what happend. Any help would be nice

This is the complete stack trace:

Traceback (most recent call last):
File "/home/application/.app_env/bin/sentry", line 11, in <module>
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 161, in main
File "/home/application/.app_env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
File "/home/application/.app_env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
File "/home/application/.app_env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
File "/home/application/.app_env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
File "/home/application/.app_env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
File "/home/application/.app_env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
File "/home/application/.app_env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 73, in inner
File "/home/application/.app_env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
File "/home/application/.app_env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 36, in inner
File "/home/application/.app_env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/runner/commands/run.py", line 208, in worker
File "/home/application/.app_env/local/lib/python2.7/site-packages/celery/worker/__init__.py", line 206, in start
File "/home/application/.app_env/local/lib/python2.7/site-packages/celery/bootsteps.py", line 123, in start
File "/home/application/.app_env/local/lib/python2.7/site-packages/celery/bootsteps.py", line 374, in start
File "/home/application/.app_env/local/lib/python2.7/site-packages/celery/concurrency/base.py", line 131, in start
File "/home/application/.app_env/local/lib/python2.7/site-packages/celery/concurrency/prefork.py", line 117, in on_start
File "/home/application/.app_env/local/lib/python2.7/site-packages/celery/concurrency/asynpool.py", line 400, in __init__
File "/home/application/.app_env/local/lib/python2.7/site-packages/billiard/pool.py", line 972, in __init__
File "/home/application/.app_env/local/lib/python2.7/site-packages/billiard/pool.py", line 1068, in _create_worker_process
File "/home/application/.app_env/local/lib/python2.7/site-packages/billiard/process.py", line 137, in start
File "/home/application/.app_env/local/lib/python2.7/site-packages/billiard/forking.py", line 105, in __init__
File "/home/application/.app_env/local/lib/python2.7/site-packages/billiard/process.py", line 292, in _bootstrap
File "/home/application/.app_env/local/lib/python2.7/site-packages/billiard/pool.py", line 295, in run
File "/home/application/.app_env/local/lib/python2.7/site-packages/billiard/pool.py", line 367, in workloop
File "/home/application/.app_env/local/lib/python2.7/site-packages/celery/app/trace.py", line 349, in _fast_trace_task
File "/home/application/.app_env/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
File "/home/application/.app_env/local/lib/python2.7/site-packages/newrelic/hooks/application_celery.py", line 84, in wrapper
File "/home/application/.app_env/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/tasks/base.py", line 54, in _wrapped
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/tasks/process_buffer.py", line 42, in process_incr
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/utils/services.py", line 76, in <lambda>
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/buffer/redis.py", line 164, in process
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/buffer/redis.py", line 199, in _process_single_incr
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/buffer/base.py", line 64, in process
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/db/models/manager.py", line 274, in create_or_update
File "/home/application/.app_env/local/lib/python2.7/site-packages/sentry/db/models/query.py", line 78, in create_or_update
File "/home/application/.app_env/local/lib/python2.7/site-packages/django/db/models/query.py", line 491, in update
File "/home/application/.app_env/local/lib/python2.7/site-packages/django/db/models/sql/subqueries.py", line 132, in add_update_values
File "/home/application/.app_env/local/lib/python2.7/site-packages/django/db/models/options.py", line 377, in get_field_by_name

Thanks

Did you run ‘sentry upgrade’?

Yes. This is the sentry upgrade output:

Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Synced:
 > django.contrib.admin
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.messages
 > django.contrib.sessions
 > django.contrib.sites
 > django.contrib.staticfiles
 > crispy_forms
 > debug_toolbar
 > raven.contrib.django.raven_compat
 > rest_framework
 > sentry.plugins.sentry_interface_types
 > sentry.plugins.sentry_mail
 > sentry.plugins.sentry_urls
 > sentry.plugins.sentry_useragents
 > sentry.plugins.sentry_webhooks
 > sudo
 > south

Not synced (use migrations):
 - sentry
 - sentry.nodestore
 - sentry.search
 - social_auth
(use ./manage.py migrate to migrate these)
Running migrations for sentry:
 - Migrating forwards to 0364_backfill_grouplink_from_groupcommitresolution.
 > sentry:0358_auto__add_projectsymcachefile__add_unique_projectsymcachefile_project_
 > sentry:0359_auto__add_index_tagvalue_project_id_key_last_seen
 > sentry:0360_auto__add_groupshare
 > sentry:0361_auto__add_minidumpfile
 > sentry:0362_auto__add_userip__add_unique_userip_user_ip_address
 > sentry:0363_auto__add_grouplink__add_unique_grouplink_group_id_linked_type_linked_
 > sentry:0364_backfill_grouplink_from_groupcommitresolution
 - Loading initial data for sentry.
Installed 0 object(s) from 0 fixture(s)
Running migrations for nodestore:
- Nothing to migrate.
 - Loading initial data for nodestore.
Installed 0 object(s) from 0 fixture(s)
Running migrations for search:
- Nothing to migrate.
 - Loading initial data for search.
Installed 0 object(s) from 0 fixture(s)
Running migrations for social_auth:
- Nothing to migrate.
 - Loading initial data for social_auth.
Installed 0 object(s) from 0 fixture(s)
Creating missing DSNs
Correcting Group.num_comments counter

All I can say is if you ran upgrade and restarted processes (per our docs) you shouldn’t see any “missing field” style errors.