Error when importing interfaces in bulk with interface parents #6047

Closed
opened 2025-12-29 19:36:01 +01:00 by adam · 3 comments
Owner

Originally created by @AnythingOverIP on GitHub (Feb 4, 2022).

Originally assigned to: @DanSheps on GitHub.

NetBox version

3.1.2

Python version

3.8

Steps to Reproduce

  1. Ensure you have a specified parent interface ("irb" in this example) on a device and then use the following in the bulk import window (/dcim/interfaces/import/):
    device,name,parent,type,enabled
    HOSTNAME_HERE,irb.5,irb,virtual,true

Expected Behavior

Interface should be created and mapped to its parent

Observed Behavior

Error message: Row 1 parent: "irb" is not a unique value for this field; multiple objects were found

image

Originally created by @AnythingOverIP on GitHub (Feb 4, 2022). Originally assigned to: @DanSheps on GitHub. ### NetBox version 3.1.2 ### Python version 3.8 ### Steps to Reproduce 1. Ensure you have a specified parent interface ("irb" in this example) on a device and then use the following in the bulk import window (/dcim/interfaces/import/): ``` device,name,parent,type,enabled HOSTNAME_HERE,irb.5,irb,virtual,true ``` ### Expected Behavior Interface should be created and mapped to its parent ### Observed Behavior Error message: Row 1 parent: "irb" is not a unique value for this field; multiple objects were found ![image](https://user-images.githubusercontent.com/25624251/152450394-946bb2b5-9d42-4cc2-bb1a-535057507092.png)
adam added the type: bugstatus: accepted labels 2025-12-29 19:36:01 +01:00
adam closed this issue 2025-12-29 19:36:01 +01:00
Author
Owner

@DanSheps commented on GitHub (Feb 4, 2022):

Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v3.1.7. Please re-confirm the reported behavior on the current stable release and adjust your post above as necessary. Remember to provide detailed steps that someone else can follow using a clean installation of NetBox to reproduce the issue. Remember to include the steps taken to create any initial objects or other data.

@DanSheps commented on GitHub (Feb 4, 2022): Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox **v3.1.7**. Please re-confirm the reported behavior on the current stable release and adjust your post above as necessary. Remember to provide detailed steps that someone else can follow using a clean installation of NetBox to reproduce the issue. Remember to include the steps taken to create any initial objects or other data.
Author
Owner

@AnythingOverIP commented on GitHub (Feb 14, 2022):

Hello @DanSheps, As suggested, I have upgraded Netbox to 3.1.7 and I am still facing this issue.

Steps to reproduce:

  1. Navigate to /dcim/interfaces/import/
    Use the following lines in the CSV data input form (replace HOSTNAME_HERE by a device that exists in your inventory)
device,name,type,enabled
HOSTNAME_HERE,irb,virtual,true
  1. On your device page, you should now have an interface named "irb"

image

  1. Navigate back to /dcim/interfaces/import/
    Use the following lines in the CSV data input form (again, by replacing HOSTNAME_HERE by a device that exists in your inventory)
device,name,parent,type,enabled
HOSTNAME_HERE,irb.5,irb,virtual,true

Result:
Error message is as decribed above:
image
Interface is not created.

At first, I thought that the ".5" was the issue, but no matter what interface name I put, I always get the error message saying that "irb" is not unique... If I change the parent interface name, let's say to lo0, I get that "lo0" is not unique...

Hopefully, this will be detailed enough. Don't hesitate to reach me if more information is needed. Thanks!

@AnythingOverIP commented on GitHub (Feb 14, 2022): Hello @DanSheps, As suggested, I have upgraded Netbox to 3.1.7 and I am still facing this issue. **Steps to reproduce:** 1. Navigate to /dcim/interfaces/import/ Use the following lines in the CSV data input form (replace HOSTNAME_HERE by a device that exists in your inventory) ``` device,name,type,enabled HOSTNAME_HERE,irb,virtual,true ``` 2. On your device page, you should now have an interface named "irb" ![image](https://user-images.githubusercontent.com/25624251/153929809-4bac7ea4-f2b1-407f-99b0-1d9e1f42fb47.png) 3. Navigate back to /dcim/interfaces/import/ Use the following lines in the CSV data input form (again, by replacing HOSTNAME_HERE by a device that exists in your inventory) ``` device,name,parent,type,enabled HOSTNAME_HERE,irb.5,irb,virtual,true ``` **Result:** Error message is as decribed above: ![image](https://user-images.githubusercontent.com/25624251/153930036-a2de837c-76bc-46e2-913d-069bbeabb841.png) Interface is not created. At first, I thought that the ".5" was the issue, but no matter what interface name I put, I always get the error message saying that "irb" is not unique... If I change the parent interface name, let's say to lo0, I get that "lo0" is not unique... Hopefully, this will be detailed enough. Don't hesitate to reach me if more information is needed. Thanks!
Author
Owner

@DanSheps commented on GitHub (Feb 15, 2022):

The issue is only present when there is multiple devices with a "irb" interface. This is due to the fact that the queryset for parent, bridge, and lag are not restricted before clean is run.

@DanSheps commented on GitHub (Feb 15, 2022): The issue is only present when there is multiple devices with a "irb" interface. This is due to the fact that the queryset for parent, bridge, and lag are not restricted before clean is run.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6047