Failure during initial migration
I'm not 100% sure of the cause yet, but when trying to migrate django_signal_notifier, I run into the following.
This is on a large Django 3 project, which includes django-test-migrations, django-compat-patcher, and a few other intrusive apps, so it could be a inter-app-compatibility problem, or Django 3 compat problem.
My workaround is to catch the exception in apps.py, and ignore it, because I do not need signals registered when I havent even created the tables yet.
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/django/db/backends/utils.py", line 86, in _execute
return self.cursor.execute(sql, params)
File "/usr/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py", line 396, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: django_signal_notifier_trigger
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "django_signal_notifier/models.py", line 487, in reconnect_all_triggers
for trigger in cls.objects.all():
File "/usr/lib/python3.8/site-packages/django/db/models/query.py", line 276, in __iter__
self._fetch_all()
File "/usr/lib/python3.8/site-packages/django/db/models/query.py", line 1261, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/lib/python3.8/site-packages/django/db/models/query.py", line 57, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "/usr/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1152, in execute_sql
cursor.execute(sql, params)
File "/usr/lib/python3.8/site-packages/django/db/backends/utils.py", line 100, in execute
return super().execute(sql, params)
File "/usr/lib/python3.8/site-packages/django/db/backends/utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/lib/python3.8/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/lib/python3.8/site-packages/django/db/backends/utils.py", line 86, in _execute
return self.cursor.execute(sql, params)
File "/usr/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/lib/python3.8/site-packages/django/db/backends/utils.py", line 86, in _execute
return self.cursor.execute(sql, params)
File "/usr/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py", line 396, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: django_signal_notifier_trigger
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "./manage.py", line 52, in <module>
main()
File "./manage.py", line 46, in main
django_compat_patcher.patch()
File "/usr/lib/python3.8/site-packages/compat_patcher_core/__init__.py", line 75, in inner
return f(*args, **kwargs)
File "django_compat_patcher/__init__.py", line 19, in patch
generic_patch_software(
File "/usr/lib/python3.8/site-packages/compat_patcher_core/__init__.py", line 41, in generic_patch_software
patching_runner.patch_software()
File "django_compat_patcher/runner.py", line 22, in patch_software
django.setup() # Theoretically idempotent (except regarding logging?)
File "/usr/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/lib/python3.8/site-packages/django/apps/registry.py", line 122, in populate
app_config.ready()
File "django_signal_notifier/apps.py", line 34, in ready
Trigger.reconnect_all_triggers()
File "django_signal_notifier/models.py", line 500, in reconnect_all_triggers
raise ReconnectTriggersError("An error occurs when reconnecting trigger to the corresponding signals, "
django_signal_notifier.exceptions.ReconnectTriggersError: An error occurs when reconnecting trigger to the corresponding signals, Note: Make sure you migrate and makemigrations first