Sentry web looking for sentry_project.team_id

I’m trying to upgrade our on-premise sentry from 8.20 to 9.0. After doing database migrations and starting up the sentry-web service, I kept getting an error indicating that an SQL query was still looking for the team_id field on the sentry_project table in the postgresql database. I see that one of the last sentry django migrations removes this field and sure enough, when I hand query the database, it’s gone.

Does anyone have any idea why the sentry-web service when called (sentry web run) would still be looking for this field?

Traceback (most recent call last):
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry/utils/raven.py”, line 75, in send
Aug 22 00:40:05 sentry-server sentry[17267]: project = Project.objects.get_from_cache(id=settings.SENTRY_PROJECT)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry/db/models/manager.py”, line 245, in get_from_cache
Aug 22 00:40:05 sentry-server sentry[17267]: result = self.get(**kwargs)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/django/db/models/manager.py”, line 151, in get
Aug 22 00:40:05 sentry-server sentry[17267]: return self.get_queryset().get(*args, **kwargs)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/django/db/models/query.py”, line 304, in get
Aug 22 00:40:05 sentry-server sentry[17267]: num = len(clone)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/django/db/models/query.py”, line 77, in len
Aug 22 00:40:05 sentry-server sentry[17267]: self._fetch_all()
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/django/db/models/query.py”, line 857, in _fetch_all
Aug 22 00:40:05 sentry-server sentry[17267]: self._result_cache = list(self.iterator())
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/django/db/models/query.py”, line 220, in iterator
Aug 22 00:40:05 sentry-server sentry[17267]: for row in compiler.results_iter():
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py”, line 713, in results_iter
Aug 22 00:40:05 sentry-server sentry[17267]: for rows in self.execute_sql(MULTI):
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py”, line 786, in execute_sql
Aug 22 00:40:05 sentry-server sentry[17267]: cursor.execute(sql, params)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py”, line 114, in execute
Aug 22 00:40:05 sentry-server sentry[17267]: return real_execute(self, sql, params)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py”, line 53, in execute
Aug 22 00:40:05 sentry-server sentry[17267]: return self.cursor.execute(sql, params)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/django/db/utils.py”, line 99, in exit
Aug 22 00:40:05 sentry-server sentry[17267]: six.reraise(dj_exc_type, dj_exc_value, traceback)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py”, line 53, in execute
Aug 22 00:40:05 sentry-server sentry[17267]: return self.cursor.execute(sql, params)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py”, line 80, in inner
Aug 22 00:40:05 sentry-server sentry[17267]: raise_the_exception(self.db, e)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py”, line 78, in inner
Aug 22 00:40:05 sentry-server sentry[17267]: return func(self, *args, **kwargs)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py”, line 22, in inner
Aug 22 00:40:05 sentry-server sentry[17267]: return func(self, *args, **kwargs)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py”, line 101, in inner
Aug 22 00:40:05 sentry-server sentry[17267]: six.reraise(exc_info[0], exc_info0, exc_info[2])
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py”, line 94, in inner
Aug 22 00:40:05 sentry-server sentry[17267]: return func(self, sql, *args, **kwargs)
Aug 22 00:40:05 sentry-server sentry[17267]: File “/home/sentry/.virtualenvs/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/base.py”, line 39, in execute
Aug 22 00:40:05 sentry-server sentry[17267]: return self.cursor.execute(sql, params)
Aug 22 00:40:05 sentry-server sentry[17267]: ProgrammingError: ProgrammingError(‘column sentry_project.team_id does not exist\nLINE 1: …orced_color", “sentry_project”.“organization_id”, "sentry_pr…\n ^\n’,)
Aug 22 00:40:05 sentry-server sentry[17267]: SQL: SELECT “sentry_project”.“id”, “sentry_project”.“slug”, “sentry_project”.“name”, “sentry_project”.“forced_color”, “sentry_project”.“organization_id”, “sentry_project”.“team_id”, “sentry_project”.“public”, “sentry_project”.“date_added”, “sentry_project”.“status”, “sentry_project”.“first_event”, “sentry_project”.“flags”, “sentry_project”.“platform” FROM “sentry_project” WHERE “sentry_project”.“id” = %s
Aug 22 00:40:05 sentry-server sentry[17267]: 00:40:05 [ERROR] sentry.errors: Unable to fetch internal project