Issue related to failed device type import due to missing manufacturer #3501

Closed
opened 2025-12-29 18:29:32 +01:00 by adam · 8 comments
Owner

Originally created by @ryanmerolle on GitHub (Mar 24, 2020).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.7.10

Steps to Reproduce

  1. Import device type where the manufacturer does not exist prompting an import failure.
  2. Add the manufacturer.
  3. Attempt to import device type, but the import fails due to interface and device type existing, but not visible in the device type page.

Expected Behavior

  • First device type import failure should not import any of the device type data.
  • Second device type import failure should not occur given the first failure prevented device type data from inserting into the associated database tables.

Observed Behavior

  • First device type import failure imports of the device type data.
  • Second device type import failure occurs stating interfaces[42] __all__: Interface template with this Device type and Name already exists. given the first import seems to have imported device type data.
  • Even those it says the device type exists, nothing is view-able in the device type page related to said device type.

Possible Approaches to fix this Bug

  • Revert import on any failure.
  • Auto-create missing manufacturer. (Not suggested given this would stretch the scope of device type imports)
  • Figure out a way to override existing data.
Originally created by @ryanmerolle on GitHub (Mar 24, 2020). ### Environment * Python version: 3.6.8 * NetBox version: 2.7.10 ### Steps to Reproduce 1. Import device type where the manufacturer does not exist prompting an import failure. 2. Add the manufacturer. 3. Attempt to import device type, but the import fails due to interface and device type existing, but not visible in the device type page. ### Expected Behavior - First device type import failure should not import any of the device type data. - Second device type import failure should not occur given the first failure prevented device type data from inserting into the associated database tables. ### Observed Behavior - First device type import failure imports of the device type data. - Second device type import failure occurs stating `interfaces[42] __all__: Interface template with this Device type and Name already exists.` given the first import seems to have imported device type data. - Even those it says the device type exists, nothing is view-able in the device type page related to said device type. ### Possible Approaches to fix this Bug - Revert import on any failure. - Auto-create missing manufacturer. (Not suggested given this would stretch the scope of device type imports) - Figure out a way to override existing data.
adam closed this issue 2025-12-29 18:29:32 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 24, 2020):

  1. Attempt to import device type, but the

I'm assuming this got cut off?

Also, please post the data you're using to trigger the error.

@jeremystretch commented on GitHub (Mar 24, 2020): > 3. Attempt to import device type, but the I'm assuming this got cut off? Also, please post the data you're using to trigger the error.
Author
Owner

@k01ek commented on GitHub (Mar 25, 2020):

I recently got this error. When I was trying to import this device type
console-server-ports[46] __all__: Console server port template with this Device type and Name already exists.
It was new clear netbox (v2.7.10) docker instance.

@k01ek commented on GitHub (Mar 25, 2020): I recently got this error. When I was trying to import [this](https://github.com/netbox-community/devicetype-library/blob/master/device-types/Opengear/CM7196-2-DAC-US.yaml) device type `console-server-ports[46] __all__: Console server port template with this Device type and Name already exists.` It was new clear netbox (v2.7.10) docker instance.
Author
Owner

@k01ek commented on GitHub (Mar 25, 2020):

And I find error in yaml file:
f4598a647d/device-types/Opengear/CM7196-2-DAC-US.yaml (L102)
Its duplicate port name...

@k01ek commented on GitHub (Mar 25, 2020): And I find error in yaml file: https://github.com/netbox-community/devicetype-library/blob/f4598a647d82f850bfd2413d6c93bc1556b17095/device-types/Opengear/CM7196-2-DAC-US.yaml#L102 Its duplicate port name...
Author
Owner

@DanSheps commented on GitHub (Mar 25, 2020):

k01ek I have corrected that error.

@ryanmerolle is this perhaps the issue you were coming up against?

@DanSheps commented on GitHub (Mar 25, 2020): k01ek I have corrected that error. @ryanmerolle is this perhaps the issue you were coming up against?
Author
Owner

@ryanmerolle commented on GitHub (Mar 26, 2020):

I just tried with NetBoxDemo.com (user: netbox / pass: netbox).

I tried to load APC AP7830 when APC was not seen in manufacturers.

I get the same issue I described, but I also cannot add APC as a manufacturer now either.

I then tried with Arista 7010 and I also get the same issue.

I think NetBoxDemo.com resets its data every night, so it should remain in this bad state for the remainder of the day.

@ryanmerolle commented on GitHub (Mar 26, 2020): I just tried with [NetBoxDemo.com](https://netboxdemo.com) (user: netbox / pass: netbox). I tried to load [APC AP7830](https://raw.githubusercontent.com/netbox-community/devicetype-library/master/device-types/APC/AP7830.yaml) when APC was not seen in manufacturers. I get the same issue I described, but I also cannot add APC as a manufacturer now either. I then tried with [Arista 7010](https://raw.githubusercontent.com/netbox-community/devicetype-library/master/device-types/Arista/DCS-7010T-48.yaml) and I also get the same issue. I think [NetBoxDemo.com](https://netboxdemo.com) resets its data every night, so it should remain in this bad state for the remainder of the day.
Author
Owner

@DanSheps commented on GitHub (Mar 27, 2020):

APC AP7830 imported fine on master @ https://master.netbox.dansheps.com

Arista 7010 fails due to:

  - name: Ethernet33
    type: 1000base-t

being at position 42

@DanSheps commented on GitHub (Mar 27, 2020): APC AP7830 imported fine on master @ https://master.netbox.dansheps.com Arista 7010 fails due to: ``` - name: Ethernet33 type: 1000base-t ``` being at position 42
Author
Owner

@DanSheps commented on GitHub (Mar 27, 2020):

Correcting the error resolves this.

This does appear to be issues with the device types or the import with netbox itself, but instead with the templates used. My suggestion is if you come up against this again, try and find out where the duplicate is (in this case, it is interface 43 on the Arista one as it is at position 42 in the array)

@DanSheps commented on GitHub (Mar 27, 2020): Correcting the error resolves this. This does appear to be issues with the device types or the import with netbox itself, but instead with the templates used. My suggestion is if you come up against this again, try and find out where the duplicate is (in this case, it is interface 43 on the Arista one as it is at position 42 in the array)
Author
Owner

@ryanmerolle commented on GitHub (Mar 30, 2020):

@DanSheps agreed. I really thought it was more than just a bad data model imported and something to do with the manufacturer not existing. I tested with my own install and netboxdemo.com and I could reproduce the issue, but it seems more of a remnant of original bad import than anything. A fresh db and the latest netbox release does not reproduce the issue even when you try to import a device where the manufacturer is not present in netbox. Thanks!

@ryanmerolle commented on GitHub (Mar 30, 2020): @DanSheps agreed. I really thought it was more than just a bad data model imported and something to do with the manufacturer not existing. I tested with my own install and netboxdemo.com and I could reproduce the issue, but it seems more of a remnant of original bad import than anything. A fresh db and the latest netbox release does not reproduce the issue even when you try to import a device where the manufacturer is not present in netbox. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3501