Skip to content

Removed Model can cause dashboard to crash #16867

Closed
@arthanson

Description

@arthanson

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

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions