Device Bulk Import failed with error message 'Row 1 rack: Object not found' if location object exists #7663

Closed
opened 2025-12-29 20:26:38 +01:00 by adam · 2 comments
Owner

Originally created by @wiyin on GitHub (Feb 22, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.4.3

Python version

3.8

Steps to Reproduce

  1. Create 2 sites: SiteA & SiteB
  2. Create 2 locations in SiteA, Location1 & Location2
  3. Create 3 racks, rack1 in Location1@SiteA, rack2 in Location2@SiteA, rack3@SiteB
  4. Bulk Import via http://netbox/dcim/devices/import/
  5. Paste in the following lines
[
   {
       "name": "server-testing",
       "device_role": "server",
       "manufacturer": "Dell",
       "device_type": "PE740",
       "status": "active",
       "site": "SiteA", 
       "rack": "Rack1",
       "position": "22",
       "face": "front"
   }
]

Expected Behavior

device added successfully

Observed Behavior

import failed with error message 'Row 1 rack: Object not found'

Originally created by @wiyin on GitHub (Feb 22, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.4.3 ### Python version 3.8 ### Steps to Reproduce 1. Create 2 sites: SiteA & SiteB 3. Create 2 locations in SiteA, Location1 & Location2 4. Create 3 racks, rack1 in Location1@SiteA, rack2 in Location2@SiteA, rack3@SiteB 5. Bulk Import via http://netbox/dcim/devices/import/ 7. Paste in the following lines ``` [ { "name": "server-testing", "device_role": "server", "manufacturer": "Dell", "device_type": "PE740", "status": "active", "site": "SiteA", "rack": "Rack1", "position": "22", "face": "front" } ] ``` ### Expected Behavior device added successfully ### Observed Behavior import failed with error message 'Row 1 rack: Object not found'
adam added the type: bugstatus: accepted labels 2025-12-29 20:26:38 +01:00
adam closed this issue 2025-12-29 20:26:38 +01:00
Author
Owner

@wiyin commented on GitHub (Feb 22, 2023):

more findings:
Field 'location' is required when location object exists, following json works fine

[
    {
        "name": "server-testing",
        "device_role": "server",
        "manufacturer": "Dell",
        "device_type": "PE740",
        "status": "active",
        "site": "SiteA", 
        "rack": "Rack1",
        "position": "22",
        "face": "front",
        "location": "Location1"
    }
]

more references:
https://github.com/netbox-community/netbox/discussions/10166#discussioncomment-3585698
https://github.com/netbox-community/netbox/issues/9920
https://github.com/netbox-community/netbox/issues/5728
https://github.com/netbox-community/netbox/issues/5238

@wiyin commented on GitHub (Feb 22, 2023): more findings: Field 'location' is required when location object exists, following json works fine ``` [ { "name": "server-testing", "device_role": "server", "manufacturer": "Dell", "device_type": "PE740", "status": "active", "site": "SiteA", "rack": "Rack1", "position": "22", "face": "front", "location": "Location1" } ] ``` more references: https://github.com/netbox-community/netbox/discussions/10166#discussioncomment-3585698 https://github.com/netbox-community/netbox/issues/9920 https://github.com/netbox-community/netbox/issues/5728 https://github.com/netbox-community/netbox/issues/5238
Author
Owner

@jeremystretch commented on GitHub (Feb 27, 2023):

We can relax this a bit to only apply the location constraint when the field is present in the import data. I tested this, and it's still possible to explicitly set the location to none in case there are multiple racks with the same name (one with a location and one without).

@jeremystretch commented on GitHub (Feb 27, 2023): We can relax this a bit to only apply the location constraint when the field is present in the import data. I tested this, and it's still possible to explicitly set the location to none in case there are multiple racks with the same name (one with a location and one without).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7663