PyCon / pycon2019

Website for PyCon 2019
BSD 3-Clause "New" or "Revised" License
158 stars 89 forks source link

500 error deleting proposals #570

Closed dpoirier closed 8 years ago

dpoirier commented 9 years ago

(For those with access to the basecamp project, https://basecamp.com/1849796/projects/9507827/messages/48756075#comment_335788247)

Internal Server Error: /2016/admin/pycon/pycontalkproposal/1359/delete/
Traceback (most recent call last):
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 616, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 233, in inner
    return view(request, *args, **kwargs)
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/utils/decorators.py", line 34, in _wrapper
    return bound_func(*args, **kwargs)
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/utils/decorators.py", line 30, in bound_func
    return func.__get__(self, type(self))(*args2, **kwargs2)
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/utils/decorators.py", line 145, in inner
    return func(*args, **kwargs)
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/db/transaction.py", line 232, in __exit__
    connection.commit()
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 173, in commit
    self._commit()
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 142, in _commit
    return self.connection.commit()
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/srv/pycon/env/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 142, in _commit
    return self.connection.commit()
IntegrityError: update or delete on table "proposals_proposalbase" violates foreign key constraint "schedule_presentation__proposal_id_fkey" on table "schedule_presentation"
DETAIL:  Key (id)=(1359) is still referenced from table "schedule_presentation".
brandon-rhodes commented 8 years ago

Happily, this glitch was resolved, as is detailed in the Basecamp issue. It turned out that some old tables from the previous year, orphaned when the upgrade added symposion_ to the beginning of each table name and re-created them as new tables, were still sitting around with foreign key references still pointing at the old proposals, that Django could not delete because it had no models telling it that the old tables were there. The old tables were removed, and the purging of the proposals table was able to proceed without further problems.