netbox-community / Device-Type-Library-Import

This library is intended to assist with importing device and module types into NetBox from the NetBox Community DeviceType-Library
https://github.com/netbox-community/devicetype-library
MIT License
247 stars 74 forks source link

error": "duplicate key value violates unique constraint " #125

Closed derekschartung closed 3 months ago

derekschartung commented 4 months ago

Fresh install of Netbox 3.7.3. New DB. Getting this error when running import.

Package Installed https://github.com/netbox-community/devicetype-library.git No Vendors Specified, Gathering All Device-Types 121 Vendors Found 2927 Device-Types Found {"error": "duplicate key value violates unique constraint \"dcim_manufacturer_slug_key\"\nDETAIL: Key (slug)=(watchguard) already exists.", "exception": "IntegrityError", "netbox_version": "3.7.3", "python_version": "3.11.4"} {"manufacturer":["Related object not found using the provided attributes: {'name': 'HPE', 'slug': 'hpe'}"]} Traceback (most recent call last): File "/app/nb-dt-import.py", line 853, in <module> main() File "/app/nb-dt-import.py", line 826, in main createDeviceTypes(deviceTypes, nb) File "/app/nb-dt-import.py", line 680, in createDeviceTypes dt.id, nb) UnboundLocalError: local variable 'dt' referenced before assignment

netravnen commented 3 months ago
          https://github.com/netbox-community/devicetype-library/pull/1978 fixes this issue.

Originally posted by @gurubert in https://github.com/netbox-community/Device-Type-Library-Import/issues/123#issuecomment-1976622782