I also tried to upgrade to 21.1.4 but it didn’t work either
- Created dump by: psql -U postgres -d sentryX < dump.sql
- Downloaded onpremise 9.1.2 and run ./install.sh
- Connect to postgres container
- DROP DB
- CREATE DB
- psql -U postgres postgres < dump.sql
- run install.sh
- downloaded 21.1.4, run ./install.sh and got this error:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/contrib/contenttypes/models.py", line 54, in get_for_model
ct = self.get(app_label=opts.app_label, model=opts.model_name)
File "/usr/local/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 380, in get
self.model._meta.object_name
__fake__.DoesNotExist: ContentType matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 464, in get_or_create
return self.get(**lookup), False
File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 380, in get
self.model._meta.object_name
__fake__.DoesNotExist: ContentType matching query does not exist.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 91, in inner
return func(self, sql, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/base.py", line 75, in execute
return self.cursor.execute(sql, clean_bad_params(params))
psycopg2.IntegrityError: null value in column "id" violates not-null constraint
DETAIL: Failing row contains (null, sentry, alertrule).
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 77, in inner
raise_the_exception(self.db, e)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 75, in inner
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 18, in inner
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 95, in inner
raise exc_info[0](msg).with_traceback(exc_info[2])
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 91, in inner
return func(self, sql, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/base.py", line 75, in execute
return self.cursor.execute(sql, clean_bad_params(params))
psycopg2.IntegrityError: IntegrityError('null value in column "id" violates not-null constraint\nDETAIL: Failing row contains (null, sentry, alertrule).\n',)
SQL: INSERT INTO "django_content_type" ("app_label", "model") VALUES (%s, %s) RETURNING "django_content_type"."id"
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/sentry", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/sentry/runner/__init__.py", line 195, in main
func(**kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/sentry/runner/decorators.py", line 29, in inner
return ctx.invoke(f, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/sentry/runner/commands/upgrade.py", line 171, in upgrade
_upgrade(not noinput, traceback, verbosity, not no_repair, with_nodestore)
File "/usr/local/lib/python3.6/site-packages/sentry/runner/commands/upgrade.py", line 127, in _upgrade
ignore_ghost_migrations=True,
File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 131, in call_command
return command.execute(*args, **defaults)
File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 227, in handle
self.verbosity, self.interactive, connection.alias, apps=post_migrate_apps, plan=plan,
File "/usr/local/lib/python3.6/site-packages/django/core/management/sql.py", line 53, in emit_post_migrate_signal
**kwargs
File "/usr/local/lib/python3.6/site-packages/django/dispatch/dispatcher.py", line 193, in send
for receiver in self._live_receivers(sender)
File "/usr/local/lib/python3.6/site-packages/django/dispatch/dispatcher.py", line 193, in <listcomp>
for receiver in self._live_receivers(sender)
File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/management/__init__.py", line 63, in create_permissions
ctype = ContentType.objects.db_manager(using).get_for_model(klass)
File "/usr/local/lib/python3.6/site-packages/django/contrib/contenttypes/models.py", line 60, in get_for_model
model=opts.model_name,
File "/usr/local/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 466, in get_or_create
return self._create_object_from_params(lookup, params)
File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 509, in _create_object_from_params
six.reraise(*exc_info)
File "/usr/local/lib/python3.6/site-packages/django/utils/six.py", line 686, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 500, in _create_object_from_params
obj = self.create(**params)
File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 394, in create
obj.save(force_insert=True, using=self.db)
File "/usr/local/lib/python3.6/site-packages/django/db/models/base.py", line 808, in save
force_update=force_update, update_fields=update_fields)
File "/usr/local/lib/python3.6/site-packages/django/db/models/base.py", line 838, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/usr/local/lib/python3.6/site-packages/django/db/models/base.py", line 924, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/usr/local/lib/python3.6/site-packages/django/db/models/base.py", line 963, in _do_insert
using=using, raw=raw)
File "/usr/local/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 1079, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1112, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.6/site-packages/sentry_sdk/integrations/django/__init__.py", line 499, in execute
return real_execute(self, sql, params)
File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 77, in inner
raise_the_exception(self.db, e)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 75, in inner
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 18, in inner
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 95, in inner
raise exc_info[0](msg).with_traceback(exc_info[2])
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py", line 91, in inner
return func(self, sql, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/sentry/db/postgres/base.py", line 75, in execute
return self.cursor.execute(sql, clean_bad_params(params))
django.db.utils.IntegrityError: IntegrityError('null value in column "id" violates not-null constraint\nDETAIL: Failing row contains (null, sentry, alertrule).\n',)
SQL: INSERT INTO "django_content_type" ("app_label", "model") VALUES (%s, %s) RETURNING "django_content_type"."id"
1
An error occurred, caught SIGERR on line 12
Cleaning up...