Lack of space validation for object placement on rear of rack #1013

Closed
opened 2025-12-29 16:27:53 +01:00 by adam · 8 comments
Owner

Originally created by @zevlag on GitHub (Jun 7, 2017).

Issue type: Bug

When I browse to a particular rack, I get this error:

http://netbox/dcim/racks/29/

<type 'exceptions.KeyError'>

28

screenshot 2017-06-07 11 18 03

Python version: 2.7
NetBox version: (v2.0.5-dev)

Originally created by @zevlag on GitHub (Jun 7, 2017). <!-- Please note: GitHub issues are to be used only for feature requests and bug reports. For installation assistance or general discussion, please join us on the mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please indicate "bug report" or "feature request" below. Be sure to search the existing set of issues (both open and closed) to see if a similar issue has already been raised. --> ### Issue type: Bug When I browse to a particular rack, I get this error: http://netbox/dcim/racks/29/ ``` <type 'exceptions.KeyError'> 28 ``` ![screenshot 2017-06-07 11 18 03](https://user-images.githubusercontent.com/7240045/26891664-0e056580-4b73-11e7-9ef1-6e059a68836c.png) <!-- If filing a bug, please indicate the version of Python and NetBox you are running. (This is not necessary for feature requests.) --> **Python version:** 2.7 **NetBox version:** (v2.0.5-dev) <!-- If filing a bug, please record the exact steps taken to reproduce the bug and any errors messages that are generated. If filing a feature request, please precisely describe the data model or workflow you would like to see implemented, and provide a use case. -->
adam added the type: bug label 2025-12-29 16:27:53 +01:00
adam closed this issue 2025-12-29 16:27:53 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 7, 2017):

Not much to go on. Please set debug=True in configuration.py and try again, then post the full stack trace.

@jeremystretch commented on GitHub (Jun 7, 2017): Not much to go on. Please set `debug=True` in configuration.py and try again, then post the full stack trace.
Author
Owner

@zevlag commented on GitHub (Jun 7, 2017):

The traceback is posted here:
http://dpaste.com/0YKTEV5

@zevlag commented on GitHub (Jun 7, 2017): The traceback is posted here: http://dpaste.com/0YKTEV5
Author
Owner

@zevlag commented on GitHub (Jun 7, 2017):

By looking at the database I was able to determine what happened. Let's see if I can explain it clearly.

If I start with a rack that looks like this:
screenshot 2017-06-07 11 45 13

You will notice that the rear of the rack U27 is open. Front of the rack, U27/28 is available.

If I place an object that is 2U on the Rear of the rack then I get this error when viewing the rack. Obviously there is an overlap.

Netbox doesn't validate there is sufficient space to place an object.

@zevlag commented on GitHub (Jun 7, 2017): By looking at the database I was able to determine what happened. Let's see if I can explain it clearly. If I start with a rack that looks like this: ![screenshot 2017-06-07 11 45 13](https://user-images.githubusercontent.com/7240045/26893441-99031f2e-4b78-11e7-82cf-50e2d36aaeea.png) You will notice that the rear of the rack U27 is open. Front of the rack, U27/28 is available. If I place an object that is 2U on the Rear of the rack then I get this error when viewing the rack. Obviously there is an overlap. Netbox doesn't validate there is sufficient space to place an object.
Author
Owner

@zevlag commented on GitHub (Jun 7, 2017):

Looking into this further, it appears that the list of available RU doesn't change when switching between Front/Back. Netbox does give an error if I try to place 2RU item at U28 on the front.

@zevlag commented on GitHub (Jun 7, 2017): Looking into this further, it appears that the list of available RU doesn't change when switching between Front/Back. Netbox does give an error if I try to place 2RU item at U28 on the front.
Author
Owner

@jeremystretch commented on GitHub (Jun 9, 2017):

I haven't been able to replicate this. I created a rack and installed a half-depth 1U device in the rear of U28 just like your example. When I try to add a 2U device to U27 (front or rear), NetBox returns the following validation error as expected:

U27 is already occupied or does not have sufficient space to accommodate a(n) 2U Box (2U)

I can mount a 2U box on the front of U27/28 only if the device type is half-depth.

Could you try replicating it from scratch (as opposed to starting with an already populated rack)? Please be sure to list the exact steps needed to reproduce the error from scratch, including the height and depth of devices you install.

@jeremystretch commented on GitHub (Jun 9, 2017): I haven't been able to replicate this. I created a rack and installed a half-depth 1U device in the rear of U28 just like your example. When I try to add a 2U device to U27 (front or rear), NetBox returns the following validation error as expected: > U27 is already occupied or does not have sufficient space to accommodate a(n) 2U Box (2U) I can mount a 2U box on the front of U27/28 only if the device type is half-depth. Could you try replicating it from scratch (as opposed to starting with an already populated rack)? Please be sure to list the exact steps needed to reproduce the error from scratch, including the height and depth of devices you install.
Author
Owner

@zevlag commented on GitHub (Jun 9, 2017):

::sigh::

I can't reproduce it at the moment. Let me restore a database backup to the state it was in before and see what I can do.

@zevlag commented on GitHub (Jun 9, 2017): ::sigh:: I can't reproduce it at the moment. Let me restore a database backup to the state it was in before and see what I can do.
Author
Owner

@jeremystretch commented on GitHub (Jun 10, 2017):

@zevlag Maybe you installed a half-depth device and then changed its device type to be full-depth? I tried that and it doesn't raise a validation error (something that I might need to fix) but it also didn't generate a server error like you saw.

@jeremystretch commented on GitHub (Jun 10, 2017): @zevlag Maybe you installed a half-depth device and then changed its device type to be full-depth? I tried that and it doesn't raise a validation error (something that I might need to fix) but it also didn't generate a server error like you saw.
Author
Owner

@jeremystretch commented on GitHub (Jun 12, 2017):

Closing this out for now as we haven't been able to replicate the behavior. It may still be around, though.

@jeremystretch commented on GitHub (Jun 12, 2017): Closing this out for now as we haven't been able to replicate the behavior. It may still be around, though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1013