Removed Model can cause dashboard to crash #9968

Closed
opened 2025-12-29 21:25:03 +01:00 by adam · 0 comments
Owner

Originally created by @arthanson on GitHub (Jul 10, 2024).

Originally assigned to: @arthanson on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.0.7

Python Version

3.10

Steps to Reproduce

Create a widget to a model (potentially plugin) on the dashboard
remove the model

In my case it was through development and having a widget to an object in a future PR.

Expected Behavior

The dashboard should still appear but the widget should not be rendered

Observed Behavior

NetBox crashes:

  File "/Users/arthurhanson/dev/work/netbox/netbox/extras/templatetags/dashboard.py", line 11, in render_widget
    return widget.render(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/netbox/extras/dashboard/widgets.py", line 256, in render
    viewname = get_viewname(model, action='list')
               ^^^^^^^^^^^^
  File "/Users/arthurhanson/.pyenv/versions/3.11.9/lib/python3.11/bdb.py", line 90, in trace_dispatch
    return self.dispatch_line(frame)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/pudb/debugger.py", line 226, in dispatch_line
    raise bdb.BdbQuit
Originally created by @arthanson on GitHub (Jul 10, 2024). Originally assigned to: @arthanson on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.0.7 ### Python Version 3.10 ### Steps to Reproduce Create a widget to a model (potentially plugin) on the dashboard remove the model In my case it was through development and having a widget to an object in a future PR. ### Expected Behavior The dashboard should still appear but the widget should not be rendered ### Observed Behavior NetBox crashes: ``` File "/Users/arthurhanson/dev/work/netbox/netbox/extras/templatetags/dashboard.py", line 11, in render_widget return widget.render(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/netbox/extras/dashboard/widgets.py", line 256, in render viewname = get_viewname(model, action='list') ^^^^^^^^^^^^ File "/Users/arthurhanson/.pyenv/versions/3.11.9/lib/python3.11/bdb.py", line 90, in trace_dispatch return self.dispatch_line(frame) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/arthurhanson/dev/work/netbox/venv/lib/python3.11/site-packages/pudb/debugger.py", line 226, in dispatch_line raise bdb.BdbQuit ```
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:25:03 +01:00
adam closed this issue 2025-12-29 21:25:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9968