Missing parent field on Inventory Item Bulk Import #5175

Closed
opened 2025-12-29 19:25:06 +01:00 by adam · 1 comment
Owner

Originally created by @sleepinggenius2 on GitHub (Aug 10, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.10

Python version

3.8

Steps to Reproduce

  1. Navigate to Devices > Inventory Items > Import
  2. Try to add a "parent" field to the CSV
device,name,parent
PP:B117,parent,
PP:B117,child,parent

Expected Behavior

There should be a "parent" field with "name" accessor available when importing that is scoped to the given "device" field, just like you can do for Interface Bulk Import.

Observed Behavior

The complete exception is provided below:

<class 'KeyError'>

'csv'

Python version: 3.8.10
NetBox version: 2.11.10
Originally created by @sleepinggenius2 on GitHub (Aug 10, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.10 ### Python version 3.8 ### Steps to Reproduce 1. Navigate to Devices > Inventory Items > Import 2. Try to add a "parent" field to the CSV ``` device,name,parent PP:B117,parent, PP:B117,child,parent ``` ### Expected Behavior There should be a "parent" field with "name" accessor available when importing that is scoped to the given "device" field, just like you can do for Interface Bulk Import. ### Observed Behavior ``` The complete exception is provided below: <class 'KeyError'> 'csv' Python version: 3.8.10 NetBox version: 2.11.10 ```
adam added the type: bugstatus: accepted labels 2025-12-29 19:25:06 +01:00
adam closed this issue 2025-12-29 19:25:06 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 11, 2021):

I have a few notes:

  1. The parent field is indeed missing from the inventory item import form and needs to be added. This will be the resolution to this specific bug.
  2. The KeyError exception itself is actually a separate bug which has been fixed under #6910. (Normally the form would just return a human-friendly validation error citing an unknown column name.)
  3. Parent inventory items need to be completely imported before child items can be added. It's not possible to import both at the same time (as in the above example) because the parent item(s) must first exist in the database to be referenced.
@jeremystretch commented on GitHub (Aug 11, 2021): I have a few notes: 1. The `parent` field is indeed missing from the inventory item import form and needs to be added. This will be the resolution to this specific bug. 2. The KeyError exception itself is actually a separate bug which has been fixed under #6910. (Normally the form would just return a human-friendly validation error citing an unknown column name.) 3. Parent inventory items need to be completely imported before child items can be added. It's not possible to import both at the same time (as in the above example) because the parent item(s) must first exist in the database to be referenced.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5175