Bulk upload of Location fails; parent uniqueness check not limited to site #8752

Closed
opened 2025-12-29 20:40:48 +01:00 by adam · 4 comments
Owner

Originally created by @ravinald on GitHub (Oct 18, 2023).

Originally assigned to: @abhi1693 on GitHub.

NetBox version

v3.6.4

Python version

3.10

Steps to Reproduce

  1. Create Site Site A
  2. Create Site Site B
  3. Create Location Floor 1 in Site A with slug floor-1
  4. Create Location Floor 1 in Site B with slug floor-1
  5. Navigate to Locations > bulk import
  6. Paste the following to get the error
site,parent,name,slug,status
Site B,Floor 1,Loc A,loc-a,active
  1. Delete Location Floor 1 in Site A
  2. Paste the same again with success

Expected Behavior

A new Location, Loc A, with a parent location of Floor 1 in site Site B should have been imported

Observed Behavior

It appears the query for locations to check for duplicates is not limiting to the defined Site. Instead, the following error is returned:

Record 1 parent: "Floor 1" is not a unique value for this field; multiple objects were found

Originally created by @ravinald on GitHub (Oct 18, 2023). Originally assigned to: @abhi1693 on GitHub. ### NetBox version v3.6.4 ### Python version 3.10 ### Steps to Reproduce 1. Create Site `Site A` 2. Create Site `Site B` 3. Create Location `Floor 1` in `Site A` with slug `floor-1` 4. Create Location `Floor 1` in `Site B` with slug `floor-1` 5. Navigate to Locations > bulk import 6. Paste the following to get the error ``` site,parent,name,slug,status Site B,Floor 1,Loc A,loc-a,active ``` 7. Delete Location `Floor 1` in `Site A` 8. Paste the same again with success ### Expected Behavior A new Location, `Loc A`, with a parent location of `Floor 1` in site `Site B` should have been imported ### Observed Behavior It appears the query for locations to check for duplicates is not limiting to the defined Site. Instead, the following error is returned: `Record 1 parent: "Floor 1" is not a unique value for this field; multiple objects were found`
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:40:48 +01:00
adam closed this issue 2025-12-29 20:40:48 +01:00
Author
Owner

@kprince28 commented on GitHub (Nov 3, 2023):

Can anyone please assign this issue to me ?

@kprince28 commented on GitHub (Nov 3, 2023): Can anyone please assign this issue to me ?
Author
Owner

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

@kprince28 have you made any progress on this?

@jeremystretch commented on GitHub (Dec 27, 2023): @kprince28 have you made any progress on this?
Author
Owner

@kprince28 commented on GitHub (Jan 8, 2024):

@jeremystretch I am currently contemplating the best approach to resolve the issue. The error seems to originate from Django's side.

@kprince28 commented on GitHub (Jan 8, 2024): @jeremystretch I am currently contemplating the best approach to resolve the issue. The error seems to originate from Django's side.
Author
Owner

@jeremystretch commented on GitHub (Jan 8, 2024):

@kprince28 ok, I'm going to open this back up for a new owner in case someone else would like to work on it. If you reach the point where you have a PR ready for review, please let me know and I'll reassign it to you.

@jeremystretch commented on GitHub (Jan 8, 2024): @kprince28 ok, I'm going to open this back up for a new owner in case someone else would like to work on it. If you reach the point where you have a PR ready for review, please let me know and I'll reassign it to you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8752