Improve error reporting on cable CSV import when termination does not exist #2711

Closed
opened 2025-12-29 18:21:16 +01:00 by adam · 3 comments
Owner

Originally created by @candlerb on GitHub (Jun 29, 2019).

Environment

  • Python version: 3.5.2
  • NetBox version: 2.6.1

Proposed Functionality

At the moment, if you are doing a CSV import of cables and you make any error in any row specifying a non-existent interface/port, you get the following generic error:

image

I would like this to show either the device+port combination which could not be found, or the line number in the CSV with the error.

Use Case

Bulk creation of cables via CSV, when there are too many to do one by one in the UI.

Workaround: do a binary chop - paste the first half of the CSV, if it fails past the first quarter etc.

Database Changes

None

External Dependencies

None

Originally created by @candlerb on GitHub (Jun 29, 2019). ### Environment * Python version: 3.5.2 * NetBox version: 2.6.1 ### Proposed Functionality At the moment, if you are doing a CSV import of cables and you make any error in any row specifying a non-existent interface/port, you get the following generic error: ![image](https://user-images.githubusercontent.com/44789/60385396-a074a080-9a80-11e9-817b-ae6538ce80ee.png) I would like this to show either the device+port combination which could not be found, or the line number in the CSV with the error. ### Use Case Bulk creation of cables via CSV, when there are too many to do one by one in the UI. Workaround: do a binary chop - paste the first half of the CSV, if it fails past the first quarter etc. ### Database Changes None ### External Dependencies None
adam added the type: bug label 2025-12-29 18:21:16 +01:00
adam closed this issue 2025-12-29 18:21:16 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 9, 2019):

I've run into this in the past, however I'm not able to replicate it on the current develop branch (v2.6.7). It's likely been resolved by other work. Going to close this out. If anyone does come across this in the future, please open a new bug report with specific steps that will reproduce the bug.

@jeremystretch commented on GitHub (Dec 9, 2019): I've run into this in the past, however I'm not able to replicate it on the current `develop` branch (v2.6.7). It's likely been resolved by other work. Going to close this out. If anyone does come across this in the future, please open a _new_ bug report with specific steps that will reproduce the bug.
Author
Owner

@candlerb commented on GitHub (Dec 9, 2019):

It is very easy to reproduce in v2.6.7 (released version).

  1. Pick any two devices; here I'm using "nuc1" and "nuc2"
  2. Go to the CSV cables import page /dcim/cables/import/. Paste the following:
side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name
nuc1,interface,BLAH,nuc2,interface,BLAH

where BLAH is intentionally a non-existent interface name.

Result:

image

UPDATE: maybe was fixed by 1d189483 ("Fixes #3709: Prevent exception when importing an invalid cable definition") which was committed after the release.

@candlerb commented on GitHub (Dec 9, 2019): It is very easy to reproduce in v2.6.7 (released version). 1. Pick any two devices; here I'm using "nuc1" and "nuc2" 2. Go to the CSV cables import page `/dcim/cables/import/`. Paste the following: ``` side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name nuc1,interface,BLAH,nuc2,interface,BLAH ``` where BLAH is intentionally a non-existent interface name. Result: ![image](https://user-images.githubusercontent.com/44789/70467576-655dab00-1abd-11ea-8ecd-8a4f5cb1dbf6.png) UPDATE: maybe was fixed by 1d189483 ("Fixes #3709: Prevent exception when importing an invalid cable definition") which was committed after the release.
Author
Owner

@candlerb commented on GitHub (Dec 10, 2019):

Confirm this is fixed in v2.6.8. Error message now shows:

Row 1 side_a_name: A side termination not found: nuc1 BLAH
Row 1 side_b_name: B side termination not found: nuc2 BLAH
Row 1 __all__: Termination A type has not been specified
@candlerb commented on GitHub (Dec 10, 2019): Confirm this is fixed in v2.6.8. Error message now shows: ``` Row 1 side_a_name: A side termination not found: nuc1 BLAH Row 1 side_b_name: B side termination not found: nuc2 BLAH Row 1 __all__: Termination A type has not been specified ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2711