Resizing a widget to the be the smallest possible width or height will cause the dashboard to throw an exception. #7816

Closed
opened 2025-12-29 20:28:36 +01:00 by adam · 5 comments
Owner

Originally created by @kkthxbye-code on GitHub (Mar 30, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.5.0-beta1

Python version

3.10

Steps to Reproduce

  1. Resize any widget and make it as small as possible
  2. Save

Expected Behavior

Save without issue.

Observed Behavior

The dashboard throws an exception:

Internal Server Error: /
Traceback (most recent call last):
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 56, in innerers/exception.py", line 56, in inner
response = get_response(request)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_responseers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)rgs)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 103, in viewric/base.py", line 103, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 142, in dispatchric/base.py", line 142, in dispatch
return handler(request, *args, **kwargs)
File "/opt/netbox/netbox/netbox/views/misc.py", line 36, in get
dashboard = get_dashboard(request.user).get_layout()
File "/opt/netbox/netbox/extras/models/dashboard.py", line 43, in get_layout_layout
widget.set_layout(grid_item)
File "/opt/netbox/netbox/extras/dashboard/widgets.py", line 61, in set_layoutt_layout
self.width = grid_item['w']
KeyError: 'w'

Originally created by @kkthxbye-code on GitHub (Mar 30, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.5.0-beta1 ### Python version 3.10 ### Steps to Reproduce 1. Resize any widget and make it as small as possible 2. Save ### Expected Behavior Save without issue. ### Observed Behavior The dashboard throws an exception: Internal Server Error: / Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 56, in innerers/exception.py", line 56, in inner response = get_response(request) File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_responseers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs)rgs) File "/opt/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 103, in viewric/base.py", line 103, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 142, in dispatchric/base.py", line 142, in dispatch return handler(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/views/misc.py", line 36, in get dashboard = get_dashboard(request.user).get_layout() File "/opt/netbox/netbox/extras/models/dashboard.py", line 43, in get_layout_layout widget.set_layout(grid_item) File "/opt/netbox/netbox/extras/dashboard/widgets.py", line 61, in set_layoutt_layout self.width = grid_item['w'] KeyError: 'w'
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 20:28:36 +01:00
adam closed this issue 2025-12-29 20:28:36 +01:00
Author
Owner

@abhi1693 commented on GitHub (Mar 31, 2023):

I removed all widgets, saved the layout and then tried adding a note with simple text and saw the same error

@abhi1693 commented on GitHub (Mar 31, 2023): I removed all widgets, saved the layout and then tried adding a note with simple text and saw the same error
Author
Owner

@kkthxbye-code commented on GitHub (Mar 31, 2023):

I removed all widgets, saved the layout and then tried adding a note with simple text and saw the same error

Just tried on the beta-demo and could not replicate. Please provide proper replication steps if it's actually related to this issue

@kkthxbye-code commented on GitHub (Mar 31, 2023): > I removed all widgets, saved the layout and then tried adding a note with simple text and saw the same error Just tried on the beta-demo and could not replicate. Please provide proper replication steps if it's actually related to this issue
Author
Owner

@abhi1693 commented on GitHub (Mar 31, 2023):

It does not seem to be happening again but if you can pull the logs from your beta VM, you will see the error when I posted the comment

@abhi1693 commented on GitHub (Mar 31, 2023): It does not seem to be happening again but if you can pull the logs from your beta VM, you will see the error when I posted the comment
Author
Owner

@kkthxbye-code commented on GitHub (Mar 31, 2023):

It does not seem to be happening again but if you can pull the logs from your beta VM, you will see the error when I posted the comment

Don't you think a likely explanation is just that another person was using the beta-demo site at the same time and caused the error?

@kkthxbye-code commented on GitHub (Mar 31, 2023): > It does not seem to be happening again but if you can pull the logs from your beta VM, you will see the error when I posted the comment Don't you think a likely explanation is just that another person was using the beta-demo site at the same time and caused the error?
Author
Owner

@jeremystretch commented on GitHub (Mar 31, 2023):

Don't you think a likely explanation is just that another person was using the beta-demo site at the same time and caused the error?

Tangent: We're going to run into this a lot I'm afraid. It's just the nature of using a single admin account for evaluation. You can work around it by creating your own user account for the demo.

Maybe we can implement some form of lightweight registration mechanism for the demo instance to force people to create unique accounts.

@jeremystretch commented on GitHub (Mar 31, 2023): > Don't you think a likely explanation is just that another person was using the beta-demo site at the same time and caused the error? Tangent: We're going to run into this a lot I'm afraid. It's just the nature of using a single admin account for evaluation. You can work around it by creating your own user account for the demo. Maybe we can implement some form of lightweight registration mechanism for the demo instance to force people to create unique accounts.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7816