ProgrammingError when deleting user: django_admin_log table missing

Bug #1638262 reported by Gavin Panella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
High
Unassigned

Bug Description

Clicking on the rubbish bin icon next to a user account results in:

File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in get_response
  132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3/dist-packages/maasserver/utils/views.py" in view_atomic_with_post_commit_savepoint
  180. return view_atomic(*args, **kwargs)
File "/usr/lib/python3.5/contextlib.py" in inner
  30. return func(*args, **kwds)
File "/usr/lib/python3/dist-packages/django/contrib/auth/decorators.py" in _wrapped_view
  22. return view_func(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/django/views/generic/base.py" in view
  71. return self.dispatch(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/django/views/generic/base.py" in dispatch
  89. return handler(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/django/views/generic/edit.py" in post
  301. return self.delete(request, *args, **kwargs)
File "/usr/lib/python3/dist-packages/maasserver/views/settings.py" in delete
  107. profile.delete()
File "/usr/lib/python3/dist-packages/maasserver/models/userprofile.py" in delete
  77. self.user.delete()
File "/usr/lib/python3/dist-packages/django/db/models/base.py" in delete
  896. collector.delete()
File "/usr/lib/python3/dist-packages/django/db/models/deletion.py" in delete
  292. qs._raw_delete(using=self.using)
File "/usr/lib/python3/dist-packages/django/db/models/query.py" in _raw_delete
  549. sql.DeleteQuery(self.model).delete_qs(self, using)
File "/usr/lib/python3/dist-packages/django/db/models/sql/subqueries.py" in delete_qs
  78. self.get_compiler(using).execute_sql(NO_RESULTS)
File "/usr/lib/python3/dist-packages/django/db/models/sql/compiler.py" in execute_sql
  840. cursor.execute(sql, params)
File "/usr/lib/python3/dist-packages/django/db/backends/utils.py" in execute
  79. return super(CursorDebugWrapper, self).execute(sql, params)
File "/usr/lib/python3/dist-packages/django/db/backends/utils.py" in execute
  64. return self.cursor.execute(sql, params)
File "/usr/lib/python3/dist-packages/django/db/utils.py" in __exit__
  98. six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/lib/python3/dist-packages/django/utils/six.py" in reraise
  685. raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/django/db/backends/utils.py" in execute
  64. return self.cursor.execute(sql, params)

Exception Type: ProgrammingError at /accounts/bob/del/
Exception Value: relation "django_admin_log" does not exist
LINE 1: DELETE FROM "django_admin_log" WHERE "django_admin_log"."use...
                    ^

Changed in maas:
milestone: none → 2.2.0
status: New → Triaged
Changed in maas:
status: Triaged → Confirmed
Changed in maas:
milestone: 2.2.0 → 2.2.0rc1
Changed in maas:
milestone: 2.2.0rc1 → 2.2.0rc2
Changed in maas:
importance: Undecided → High
Changed in maas:
milestone: 2.2.0rc2 → 2.2.0rc3
Revision history for this message
Данило Шеган (danilo) wrote :

FWIW, I cannot reproduce this.

django_admin_log table is _not_ present on either my deb package installation of 2.2.0~rc2+bzr5983-0ubuntu1~16.04.1 nor fresh trunk (r6014) deployment after (make syncdb; make sampledata; make run), but removing users still works.

Looking further, django_admin_log table is only created when Django admin logging is enabled, and that further requires re-running syncdb. I think it's safe to mark this "Invalid" unless we can find a way to reproduce this.

Changed in maas:
status: Confirmed → Incomplete
Changed in maas:
milestone: 2.2.0rc3 → 2.2.1
Changed in maas:
milestone: 2.2.1 → 2.2.x
Changed in maas:
status: Incomplete → Invalid
milestone: 2.2.x → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.