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

Validation needed when expanding the U height of a device type #466

Closed
LordBoBCUP opened this issue Aug 15, 2016 · 6 comments
Closed

Validation needed when expanding the U height of a device type #466

LordBoBCUP opened this issue Aug 15, 2016 · 6 comments
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@LordBoBCUP
Copy link

I am getting a weird error when trying to view one of the racks I had previously setup. I have recently upgraded to v1.5.2 and when viewing a specific rack for a specific site I am getting an error, traceback below.
Traceback:

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner

  1.         response = get_response(request)
    

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _legacy_get_response

  1.         response = self._get_response(request)
    

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response

  1.             response = self.process_exception_by_middleware(e, request)
    

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response

  1.             response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    

File "/opt/netbox-1.5.1/netbox/dcim/views.py" in rack

  1.     'front_elevation': rack.get_front_elevation(),
    

File "/opt/netbox-1.5.1/netbox/dcim/models.py" in get_front_elevation

  1.     return self.get_rack_units(face=RACK_FACE_FRONT, remove_redundant=True)
    

File "/opt/netbox-1.5.1/netbox/dcim/models.py" in get_rack_units

  1.                 elevation[device.position]['device'] = device
    

Exception Type: KeyError at /dcim/racks/11/
Exception Value: 20

@jeremystretch
Copy link
Member

v1.5.2 hasn't been released yet. Are you running the development branch?

@LordBoBCUP
Copy link
Author

Sorry Jeremy, running v1.5.1 from the master branch. Must have fat fingered it.

@jeremystretch jeremystretch changed the title [Bug?] Error when viewing rack v1.5.2 [Bug?] Error when viewing rack v1.5.1 Aug 16, 2016
@jeremystretch
Copy link
Member

I'm not able to replicate this. Can you provide a list of devices installed in the rack, including their positions/faces and device type heights?

@LordBoBCUP
Copy link
Author

I think I have narrowed it down. I had made a change to a device type, and not viewed that particular rack since making the change. The device I had changed is only in that 1 rack as well which is why I didn't see the error anywhere else. Sadly I have changed a few other things in that rack (positions within the rack) but I think it was because once I had changed it from 1RU to 2RU there was another 1RU device in the second RU spot for the first device if that makes sense.

I have just retested expanding the 1RU device type to 2RU and viewing the rack is fine. However, if you expand a 1RU device type into a 2RU device and on a rack where the next RU is already consumed, you appear to get that error. Perhaps we need some validation when changing the RU of a device type to see all the racks where its used, if the next RU slot is free or not? I know changing the device type post using it isn't recommended, but in this instance, the specs says its 1RU but really, its fatter than 1RU and the second RU slot is not really usable so I wanted to effectively mark it 2RU or at least the second RU occupied to avoid people trying to use it in the future.

@jeremystretch jeremystretch added the type: bug A confirmed report of unexpected behavior in the application label Aug 17, 2016
@jeremystretch jeremystretch changed the title [Bug?] Error when viewing rack v1.5.1 Validation needed when expanding the U height of a device type Sep 12, 2016
@puck
Copy link

puck commented Sep 12, 2016

I've hit this as well - took a while for me track down the device which caused the issue!

@puck
Copy link

puck commented Sep 12, 2016

Actually, doing the validation when the device type might be time consuming depending on how many racks the device type is present in. Perhaps the display of the rack should catch that error and show an error for the U space involved?

if-fi pushed a commit to if-fi/netbox that referenced this issue Oct 1, 2016
…tances when increasing the U height of a device type
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants