Try to delete a username from netbox, some old plug-in in database does not allow me delete the user #9276

Closed
opened 2025-12-29 20:47:46 +01:00 by adam · 1 comment
Owner

Originally created by @kzhang1310 on GitHub (Feb 21, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.6.5

Python Version

3.9

Steps to Reproduce

  1. Select the username from Admin-> Authentication -> Users
  2. Click Delete 1 user
  3. with following error message

<class 'django.db.utils.IntegrityError'>

update or delete on table "auth_user" violates foreign key constraint "secrets_userkey_user_id_13ada46b_fk_auth_user_id" on table "netbox_secretstore_userkey"
DETAIL: Key (id)=(40) is still referenced from table "netbox_secretstore_userkey".

Python version: 3.9.16
NetBox version: 3.6.5
Plugins:
netbox_napalm_plugin: 0.1.7

We have uninstall the secretstore plugin long time ago.

Expected Behavior

not allow me delete the user

Observed Behavior

The complete exception is provided below:
<class 'django.db.utils.IntegrityError'>

update or delete on table "auth_user" violates foreign key constraint "secrets_userkey_user_id_13ada46b_fk_auth_user_id" on table "netbox_secretstore_userkey"
DETAIL: Key (id)=(40) is still referenced from table "netbox_secretstore_userkey".

Python version: 3.9.16
NetBox version: 3.6.5
Plugins:
netbox_napalm_plugin: 0.1.7

We have uninstall the secretstore plugin long time ago.

Originally created by @kzhang1310 on GitHub (Feb 21, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.6.5 ### Python Version 3.9 ### Steps to Reproduce 1. Select the username from Admin-> Authentication -> Users 2. Click Delete 1 user 3. with following error message ----------------------- <class 'django.db.utils.IntegrityError'> update or delete on table "auth_user" violates foreign key constraint "secrets_userkey_user_id_13ada46b_fk_auth_user_id" on table "netbox_secretstore_userkey" DETAIL: Key (id)=(40) is still referenced from table "netbox_secretstore_userkey". Python version: 3.9.16 NetBox version: 3.6.5 Plugins: netbox_napalm_plugin: 0.1.7 ----------------------------------- We have uninstall the secretstore plugin long time ago. ### Expected Behavior not allow me delete the user ### Observed Behavior The complete exception is provided below: <class 'django.db.utils.IntegrityError'> update or delete on table "auth_user" violates foreign key constraint "secrets_userkey_user_id_13ada46b_fk_auth_user_id" on table "netbox_secretstore_userkey" DETAIL: Key (id)=(40) is still referenced from table "netbox_secretstore_userkey". Python version: 3.9.16 NetBox version: 3.6.5 Plugins: netbox_napalm_plugin: 0.1.7 ----------------------------------- We have uninstall the secretstore plugin long time ago.
adam closed this issue 2025-12-29 20:47:46 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 22, 2024):

This is not a NetBox bug. You'll need to open an issue with the plugin responsible for introducing the database relationship.

@jeremystretch commented on GitHub (Feb 22, 2024): This is not a NetBox bug. You'll need to open an issue with the plugin responsible for introducing the database relationship.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9276