29 Nov
2019
29 Nov
'19
3:37 p.m.
mark.van.holsteijn@gmail.com I stumbled across the same issue as Brian Carpenter within a slightly different environment: Ubuntu focal 20.04 PostgreSQL 12.1-1
I tried to replace the following line in /usr/lib/python3/dist-packages/hyperkitty/migrations/0007_allauth_20160808_1604.py
from python3-django-hyperkitty
(1.3.0-1ubuntu1):
cursor.execute("SELECT 1 from social_auth_usersocialauth")
with
cursor.execute("SELECT 1 from information_schema.tables where table_name ='social_auth_usersocialauth' and to_regclass('social_auth_usersocialauth') is not null")
then
python3 manage.py makemigrations
leads to a different issue:
"Traceback (most recent call last):",
" File \"/usr/lib/python3/dist-packages/django/db/backends/utils.py\", line 84, in _execute",
" return self.cursor.execute(sql, params)",
"psycopg2.errors.UndefinedTable: relation \"social_auth_usersocialauth\" does not exist",
"LINE 3: FROM social_auth_usersocialauth usa",
" ^",
"",
"",
"The above exception was the direct cause of the following exception:",
"",
"Traceback (most recent call last):",
" File \"manage.py\", line 10, in <module>",
" execute_from_command_line(sys.argv)",
" File \"/usr/lib/python3/dist-packages/django/core/management/__init__.py\", line 381, in execute_from_command_line",
" utility.execute()",
" File \"/usr/lib/python3/dist-packages/django/core/management/__init__.py\", line 375, in execute",
" self.fetch_command(subcommand).run_from_argv(self.argv)",
" File \"/usr/lib/python3/dist-packages/django/core/management/base.py\", line 323, in run_from_argv",
" self.execute(*args, **cmd_options)",
" File \"/usr/lib/python3/dist-packages/django/core/management/base.py\", line 364, in execute",
" output = self.handle(*args, **options)",
" File \"/usr/lib/python3/dist-packages/django/core/management/base.py\", line 83, in wrapped",
" res = handle_func(*args, **kwargs)",
" File \"/usr/lib/python3/dist-packages/django/core/management/commands/migrate.py\", line 234, in handle",
" fake_initial=fake_initial,",
" File \"/usr/lib/python3/dist-packages/django/db/migrations/executor.py\", line 117, in migrate",
" state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)",
" File \"/usr/lib/python3/dist-packages/django/db/migrations/executor.py\", line 147, in _migrate_all_forwards",
" state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)",
" File \"/usr/lib/python3/dist-packages/django/db/migrations/executor.py\", line 245, in apply_migration",
" state = migration.apply(state, schema_editor)",
" File \"/usr/lib/python3/dist-packages/django/db/migrations/migration.py\", line 124, in apply",
" operation.database_forwards(self.app_label, schema_editor, old_state, project_state)",
" File \"/usr/lib/python3/dist-packages/django/db/migrations/operations/special.py\", line 190, in database_forwards",
" self.code(from_state.apps, schema_editor)",
" File \"/usr/lib/python3/dist-packages/hyperkitty/migrations/0007_allauth_20160808_1604.py\", line 43, in migrate_social_users",
" \"\"\", (provider_old,))",
" File \"/usr/lib/python3/dist-packages/django/db/backends/utils.py\", line 67, in execute",
" return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)",
" File \"/usr/lib/python3/dist-packages/django/db/backends/utils.py\", line 76, in _execute_with_wrappers",
" return executor(sql, params, many, context)",
" File \"/usr/lib/python3/dist-packages/django/db/backends/utils.py\", line 84, in _execute",
" return self.cursor.execute(sql, params)",
" File \"/usr/lib/python3/dist-packages/django/db/utils.py\", line 89, in __exit__",
" raise dj_exc_value.with_traceback(traceback) from exc_value",
" File \"/usr/lib/python3/dist-packages/django/db/backends/utils.py\", line 84, in _execute",
" return self.cursor.execute(sql, params)",
"django.db.utils.ProgrammingError: relation \"social_auth_usersocialauth\" does not exist",
"LINE 3: FROM social_auth_usersocialauth usa",
" ^"
],
"stdout_lines": [
"No changes detected",
"Operations to perform:",
" Apply all migrations: account, admin, auth, contenttypes, django_mailman3, django_q, hyperkitty, postorius, sessions, sites, socialaccount",
"Running migrations:",
" Applying contenttypes.0001_initial... OK",
" Applying auth.0001_initial... OK",
" Applying account.0001_initial... OK",
" Applying account.0002_email_max_length... OK",
" Applying admin.0001_initial... OK",
" Applying admin.0002_logentry_remove_auto_add... OK",
" Applying admin.0003_logentry_add_action_flag_choices... OK",
" Applying contenttypes.0002_remove_content_type_name... OK",
" Applying auth.0002_alter_permission_name_max_length... OK",
" Applying auth.0003_alter_user_email_max_length... OK",
" Applying auth.0004_alter_user_username_opts... OK",
" Applying auth.0005_alter_user_last_login_null... OK",
" Applying auth.0006_require_contenttypes_0002... OK",
" Applying auth.0007_alter_validators_add_error_messages... OK",
" Applying auth.0008_alter_user_username_max_length... OK",
" Applying auth.0009_alter_user_last_name_max_length... OK",
" Applying auth.0010_alter_group_name_max_length... OK",
" Applying auth.0011_update_proxy_permissions... OK",
" Applying sites.0001_initial... OK",
" Applying django_mailman3.0001_initial... OK",
" Applying django_mailman3.0002_maildomain... OK",
" Applying django_q.0001_initial... OK",
" Applying django_q.0002_auto_20150630_1624... OK",
" Applying django_q.0003_auto_20150708_1326... OK",
" Applying django_q.0004_auto_20150710_1043... OK",
" Applying django_q.0005_auto_20150718_1506... OK",
" Applying django_q.0006_auto_20150805_1817... OK",
" Applying django_q.0007_ormq... OK",
" Applying django_q.0008_auto_20160224_1026... OK",
" Applying django_q.0009_auto_20171009_0915... OK",
" Applying socialaccount.0001_initial... OK",
" Applying socialaccount.0002_token_max_lengths... OK",
" Applying socialaccount.0003_extra_data_default_dict... OK",
" Applying hyperkitty.0001_initial... OK",
" Applying hyperkitty.0002_auto_20150311_0913... OK",
" Applying hyperkitty.0003_thread_starting_email... OK",
" Applying hyperkitty.0004_archived_date_and_subject... OK",
" Applying hyperkitty.0005_MailingList_list_id... OK",
" Applying hyperkitty.0006_thread_on_delete... OK",
" Applying hyperkitty.0007_allauth_20160808_1604..."
]