Sentry upgrade 8.6->8.20 failed during migrations

Hello,

I’ve just tried to upgrade my sentry server from 8.6.0 to 8.20.0, using pip on CentOS 6. It failed during the migration and I’m now stuck with a broken server.

I did:

$ pip install --upgrade sentry
Successfully installed asn1crypto-0.23.0 boto3-1.4.5 botocore-1.5.70 cffi-1.11.0 click-6.7 cryptography-2.0.3 cssselect-1.0.1 django-sudo-2.1.0 djangorestframework-2.4.8 docutils-0.14 futures-3.1.1 httplib2-0.10.3 idna-2.6 ipaddress-1.0.18 jmespath-0.9.3 libsourcemap-0.7.2 loremipsum-1.0.5 lxml-4.0.0 mmh3-2.3.1 percy-1.0.6 petname-2.0 progressbar2-3.10.1 py-1.4.34 pyOpenSSL-17.3.0 pycparser-2.18 pytest-3.1.3 pytest-html-1.9.0 python-dateutil-2.6.1 python-utils-2.2.0 pytz-2017.2 raven-5.33.0 rb-1.7 redis-py-cluster-1.3.4 requests-2.12.5 s3transfer-0.1.11 selenium-3.4.3 sentry-8.20.0 setuptools-36.5.0 symsynd-3.2.0 toronado-0.0.11 uwsgi-2.0.15

Then generated a new config file to merge with my changes (email server host and server secret key).
sentry init /tmp/new-sentry-conf

I stopped all the services (cron, web and worker).
I then ran the sentry upgrade command, but it tried to connect to the server…

