Error message is misleading when the report is missing in the worker #3995

Closed
opened 2025-12-29 18:32:31 +01:00 by adam · 6 comments
Owner

Originally created by @dgarros on GitHub (Aug 18, 2020).

Environment

  • Python version: 3.7.7
  • NetBox version: 2.9-beta2

Steps to Reproduce

  1. Create a simple report
  2. Copy the report to the NetBox instance but NOT to the worker instance
  3. Execute the report from the UI

Expected Behavior

If the report is not present in the worker it would be great to have a clear error message that indicate that the reports is not there. Something like

Unable to run this report from XXX (name of the worker), please check if this report is present.

Observed Behavior

In the UI, the error message is reporting Error during report execution
In the worker, the error message is 'NoneType' object has no attribute 'run'

Originally created by @dgarros on GitHub (Aug 18, 2020). ### Environment * Python version: 3.7.7 * NetBox version: 2.9-beta2 ### Steps to Reproduce 1. Create a simple report 2. Copy the report to the NetBox instance but NOT to the worker instance 3. Execute the report from the UI ### Expected Behavior If the report is not present in the worker it would be great to have a clear error message that indicate that the reports is not there. Something like ``` Unable to run this report from XXX (name of the worker), please check if this report is present. ``` ### Observed Behavior In the UI, the error message is reporting `Error during report execution` In the worker, the error message is `'NoneType' object has no attribute 'run'`
adam added the type: featurestatus: needs ownerpending closure labels 2025-12-29 18:32:31 +01:00
adam closed this issue 2025-12-29 18:32:31 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 18, 2020):

  1. Copy the report to the NetBox instance but NOT to the worker instance

This seems to be glossing over a much larger issue. The WSGI and RQ worker processes must always run with the same code base (whether that's by referencing the same filesystem or via other means of synchronization). If they don't, a missing script is not even the most concerning failure, because that at least results in an immediate and largely benign failure. The much more dangerous scenario is the RQ worker unknowingly running an outdated version of a script (using input data intended for the current version), risking a potentially disastrous outcome.

IMO this is a bit outside NetBox's realm of control. It might be possible to validate scripts by hashing the Python class at queue time and then evaluating it against the loaded class at execution time, but I don't know what level of effort that would entail.

@jeremystretch commented on GitHub (Aug 18, 2020): > 2. Copy the report to the NetBox instance but NOT to the worker instance This seems to be glossing over a much larger issue. The WSGI and RQ worker processes must always run with the same code base (whether that's by referencing the same filesystem or via other means of synchronization). If they don't, a _missing_ script is not even the most concerning failure, because that at least results in an immediate and largely benign failure. The much more dangerous scenario is the RQ worker unknowingly running an _outdated_ version of a script (using input data intended for the current version), risking a potentially disastrous outcome. IMO this is a bit outside NetBox's realm of control. It might be possible to validate scripts by hashing the Python class at queue time and then evaluating it against the loaded class at execution time, but I don't know what level of effort that would entail.
Author
Owner

@dgarros commented on GitHub (Aug 20, 2020):

Based on my experience dealing with the onboarding plugin, some users are not aware of the worker and they either don't have it running or don't restart it when they are upgrading NetBox by default.

Without going as far as validating the hash of the scripts/reports, I think anything that can be done to provide more information if the system is not in the expected state would go a long way and will reduce the number of questions.

@dgarros commented on GitHub (Aug 20, 2020): Based on my experience dealing with the onboarding plugin, some users are not aware of the worker and they either don't have it running or don't restart it when they are upgrading NetBox by default. Without going as far as validating the hash of the scripts/reports, I think anything that can be done to provide more information if the system is not in the expected state would go a long way and will reduce the number of questions.
Author
Owner

@jeremystretch commented on GitHub (Aug 20, 2020):

You could argue (in a separate issue) that the documentation could use improvements in specific areas, and indeed the whole lot has been refreshed for the upcoming v2.9 release. But ultimately the burden of understanding all components of a NetBox implementation, as with any application, falls to the administrator.

@jeremystretch commented on GitHub (Aug 20, 2020): You could argue (in a separate issue) that the documentation could use improvements in specific areas, and indeed the whole lot has been refreshed for the upcoming v2.9 release. But ultimately the burden of understanding all components of a NetBox implementation, as with any application, falls to the administrator.
Author
Owner

@jeremystretch commented on GitHub (Sep 29, 2020):

Seems like the scope of this issue is limited to conveying a more detailed error message. Should be a good candidate for volunteers.

@jeremystretch commented on GitHub (Sep 29, 2020): Seems like the scope of this issue is limited to conveying a more detailed error message. Should be a good candidate for volunteers.
Author
Owner

@stale[bot] commented on GitHub (Nov 13, 2020):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale[bot] commented on GitHub (Nov 13, 2020): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@stale[bot] commented on GitHub (Nov 28, 2020):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@stale[bot] commented on GitHub (Nov 28, 2020): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3995