Custom scripts UI throws a <class 'OSError'> exception when scripts are renamed #2934

Closed
opened 2025-12-29 18:23:43 +01:00 by adam · 1 comment
Owner

Originally created by @benjy44 on GitHub (Oct 8, 2019).

Environment

  • Python version: 3.5.2
  • NetBox version: 2.6.5

Steps to Reproduce

  1. Create a custom script class called MyClass(Script):
  2. Rename it to MyNewClass(Script):
  3. Refresh the /extras/scripts/ page will throw a <class 'OSError'> exception
  4. If I rename back the class to MyClass(Script), the scripts page may load but randomly will throw the same error

Expected Behavior

The scripts page loads normally

Observed Behavior

Exception thrown:
image

Apologies if this has been reported already, I didn't find a similar bug report.

Originally created by @benjy44 on GitHub (Oct 8, 2019). <!-- NOTE: This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.5.2 * NetBox version: 2.6.5 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> ### Steps to Reproduce 1. Create a custom script class called MyClass(Script): 2. Rename it to MyNewClass(Script): 3. Refresh the /extras/scripts/ page will throw a <class 'OSError'> exception 4. If I rename back the class to MyClass(Script), the scripts page may load but randomly will throw the same error <!-- What did you expect to happen? --> ### Expected Behavior The scripts page loads normally <!-- What happened instead? --> ### Observed Behavior Exception thrown: ![image](https://user-images.githubusercontent.com/47328447/66390526-2468ed80-e9cb-11e9-83e3-f983d8bd5954.png) Apologies if this has been reported already, I didn't find a similar bug report.
adam closed this issue 2025-12-29 18:23:43 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 8, 2019):

You'll need to either manually restart the WSGI process (e.g. gunicorn or uWSGI) whenever you make a change, or configure it to reload automatically when it detects a file change. See the discussion in #1590.

@jeremystretch commented on GitHub (Oct 8, 2019): You'll need to either manually restart the WSGI process (e.g. gunicorn or uWSGI) whenever you make a change, or configure it to reload automatically when it detects a file change. See the discussion in #1590.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2934