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

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

Closed
kkthxbye-code opened this issue Mar 30, 2023 · 5 comments
Assignees
Labels
beta Concerns a bug/feature in a beta release status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@kkthxbye-code
Copy link
Contributor

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'

@kkthxbye-code kkthxbye-code added type: bug A confirmed report of unexpected behavior in the application beta Concerns a bug/feature in a beta release labels Mar 30, 2023
@abhi1693
Copy link
Member

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

@kkthxbye-code
Copy link
Contributor Author

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

@abhi1693
Copy link
Member

abhi1693 commented 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

@kkthxbye-code
Copy link
Contributor Author

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?

@jeremystretch
Copy link
Member

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 jeremystretch self-assigned this Mar 31, 2023
@jeremystretch jeremystretch added the status: accepted This issue has been accepted for implementation label Mar 31, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beta Concerns a bug/feature in a beta release status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants