Improve handling of faulty reports #8174

Closed
opened 2025-12-29 20:33:27 +01:00 by adam · 0 comments
Owner

Originally created by @candlerb on GitHub (Jun 8, 2023).

Originally assigned to: @abhi1693 on GitHub.

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.

Originally created by @candlerb on GitHub (Jun 8, 2023). Originally assigned to: @abhi1693 on GitHub. ### 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.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:33:27 +01:00
adam closed this issue 2025-12-29 20:33:27 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8174