Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mscpik opened this issue Nov 9, 2022 · 7 comments
Closed

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

mscpik opened this issue Nov 9, 2022 · 7 comments
Labels
pending closure Requires immediate attention to avoid being closed for inactivity status: revisions needed This issue requires additional information to be actionable type: bug A confirmed report of unexpected behavior in the application

Comments

@mscpik
Copy link

mscpik commented Nov 9, 2022

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

@mscpik mscpik added the type: bug A confirmed report of unexpected behavior in the application label Nov 9, 2022
@arthanson arthanson self-assigned this Nov 9, 2022
@arthanson
Copy link
Collaborator

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@arthanson arthanson added the status: revisions needed This issue requires additional information to be actionable label Nov 9, 2022
@arthanson arthanson removed their assignment Nov 9, 2022
@mscpik mscpik changed the title Strange behavior when changing the parent location Strange behavior when changing the parent location with [Bulk Edit] Nov 17, 2022
@mscpik
Copy link
Author

mscpik commented Nov 17, 2022

I have edited the original bug report and using a fresh install of https://github.com/netbox-community/netbox-docker to test.
It is very hard to reproduce the error and in my opinion it has to do with [Bulk Edit] of locations.
With direct editing/changing the parent of a location where seems to be no problems.

@arthanson arthanson self-assigned this Nov 18, 2022
@mscpik
Copy link
Author

mscpik commented Nov 19, 2022

In search of a solution to repair my productive database I found this older closed bug report:
"Misassignment of Locations parents" #9196

The method to rebuild location objects from nbshell worked to correct the parent child relations between the locations.

@arthanson
Copy link
Collaborator

Potentially dependent on #6587

@mscpik
Copy link
Author

mscpik commented Dec 8, 2022

Potentially dependent on #6587

You might be right
A description how MPTT tree works on #8987 (reply in thread)

@arthanson arthanson removed their assignment Jan 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Apr 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2023

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending closure Requires immediate attention to avoid being closed for inactivity status: revisions needed This issue requires additional information to be actionable type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants