Reload report code without restarting server #1304

Closed
opened 2025-12-29 16:31:15 +01:00 by adam · 7 comments
Owner

Originally created by @candlerb on GitHub (Oct 13, 2017).

Issue type

[X] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.2
  • NetBox version: 2.2.1

Description

  • You run a report from the web UI
  • There's a bug in the python code (e.g. self.log_fail instead of self.log_failure) which causes an exception, or you just want to change the behaviour
  • You fix the code, and re-test it from the command line (python manage.py runreport <name>)
  • However if you re-run it from the UI, it still fails

At the moment you need to do a full shutdown/restart of netbox. It would be nice if it could pick up that the report file has changed since it was last loaded, and reload it automatically.

Originally created by @candlerb on GitHub (Oct 13, 2017). ### Issue type [X] Feature request <!-- Requesting the implementation of a new feature --> [ ] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> ### Environment * Python version: 3.5.2 * NetBox version: 2.2.1 ### Description * You run a report from the web UI * There's a bug in the python code (e.g. `self.log_fail` instead of `self.log_failure`) which causes an exception, or you just want to change the behaviour * You fix the code, and re-test it from the command line (`python manage.py runreport <name>`) * However if you re-run it from the UI, it still fails At the moment you need to do a full shutdown/restart of netbox. It would be nice if it could pick up that the report file has changed since it was last loaded, and reload it automatically.
adam added the status: acceptedtype: feature labels 2025-12-29 16:31:15 +01:00
adam closed this issue 2025-12-29 16:31:16 +01:00
Author
Owner

@RyanBreaker commented on GitHub (Nov 1, 2017):

@jeremystretch In what way are reports implemented? Is it a from-scratch feature or is it something built upon from a module?

@RyanBreaker commented on GitHub (Nov 1, 2017): @jeremystretch In what way are reports implemented? Is it a from-scratch feature or is it something built upon from a module?
Author
Owner

@Yakelixir commented on GitHub (Mar 29, 2018):

Help still wanted? I have been working on this issue in my own

@Yakelixir commented on GitHub (Mar 29, 2018): Help still wanted? I have been working on this issue in my own
Author
Owner

@sublimestate commented on GitHub (Jun 6, 2018):

I just tested this recently. After fixing a bug that causes the exception, the reports page UI shows a passing result. Can anyone comment on this issue? It seems like it has been resolved.

@sublimestate commented on GitHub (Jun 6, 2018): I just tested this recently. After fixing a bug that causes the exception, the reports page UI shows a passing result. Can anyone comment on this issue? It seems like it has been resolved.
Author
Owner

@zelfix commented on GitHub (Dec 1, 2018):

@jeremystretch It's not an issue of NetBox. Users can use the option "reload" of gunicorn server for auto restarting gunicorn workers when source code changes. http://docs.gunicorn.org/en/19.0/settings.html#reload

@zelfix commented on GitHub (Dec 1, 2018): @jeremystretch It's not an issue of NetBox. Users can use the option "reload" of gunicorn server for auto restarting gunicorn workers when source code changes. http://docs.gunicorn.org/en/19.0/settings.html#reload
Author
Owner

@MarcHagen commented on GitHub (Jan 11, 2019):

Just a small update, running Netbox via docker-compose (ninech/netbox-docker) i can edit report scripts live, not reloading whatsoever.

@MarcHagen commented on GitHub (Jan 11, 2019): Just a small update, running Netbox via docker-compose (ninech/netbox-docker) i can edit report scripts live, not reloading whatsoever.
Author
Owner

@candlerb commented on GitHub (Jan 11, 2019):

Yes, I can confirm the behaviour is correct now - tested with v2.5.2. I can break a report, run it in UI (get exception), fix it, run it in UI (and it works), without any restarts.

Maybe the fix happened in Netbox, maybe in Django.

@candlerb commented on GitHub (Jan 11, 2019): Yes, I can confirm the behaviour is correct now - tested with v2.5.2. I can break a report, run it in UI (get exception), fix it, run it in UI (and it works), without any restarts. Maybe the fix happened in Netbox, maybe in Django.
Author
Owner

@DanSheps commented on GitHub (Jan 11, 2019):

I don't think this should be closed out yet. gunicorn is not the only way to establish the workers. For example mod_wsgi with Apache or uWSGI.

I will let @jeremystretch weigh in though perhaps.

@DanSheps commented on GitHub (Jan 11, 2019): I don't think this should be closed out yet. gunicorn is not the only way to establish the workers. For example mod_wsgi with Apache or uWSGI. I will let @jeremystretch weigh in though perhaps.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1304