You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an app registers itself using sentry.apps entrypoint and if the app has it's own models, the models of this app are not seen when "sentry upgrade" or "sentry start" is run. Hence there's no way to get those models into the database, except when adding the app manually to INSTALLED_APPS.
The culprit is that sentry.utils.runner:initialize_app calls skip_migration_if_applied and at some point during the initialization (or getitem) of Migrations(app_name)[name] Django populates the app cache (in django.db.models.loading). But since initialize_app is called as a callback in logan.importer.LoganLoaderbefore the settings module is returned and properly registered in Python's import machinery all from django.conf import settings imports that happen in south will import the unmodified settings.
You can easily see what happens by adding
from django.conf import settings as django_settings
print(django_settings.INSTALLED_APPS, settings.INSTALLED_APPS)
somewhere at the top of skip_migration_if_applied (stupid prints, I know, but it illustrates the issue :) ).
As far as I understand the code the behavior that the callback function passed to LoganLoader relies on code that imports Django settings is wrong.
The text was updated successfully, but these errors were encountered:
If an app registers itself using sentry.apps entrypoint and if the app has it's own models, the models of this app are not seen when "sentry upgrade" or "sentry start" is run. Hence there's no way to get those models into the database, except when adding the app manually to INSTALLED_APPS.
The culprit is that
sentry.utils.runner:initialize_app
callsskip_migration_if_applied
and at some point during the initialization (or getitem) of Migrations(app_name)[name] Django populates the app cache (in django.db.models.loading). But sinceinitialize_app
is called as a callback inlogan.importer.LoganLoader
before the settings module is returned and properly registered in Python's import machinery allfrom django.conf import settings
imports that happen in south will import the unmodified settings.You can easily see what happens by adding
somewhere at the top of
skip_migration_if_applied
(stupid prints, I know, but it illustrates the issue :) ).As far as I understand the code the behavior that the callback function passed to LoganLoader relies on code that imports Django settings is wrong.
The text was updated successfully, but these errors were encountered: