Inventory Item import error when device name is not unique across sites #3754

Closed
opened 2025-12-29 18:31:04 +01:00 by adam · 1 comment
Owner

Originally created by @srideviyedidha on GitHub (Jun 7, 2020).

Environment

  • Python version: 3.7.3
  • NetBox version: 2.8.5

Data Setup:
Dev 1 at Site 1
Dev 1 at Site 2
Steps to Reproduce

  1. import inventory items linked to ‘Dev 1’. Example data as follows:
device,name
Dev 1,Inv 1

Expected Behavior
Inventory item "Inv 1" created.
Observed Behavior
Error is thrown: Row 1 device: "Dev 1" is not a unique value for this field; multiple objects were found

Screenshot attached

My understanding :
Since Device has unique key over name and site, Site needs to be made available for import of inventory items and Device filtered by site to resolve this exception.
Screen Shot 2020-06-06 at 5 45 51 PM

Originally created by @srideviyedidha on GitHub (Jun 7, 2020). **Environment** * Python version: 3.7.3 * NetBox version: 2.8.5 **Data Setup:** _Dev 1_ at _Site 1_ _Dev 1_ at _Site 2_ **Steps to Reproduce** 1. import inventory items linked to ‘Dev 1’. Example data as follows: ``` device,name Dev 1,Inv 1 ``` **Expected Behavior** Inventory item "Inv 1" created. **Observed Behavior** Error is thrown: Row 1 device: "Dev 1" is not a unique value for this field; multiple objects were found Screenshot attached My understanding : Since Device has unique key over name and site, Site needs to be made available for import of inventory items and Device filtered by site to resolve this exception. ![Screen Shot 2020-06-06 at 5 45 51 PM](https://user-images.githubusercontent.com/33758202/83955903-a260eb00-a81d-11ea-8e17-cf734555a861.png)
adam closed this issue 2025-12-29 18:31:04 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 8, 2020):

Row 1 device: "Dev 1" is not a unique value for this field; multiple objects were found

This is expected. As the error message says, there are multiple devices named Dev 1, so NetBox has no way of knowing which you're referring to. You'll have to use some unique identifier instead of the name, such as the device's numeric primary key (using the header device.pk).

@jeremystretch commented on GitHub (Jun 8, 2020): > Row 1 device: "Dev 1" is not a unique value for this field; multiple objects were found This is expected. As the error message says, there are multiple devices named Dev 1, so NetBox has no way of knowing which you're referring to. You'll have to use some unique identifier instead of the name, such as the device's numeric primary key (using the header `device.pk`).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3754