return Database.connect(**conn_params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
16:13:59 [ERROR] sentry.errors: Unable to fetch internal project
...
sentry.exceptions.InvalidConfiguration: Error 111 connecting to 127.0.0.1:6379. Connection refused.

so I restarted all the services and re-ran the upgrade. It seemed to be ok, running the migrations one by one but then it failed when running
> sentry:0286_drop_project_fk_release_release_file

It also asked if I wanted to delete some stale content, which I replied to by yes, and more errors followed.

I’m now in a state where the server won’t work, the ‘sentry upgrade’ command always fail on the 0286 migration, and ‘sentry repair’ fails as well. What’s the best way to get back to a running server? The data is not critical.

Also, what did I do wrong? I guess I should have done smaller upgrades? but which running 14 incremental upgrades sounded tedious, and I couldn’t see any warnings about possible problems upgrading from any 8.x to another 8.x. Also, I guess I should have left all the workers running because they might have picked the configuration before the migration happened when I restarted them?

I can’t attach txt files, so I’m copying the full log of the sentry upgrade command below.

Benoit

Sentry Upgrade Log:

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 0351_backfillemail.
 > sentry:0263_remove_default_regression_rule
Rules: 100% |################################################################################################################################| Time: 0:00:00
 > sentry:0264_drop_grouptagvalue_project_index
 > sentry:0265_auto__add_field_rule_status
 > sentry:0266_auto__add_grouprelease__add_unique_grouprelease_group_id_release_id_en
 > sentry:0267_auto__add_environment__add_unique_environment_project_id_name__add_rel
 > sentry:0268_fill_environment
 > sentry:0269_auto__del_helppage
 > sentry:0270_auto__add_field_organizationmember_token
 > sentry:0271_auto__del_field_organizationmember_counter
 > sentry:0272_auto__add_unique_authenticator_user_type
 > sentry:0273_auto__add_repository__add_unique_repository_organization_id_name__add_
 > sentry:0274_auto__add_index_commit_repository_id_date_added
 > sentry:0275_auto__del_index_grouptagvalue_project_key_value__add_index_grouptagval
 > sentry:0276_auto__add_field_user_session_nonce
 > sentry:0277_auto__add_commitfilechange__add_unique_commitfilechange_commit_filenam
 > sentry:0278_auto__add_releaseproject__add_unique_releaseproject_project_release__a
 > sentry:0279_populate_release_orgs_and_projects
Releases: 100% |#############################################################################################################################| Time: 0:00:00
 > sentry:0280_auto__add_field_releasecommit_organization_id
 > sentry:0281_populate_release_commit_organization_id
 > sentry:0282_auto__add_field_releasefile_organization__add_field_releaseenvironment
 > sentry:0283_populate_release_environment_and_release_file_organization
Progress: 100% |#############################################################################################################################| Time: 0:00:00
 > sentry:0284_auto__del_field_release_project__add_field_release_project_id__chg_fie
 > sentry:0285_auto__chg_field_release_project_id__chg_field_releasefile_project_id
 > sentry:0286_drop_project_fk_release_release_file
FATAL ERROR - The following SQL query failed: ALTER TABLE sentry_release DROP CONSTRAINT IF EXISTS project_id_refs_id_21d237e2
The error was: ProgrammingError('syntax error at or near "EXISTS"\nLINE 1: ALTER TABLE sentry_release DROP CONSTRAINT IF EXISTS project...\n                                                      ^\n',)
SQL: ALTER TABLE sentry_release DROP CONSTRAINT IF EXISTS project_id_refs_id_21d237e2
Error in migration: sentry:0286_drop_project_fk_release_release_file
The following content types are stale and need to be deleted:

    sentry | dsymobject
    sentry | dsymsymbol
    sentry | dsymsdk
    sentry | globaldsymfile
    sentry | helppage
    sentry | dsymbundle

Any objects related to these content types by a foreign key will also
be deleted. Are you sure you want to delete these content types?
If you're unsure, answer 'no'.

    Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/utils/raven.py", line 75, in send
    project = Project.objects.get_from_cache(id=settings.SENTRY_PROJECT)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/models/manager.py", line 245, in get_from_cache
    result = self.get(**kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/manager.py", line 151, in get
    return self.get_queryset().get(*args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 304, in get
    num = len(clone)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 77, in __len__
    self._fetch_all()
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
    for row in compiler.results_iter():
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
    cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/raven/contrib/django/client.py", line 112, in execute
    return real_execute(self, sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
    raise_the_exception(self.db, e)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
    return func(self, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
    return func(self, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
    six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
    return func(self, sql, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 39, in execute
    return self.cursor.execute(sql, params)
ProgrammingError: ProgrammingError('column sentry_project.flags does not exist\nLINE 1: ...roject"."status", "sentry_project"."first_event", "sentry_pr...\n                                                             ^\n',)
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 
16:17:01 [ERROR] sentry.errors: Unable to fetch internal project
Traceback (most recent call last):
  File "/path/sentry-virtualenv-py27/bin/sentry", line 11, in <module>
    sys.exit(main())
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/runner/__init__.py", line 160, in main
    cli(prog_name=get_prog(), obj={}, max_content_width=100)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/runner/decorators.py", line 36, in inner
    return ctx.invoke(f, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/runner/commands/upgrade.py", line 67, in upgrade
    _upgrade(not noinput, traceback, verbosity, not no_repair)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/runner/commands/upgrade.py", line 29, in _upgrade
    verbosity=verbosity,
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/core/management/__init__.py", line 159, in call_command
    return klass.execute(*args, **defaults)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/south/management/commands/migrate.py", line 115, in handle
    ignore_ghosts=ignore_ghosts,
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/south/migration/__init__.py", line 234, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/south/migration/migrators.py", line 255, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/south/migration/migrators.py", line 330, in migrate_many
    result = self.migrate(migration, database)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/south/migration/migrators.py", line 131, in migrate
    result = self.run(migration, database)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/south/migration/migrators.py", line 113, in run
    return self.run_migration(migration, database)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/south/migration/migrators.py", line 84, in run_migration
    migration_function()
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/south/migration/migrators.py", line 60, in <lambda>
    return (lambda: direction(orm))
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/south_migrations/0286_drop_project_fk_release_release_file.py", line 14, in forwards
    "ALTER TABLE sentry_release DROP CONSTRAINT IF EXISTS project_id_refs_id_21d237e2"
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/south/db/generic.py", line 284, in execute
    cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/raven/contrib/django/client.py", line 112, in execute
    return real_execute(self, sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
    raise_the_exception(self.db, e)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
    return func(self, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
    return func(self, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
    six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
    return func(self, sql, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 39, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: ProgrammingError('syntax error at or near "EXISTS"\nLINE 1: ALTER TABLE sentry_release DROP CONSTRAINT IF EXISTS project...\n                                                      ^\n',)
SQL: ALTER TABLE sentry_release DROP CONSTRAINT IF EXISTS project_id_refs_id_21d237e2

Sentry Repair Log

Creating missing DSNs
Traceback (most recent call last):
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/utils/raven.py", line 75, in send
    project = Project.objects.get_from_cache(id=settings.SENTRY_PROJECT)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/models/manager.py", line 245, in get_from_cache
    result = self.get(**kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/manager.py", line 151, in get
    return self.get_queryset().get(*args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 304, in get
    num = len(clone)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 77, in __len__
    self._fetch_all()
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
    for row in compiler.results_iter():
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
    cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/raven/contrib/django/client.py", line 112, in execute
    return real_execute(self, sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
    raise_the_exception(self.db, e)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
    return func(self, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
    return func(self, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
    six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
    return func(self, sql, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 39, in execute
    return self.cursor.execute(sql, params)
ProgrammingError: ProgrammingError('column sentry_project.flags does not exist\nLINE 1: ...roject"."status", "sentry_project"."first_event", "sentry_pr...\n                                                             ^\n',)
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 
16:43:40 [ERROR] sentry.errors: Unable to fetch internal project
Traceback (most recent call last):
  File "/path/sentry-virtualenv-py27/bin/sentry", line 11, in <module>
    sys.exit(main())
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/runner/__init__.py", line 160, in main
    cli(prog_name=get_prog(), obj={}, max_content_width=100)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/runner/decorators.py", line 36, in inner
    return ctx.invoke(f, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/runner/commands/repair.py", line 153, in repair
    create_missing_dsns()
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/runner/commands/repair.py", line 100, in create_missing_dsns
    for project in queryset:
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 96, in __iter__
    self._fetch_all()
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
    self._result_cache = list(self.iterator())
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
    for row in compiler.results_iter():
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
    cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/raven/contrib/django/client.py", line 112, in execute
    return real_execute(self, sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
    raise_the_exception(self.db, e)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
    return func(self, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
    return func(self, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
    six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
    return func(self, sql, *args, **kwargs)
  File "/path/sentry-virtualenv-py27/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 39, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: ProgrammingError('column sentry_project.flags does not exist\nLINE 1: ...roject"."status", "sentry_project"."first_event", "sentry_pr...\n                                                             ^\n',)
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" LEFT OUTER JOIN "sentry_projectkey" ON ( "sentry_project"."id" = "sentry_projectkey"."project_id" ) WHERE "sentry_projectkey"."id" IS NULL

I guess I need to try that:
https://github.com/getsentry/sentry/issues/4961

Problem is the official version of postgresql on CentOS 6 is still 8.4…and nowhere in the docs of sentry it says it needs at least Postgres 9 to run. I suggest updating these pages:
https://docs.sentry.io/server/installation/python/
https://docs.sentry.io/server/installation/

Running the migration 286 manually, I’m getting errors later…

Error in migration: sentry:0345_add_citext
17:27:54 [ERROR] sentry.errors: Internal project (id=1) does not exist

I guess I really need postgres 9, so I’ll have to reinstall sentry on a different OS…

Oh boy, Postgres 8.4. :frowning: Yeah, that’s super old and never crossed our minds that anyone would even be running this. We run a pretty ancient version ourselves, but it’s still significantly newer than 8.4.

We can add to the documentation that we recommend like, at least 9.3 since we don’t test on anything lower and have no intentions to reasonably support it.

Honestly, I’m surprised it made it this far on 8.4. :confused:

1 Like