-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Deployment Type
Self-hosted
NetBox Version
v4.3.1
Python Version
3.10
Steps to Reproduce
- Install Netbox 4.3.1, following the instructions to use a symlinked path
/opt/netbox - Create a custom script from the
/extras/scripts/addwebpage - Run the script
Expected Behavior
it should work
Observed Behavior
Script fails with no error message shown.
When you enable debug level logging for netbox.data_backends it shows this:
netbox.data_backends[9596]: Failed to load script: connect_power error: The joined path (/opt/netbox/netbox/scripts/connect_power.py) is located outside of the base path component (/opt/netbox-4.3.1/netbox/scripts)
I first saw this issue on my prod Netbox after upgrading to 4.3.1 and creating a new script. All my old scripts still work fine. I reproduced the issue on a fresh install. In this case, I didn't customize anything, just used all the defaults, including the recommendation for symlinking /opt/netbox.
Here is the difference between the new broken script and an older, working script on my prod instance:
netbox=> SELECT id,data_path,file_path,data_file_id,data_source_id,auto_sync_enabled FROM core_managedfile ORDER BY CREATED DESC LIMIT 2;
id | data_path | file_path | data_file_id | data_source_id | auto_sync_enabled
-----+------------------------------------+---------------------------------------------+--------------+----------------+-------------------
208 | | /opt/netbox/netbox/scripts/connect_power.py | | | f
206 | scripts/import_terrier_mactable.py | import_terrier_mactable.py | 7727 | 35 | t
