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

Moving multiple devices down doesn´t work #34

Open
NotHBlocks opened this issue Jan 8, 2025 · 6 comments
Open

Moving multiple devices down doesn´t work #34

NotHBlocks opened this issue Jan 8, 2025 · 6 comments

Comments

@NotHBlocks
Copy link

netbox-reorder-rack version

v1.1.3

Python version

3.10

Steps to Reproduce

If I want to move 2 devices with an rack Height from 2 down there will appear an error which says that the spot is already occupied.
pic1 => the spot where the devices are
error_message => Error Message + new spot
pic1
Error_Message

Expected Behavior

More than one device can be moved down to a new position.

Observed Behavior

If i am moving both devices down an error will occure. If I am moving just one it will work as expected.

@Azmodeszer
Copy link

Can confirm.

@monteroman
Copy link

Same issue here. You have to move one, save, then go back and move another and save, etc. That can be painful if you have a lot of devices in the rack.

@julianstolp
Copy link

Same Issue here. @cruse1977 are you aware of this? I think the devices have to be saved in a certain order because NetBox validates whether the space is free when saving.

Internal Server Error: /api/plugins/reorder/save/9/

Report at /api/plugins/reorder/save/9/
Internal Server Error: /api/plugins/reorder/save/9/

[...] 

Traceback (most recent call last):
  None

Raised during: netbox_reorder_rack.api.views.SaveViewSet

@cruse1977
Copy link
Member

cruse1977 commented Feb 18, 2025

Same Issue here. @cruse1977 are you aware of this? I think the devices have to be saved in a certain order because NetBox validates whether the space is free when saving.

Internal Server Error: /api/plugins/reorder/save/9/

Report at /api/plugins/reorder/save/9/
Internal Server Error: /api/plugins/reorder/save/9/

[...] 

Traceback (most recent call last):
  None

Raised during: netbox_reorder_rack.api.views.SaveViewSet

It would be help to have the actual error.

In terms of this - maybe - would need to look, but if that is the case it may be quite a bit of logic. Possibly we need to clear ALL moved devices U position first before saving.

@julianstolp
Copy link

There is no traceback. The Exception is thrown from /netbox_reorder_rack/api/views.py#L93 but originates from def _update_device_positions() which calls device.clean() -> /netbox/dcim/models/devices.py#L888 onwards

Here an example exception text:

error: "{'position': ['U23 is already occupied or does not have sufficient space to accommodate this device type: GenericType (1.0U)']}"
message: "Error saving data"

I think removing all racked devices first and saving them in descending or ascending order would be the easiest way to solve this, as you said.

@cruse1977
Copy link
Member

cruse1977 commented Feb 20, 2025

I think removing all racked devices first and saving them in descending or ascending order would be the easiest way to solve this, as you said.

Pretty much with a caveat of any relocated devices rather than all. People complained about excessive changelogs when we cleared the rack :( - the fix for which is probably the cause of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants