Skip to content

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

@ITJamie

Description

@ITJamie

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
  ``

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions