attempting to add a script from a datasource that already exists throws a server error #8811

Closed
opened 2025-12-29 20:41:33 +01:00 by adam · 0 comments
Owner

Originally created by @ITJamie on GitHub (Nov 6, 2023).

Originally assigned to: @abhi1693 on GitHub.

NetBox version

v3.6.4

Python version

3.11

Steps to Reproduce

1: create a datasource (eg local) with a script file in it
2: add the script (extras/scripts/add/)
3: attempt to add the same script again

Expected Behavior

a validation error should show up (or the file should not be available in the dropdown list as its already been added)

Observed Behavior

django server error is thrown

<class 'django.db.utils.IntegrityError'>

duplicate key value violates unique constraint "core_managedfile_unique_root_path"
DETAIL:  Key (file_root, file_path)=(scripts, ip_grabber.py) already exists.

Python version: 3.11.4
NetBox version: 3.6.4
Plugins: 
  netbox_circuitmaintenance: 0.3.0
  netbox_gateways: 0.4.3
  ``
Originally created by @ITJamie on GitHub (Nov 6, 2023). Originally assigned to: @abhi1693 on GitHub. ### NetBox version v3.6.4 ### Python version 3.11 ### Steps to Reproduce 1: create a datasource (eg local) with a script file in it 2: add the script (extras/scripts/add/) 3: attempt to add the same script again ### Expected Behavior a validation error should show up (or the file should not be available in the dropdown list as its already been added) ### Observed Behavior django server error is thrown ``` <class 'django.db.utils.IntegrityError'> duplicate key value violates unique constraint "core_managedfile_unique_root_path" DETAIL: Key (file_root, file_path)=(scripts, ip_grabber.py) already exists. Python version: 3.11.4 NetBox version: 3.6.4 Plugins: netbox_circuitmaintenance: 0.3.0 netbox_gateways: 0.4.3 ``
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:41:33 +01:00
adam closed this issue 2025-12-29 20:41:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8811