Skip to content

Error during migrations in version 8.20 #6098

Description

@AyumuKasuga
  • The version of Sentry you're using
    8.20
  • Whether you're using Docker or another installation method
    installation from pip, pgsql for database

After upgrade sentry from pip to version 8.20 (from 8.19), I run SENTRY_CONF=/etc/sentry /www/sentry/bin/sentry upgrade and got following error:

(sentry) [root@sentry ~]# SENTRY_CONF=/etc/sentry /www/sentry/bin/sentry upgrade
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
 > sentry_plugins.slack

Not synced (use migrations):
 - sentry
 - sentry.nodestore
 - sentry.search
 - social_auth
 - sentry_plugins.jira_ac
 - sentry_plugins.hipchat_ac
(use ./manage.py migrate to migrate these)
Running migrations for sentry:
 - Migrating forwards to 0351_backfillemail.
 > sentry:0345_add_citext
FATAL ERROR - The following SQL query failed: CREATE EXTENSION IF NOT EXISTS citext
The error was: OperationalError('could not open extension control file "/usr/share/pgsql/extension/citext.control": No such file or directory\n',)
SQL: CREATE EXTENSION IF NOT EXISTS citext
Error in migration: sentry:0345_add_citext
None
09:02:50 [INFO] sentry.utils.raven.SentryInternalClient: Not capturing exception due to filters: <class 'django.db.utils.OperationalError'>
Traceback (most recent call last):
  File "/www/sentry/bin/sentry", line 11, in <module>
    sys.exit(main())
  File "/www/sentry/lib/python2.7/site-packages/sentry/runner/__init__.py", line 160, in main
    cli(prog_name=get_prog(), obj={}, max_content_width=100)
  File "/www/sentry/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/www/sentry/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/www/sentry/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/www/sentry/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/www/sentry/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/www/sentry/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/www/sentry/lib/python2.7/site-packages/sentry/runner/decorators.py", line 36, in inner
    return ctx.invoke(f, *args, **kwargs)
  File "/www/sentry/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/www/sentry/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/www/sentry/lib/python2.7/site-packages/sentry/runner/commands/upgrade.py", line 67, in upgrade
    _upgrade(not noinput, traceback, verbosity, not no_repair)
  File "/www/sentry/lib/python2.7/site-packages/sentry/runner/commands/upgrade.py", line 29, in _upgrade
    verbosity=verbosity,
  File "/www/sentry/lib/python2.7/site-packages/django/core/management/__init__.py", line 159, in call_command
    return klass.execute(*args, **defaults)
  File "/www/sentry/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/www/sentry/lib/python2.7/site-packages/south/management/commands/migrate.py", line 115, in handle
    ignore_ghosts=ignore_ghosts,
  File "/www/sentry/lib/python2.7/site-packages/south/migration/__init__.py", line 234, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/www/sentry/lib/python2.7/site-packages/south/migration/migrators.py", line 255, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/www/sentry/lib/python2.7/site-packages/south/migration/migrators.py", line 330, in migrate_many
    result = self.migrate(migration, database)
  File "/www/sentry/lib/python2.7/site-packages/south/migration/migrators.py", line 131, in migrate
    result = self.run(migration, database)
  File "/www/sentry/lib/python2.7/site-packages/south/migration/migrators.py", line 113, in run
    return self.run_migration(migration, database)
  File "/www/sentry/lib/python2.7/site-packages/south/migration/migrators.py", line 84, in run_migration
    migration_function()
  File "/www/sentry/lib/python2.7/site-packages/south/migration/migrators.py", line 60, in <lambda>
    return (lambda: direction(orm))
  File "/www/sentry/lib/python2.7/site-packages/sentry/south_migrations/0345_add_citext.py", line 13, in forwards
    self._forwards(orm)
  File "/www/sentry/lib/python2.7/site-packages/sentry/south_migrations/0345_add_citext.py", line 21, in _forwards
    db.execute('CREATE EXTENSION IF NOT EXISTS citext')
  File "/www/sentry/lib/python2.7/site-packages/south/db/generic.py", line 284, in execute
    cursor.execute(sql, params)
  File "/www/sentry/lib/python2.7/site-packages/raven/contrib/django/client.py", line 112, in execute
    return real_execute(self, sql, params)
  File "/www/sentry/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/www/sentry/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/www/sentry/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/www/sentry/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
    raise_the_exception(self.db, e)
  File "/www/sentry/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
    return func(self, *args, **kwargs)
  File "/www/sentry/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
    return func(self, *args, **kwargs)
  File "/www/sentry/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 "/www/sentry/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
    return func(self, sql, *args, **kwargs)
  File "/www/sentry/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 39, in execute
    return self.cursor.execute(sql, params)
django.db.utils.OperationalError: OperationalError('could not open extension control file "/usr/share/pgsql/extension/citext.control": No such file or directory\n',)
SQL: CREATE EXTENSION IF NOT EXISTS citext
(sentry) [root@sentry ~]# postgres --version
postgres (PostgreSQL) 9.2.18

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions