Skip to content

hyperkitty/migrations/0009_duplicate_persona_users.py throws exception.

On mail.python.org, this throws

Traceback (most recent call last):
  File "/opt/mailman/mailman-bundler/bin/mailman-web-django-admin", line 50, in <module>
    sys.exit(djangorecipe.binscripts.manage('mailman_web.production'))
  File "/opt/mailman/mailman-bundler/eggs/djangorecipe-2.1.2-py2.7.egg/djangorecipe/binscripts.py", line 9, in manage
    management.execute_from_command_line(sys.argv)
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/core/management/commands/migrate.py", line 200, in handle
    executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/db/migrations/executor.py", line 92, in migrate
    self._migrate_all_forwards(plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/db/migrations/executor.py", line 121, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/db/migrations/executor.py", line 198, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/db/backends/base/schema.py", line 92, in __exit__
    self.atomic.__exit__(exc_type, exc_value, traceback)
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/db/transaction.py", line 223, in __exit__
    connection.commit()
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/db/backends/base/base.py", line 242, in commit
    self._commit()
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/db/backends/base/base.py", line 211, in _commit
    return self.connection.commit()
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/opt/mailman/mailman-bundler/eggs/Django-1.8.13-py2.7.egg/django/db/backends/base/base.py", line 211, in _commit
    return self.connection.commit()
django.db.utils.IntegrityError: update or delete on table "auth_user" violates foreign key constraint "social_auth_usersocialauth_user_id_17d28448_fk_auth_user_id" on table "social_auth_usersocialauth"
DETAIL:  Key (id)=(2) is still referenced from table "social_auth_usersocialauth".

Note this is actually Django-1.9.7 as eggs/Django-1.8.13-py2.7.egg is a symlink to venv/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg.