Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ITJamie opened this issue Nov 6, 2023 · 0 comments · Fixed by #14232
Closed
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@ITJamie
Copy link
Contributor

ITJamie commented Nov 6, 2023

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
  ``
@ITJamie ITJamie added the type: bug A confirmed report of unexpected behavior in the application label Nov 6, 2023
@abhi1693 abhi1693 added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: low Does not significantly disrupt application functionality, or a workaround is available labels Nov 6, 2023
@abhi1693 abhi1693 self-assigned this Nov 9, 2023
@abhi1693 abhi1693 added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Nov 9, 2023
abhi1693 added a commit that referenced this issue Nov 9, 2023
jeremystretch pushed a commit that referenced this issue Nov 29, 2023
* raises validation error if file path and root are not unique #14187

* review changes #14187
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants