Key (object_type_id)=(55) is not present in table "django_content_type" #14194
Replies: 2 comments
-
@jepify did you find any solution to this problem? |
Beta Was this translation helpful? Give feedback.
-
A starting point would be to get a full backtrace: either set ADMINS and EMAIL in configuration.py (in which case it will get emailed to you), or set DEBUG=True temporarily (in which case you get it via the web interface). The question is, why is Netbox trying to insert or update a row on "extras_cachedvalue" with content type 55, if no such content type exists in the "django_content_type" table? Where does it get 55 from? The backtrace may help explain. Do you have any plugins installed, or have you ever had any plugins installed? In particular, have you used any secrets plugin? You could also try rebuilding the search cache:
Also check your django_content_type table for any obvious errors:
For me, id 55 is I have 140 in total, including 8 from plugins:
Some of these are legacy, e.g. "secrets" tables are hangovers from an old version of Netbox (and I'm not using any secrets plugin) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
NetBox version
v3.6.4
Python version
3.11
Steps to Reproduce
Can not reproduce yet in a simple case. We are getting this issue during our testing in our pipelines.
We are simply creating a device with the pynetbox api
Expected Behavior
The device to be created
Observed Behavior
pynetbox.core.query.RequestError: The request failed with code 500 Internal Server Error: {'error': 'insert or update on table "extras_cachedvalue" violates foreign key constraint "extras_cachedvalue_object_type_id_6f47d444_fk_django_co"\nDETAIL: Key (object_type_id)=(55) is not present in table "django_content_type".', 'exception': 'IntegrityError', 'netbox_version': '3.6.4', 'python_version': '3.11.4'}
Beta Was this translation helpful? Give feedback.
All reactions