Skip to content

[4.0.0]Can't delete a specific admin - Key (id) is still referenced from table "django_admin_log" #15987

Discussion options

You must be logged in to vote

The error likely stems from an entry in the separate Django admin log (not to be confused with NetBox's global change log) which references the user account with ID 31. You can likely resolve the issue by deleting any of the offending records using a SQL shell manage.py dbshell:

netbox=> DELETE FROM django_admin_log WHERE id=31;

Or, to wipe out all the logs to mitigate additional errors:

netbox=> DELETE FROM django_admin_log;

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@CTV-2023
Comment options

Answer selected by CTV-2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants