Skip to content

Strange behavior when changing the parent location with [Bulk Edit] #10875

Closed as not planned
@mscpik

Description

@mscpik

NetBox version

v3.3.8 (fresh installation)

Python version

3.10

Steps to Reproduce

I create locations in a hierarchical order with 3 layers.

Layer 1: buildings

Layer 2: floors

Layer 3: rooms

like this
image

I created child locations(rooms) with "Add Child Location" button and some of them on the wrong floor.
image

To correct this I edit (single edit) the location with the wrong floor and change the parent of this location object to the right one.
Here for locations "building A_room 0.01" and "building A_room 0.02" to change the parent to "building A - ground" with no problems.
image

But if I use "Bulk Edit" over the "Edit Selected" button(from a VM snapshot), here for locations "building A_room 0.01" and "building A_room 0.02", to change the parent to "building A - ground", I get this as result.
The hierarchical order of this locations is destroyed/mixed up.
image
location "building A - ground"
image
location "building A - room 0.01"
image

Expected Behavior

Move all selected locations with "bulk edit" to the correct parent location.

Observed Behavior

Rooms seems to be in more than one parent location and some location objects not moveable/editable any more, even if want to remove(Set Null) the parent in the location object, independent of the edit mode I used.
In some situations I also get an server error if I want to remove a parent of a location.
Like this location object
image
In edit location I removed the parent location and get this error message.
image
Complete error message:

<class 'django.db.utils.IntegrityError'>

new row for relation "dcim_location" violates check constraint "dcim_location_level_check"
DETAIL: Failing row contains (2022-11-17 14:15:01.236855+00, 2022-11-17 14:15:01.236905+00, {}, 30, building A - ground, building-a-ground, , 2, 23, 2, -1, 27, 1, null, active).

Python version: 3.10.6
NetBox version: 3.3.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending closureRequires immediate attention to avoid being closed for inactivitystatus: revisions neededThis issue requires additional information to be actionabletype: bugA confirmed report of unexpected behavior in the application

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions