Custom scripts upload via remote data source on RO netbox deployment #9360

Closed
opened 2025-12-29 20:48:58 +01:00 by adam · 1 comment
Owner

Originally created by @simasm99 on GitHub (Mar 15, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.7.3

Python Version

3.11

Steps to Reproduce

  1. Create/upload any custom script (e.g. the example script from documentation)
  2. Add it to /opt/netbox/netbox/scripts path
  3. Create new data source in netbox with mentioned script path and sync it
  4. Go to Customization -> Scripts -> Add, Select data source and select new script and press Create
    image
  5. Receive an error "Insufficient write permission to the media root"
    image

We are running our Netbox deployment in Kubernetes pods with Read-Only permissions:

root@netbox-app-common-deployment-b7xq5:/opt/netbox/netbox/scripts# ls -la
<------>
-rw-rw-r-- 1 root root 3955 Mar 12 08:51 netbox_provisioning.py

Expected Behavior

To add new custom script to Netbox.

We do not have a possibility to make pods with RW permissions, that being said, we assume that if we are using local data_source and after syncing it with local scripts directory inside netbox itself, we should be able to add the custom script to Netbox without the need of RW permissions to (assumingly add new entry of custom script to DB so we can see it in Netbox), but for some reason it still needs RW permissions?

Observed Behavior

Errors can be seen on "Steps to Reproduce" part.

We have also been using Netbox before this v3.5 change which added data sources feature.

Before that we were just updating /scripts directory and releasing new image deployments. And it still works like that with added scripts before v3.5 as we are able to update scripts and release new deployment of Netbox with reflected script changes.

But we wanted to add a new script, added in script path and have encountered this problem where we don't see it in Netbox. We then have tried using data_source feature in local path, to add it through GUI, but encountered this problem

Keep note that permissions on the older scripts are the same as in this new one, as whole pod is read-only

Originally created by @simasm99 on GitHub (Mar 15, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.7.3 ### Python Version 3.11 ### Steps to Reproduce 1. Create/upload any custom script (e.g. the example script from documentation) 2. Add it to /opt/netbox/netbox/scripts path 3. Create new data source in netbox with mentioned script path and sync it 4. Go to Customization -> Scripts -> Add, Select data source and select new script and press Create ![image](https://github.com/netbox-community/netbox/assets/70639456/f2aac159-db6b-451b-98e2-482ab4a2af90) 5. Receive an error "Insufficient write permission to the media root" ![image](https://github.com/netbox-community/netbox/assets/70639456/22b548b2-0321-4e1e-97cb-df7a578da128) We are running our Netbox deployment in Kubernetes pods with Read-Only permissions: ``` root@netbox-app-common-deployment-b7xq5:/opt/netbox/netbox/scripts# ls -la <------> -rw-rw-r-- 1 root root 3955 Mar 12 08:51 netbox_provisioning.py ``` ### Expected Behavior To add new custom script to Netbox. We do not have a possibility to make pods with RW permissions, that being said, we assume that if we are using local data_source and after syncing it with local scripts directory inside netbox itself, we should be able to add the custom script to Netbox without the need of RW permissions to (assumingly add new entry of custom script to DB so we can see it in Netbox), but for some reason it still needs RW permissions? ### Observed Behavior Errors can be seen on "Steps to Reproduce" part. We have also been using Netbox before this v3.5 change which added data sources feature. Before that we were just updating /scripts directory and releasing new image deployments. And it still works like that with added scripts before v3.5 as we are able to update scripts and release new deployment of Netbox with reflected script changes. But we wanted to add a new script, added in script path and have encountered this problem where we don't see it in Netbox. We then have tried using data_source feature in local path, to add it through GUI, but encountered this problem Keep note that permissions on the older scripts are the same as in this new one, as whole pod is read-only
adam closed this issue 2025-12-29 20:48:58 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 15, 2024):

What you're attempting to do is not supported. The local scripts path must be writable; this is where the script files are stored, even when synced from a remote source. You will need to mount a writable file path to your containers.

@jeremystretch commented on GitHub (Mar 15, 2024): What you're attempting to do is not supported. The local scripts path must be writable; this is where the script files are stored, even when synced from a remote source. You will need to mount a writable file path to your containers.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9360