Skip to content

Improve handling of faulty reports #12842

@candlerb

Description

@candlerb

NetBox version

v3.5.3

Python version

3.8

Steps to Reproduce

  1. Create a file has a python syntax error in it
  2. Upload it as a 'report'
  3. Now browse to /extras/reports/

Expected Behavior

The invalid report to be shown as such, and to be able at least to delete it via the GUI.

Note, however, if this were to hide the error message, it would then become very difficult to debug. See #12766 for the behaviour of Custom Scripts.

Observed Behavior

A Server Error is generated. Unfortunately, this then means it's impossible to delete the report via the web interface, as you can't even get a list of reports. Furthermore, if you simply rm the file from the reports directory, you get another Server Error ("File Not Found"). See #12841 for example.

Workaround

At the CLI:

cd /opt/netbox/netbox/reports
mv broken_report.py broken_report.py.xxx
touch broken_report.py

A zero-byte report is considered valid, and then can be deleted from within the GUI.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: 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