Second custom script does not show in GUI after having deleted first custom script #22019
Replies: 5 comments 5 replies
-
|
That's a bit weird. Usually this just works for me (deleting and uploading a script). Maybe somehow the script is still on the NetBox VM? Can you SSH into that VM and try to find if that script still exists? Also, please have a look at this docs here: https://netboxlabs.com/blog/getting-started-with-netbox-custom-scripts/ |
Beta Was this translation helpful? Give feedback.
-
|
Both docker containers netbox-docker-netbox-1 and netbox-docker-netbox-worker-1 say that no custom script exists (besides init.py): netbox@f42ed9e8804c:/opt/netbox/netbox/scripts$ ls -l I get the same error when I attempt the script upload with CURL: [ |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Sorry you’re running into trouble with the custom script upload. Based on what you described, this looks very similar to a known issue where a custom script can be registered in the database even though it no longer appears in the UI afterward: That issue is currently targeted for v4.5.9, so this behavior should be addressed in that release. For the affected instance, you will probably need to remove the stale custom script / managed file entry from the database manually before you can upload the corrected script again. Please make sure you have a current database backup before making any manual changes, and only remove the entry that corresponds to the uploaded script. It may also be worth checking whether the script file still exists in the container or VM storage path used for custom scripts. If it does, removing that stale file after cleaning up the database entry should allow you to upload the script again. Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
|
pheus |
Beta Was this translation helpful? Give feedback.
-
|
Upgraded to docker netbox 4.5.9. Now I can upload/delete custom script, and I can have two custom scripts active at the same time. So issue solved from my point of view: |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I upload and execute Custom script new_site_r10.py in the GUI, everythings work. I then in the GUI delete new_site_r10.py and hereafter attempt to upload a new version of this script new_site_r12.py. The upload succeeds according to message at the bottom right corner, but no custom script is shown in the GUI. When I attempt to upload new_site_r12.py again I get the error message, that this script is already in the Netbox (and as just described, no custom script is shown in the GUI).
I am working a fresh Ubuntu 24.04 VM, 4 vCPU, 4 GB RAM. Nothing but Netbox is installed on this server. I have installed Netbox 4.8.5-docker 4.0.2 docker container according to the guide in https://www.packetswitch.co.uk/how-to-install-netbox-on-docker/. I have 4 device role definitions and nothihg else on the Netbox. I have done the installation of above twice with the same result.
I have uploaded screenshot of the error,
I have attempted to use Github git synchronization, but could not make that work. For now I go with the manual upload of new Custom scripts, and leave the git synchronization for a separate discsssion.
netbox_custom_script_upload_fails_screenshot.pdf
Beta Was this translation helpful? Give feedback.
All reactions