Skip to content

After changing Rack to use "too small" RackType, not able to change RackType again, remove it, or make other edits to Rack #18336

@ZPrimed

Description

@ZPrimed

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.11

Python Version

3.10

Steps to Reproduce

[steps edited after initial issue creation, but should be correct as of 2025-01-14]

  1. Create a Rack of any number of U (let's use 42 as it's the default), name it "FooRack"
  2. Create a RackType that is smaller than the Rack you initially created - say 16U, name it "TestRT-16U"
  3. [edit: missing from original report] Add a Device to FooRack in a U / position that is "beyond the bounds" of TestRT-16U; e.g. put the Device at U17, or U20, or U42
  4. Create another RackType that is the same number of U as the original Rack - 42U, name it "TestRT-42U"
  5. Edit FooRack, and set the RackType to be TestRT-16U, and Save [this will complete successfully, but probably shouldn't, as TestRT-16U has fewer rack units than FooRack originally did!]
  6. Now, edit FooRack again, and either try to set the RackType to "TestRT-42U", or hit the X next to the RackType in order to try to clear it entirely, and click Save. This will throw an error. In fact, even unrelated changes (like editing the Comments) will throw the same error.

Note: if you FIRST change the Rack to a RackType that has sufficient U for the Rack, this works correctly and will allow you to remove the RackType or change it again on a subsequent save. You only get the error if you choose the wrong-size RackType and save it during step 4.

Expected Behavior

  1. I would prefer that the UI prevent me from self-harm, by warning or erroring that the RackType I was trying to switch my Rack to has fewer U than the existing Rack object I was changing, but this is just a wish/hope
  2. Regardless of 1, the UI should allow me to change the RackType or remove it entirely from a Rack, without throwing errors

Observed Behavior

I receive an error message and am not able to save the changes made to the Rack object:

<class 'ValueError'>

'RackForm' has no field named 'u_height'.

Python version: 3.10.12
NetBox version: 4.1.11
Plugins: 
  netbox_topology_views: 4.1.0

I can reproduce this on the Public Demo instance, same error message other than the differing version numbers & plugins:

<class 'ValueError'>

'RackForm' has no field named 'u_height'.

Python version: 3.10.14
NetBox version: 4.2.0
Plugins: 
  netbox_demo: 0.5.0

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: 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