Netbox: Improve error reporting on cable CSV import when termination does not exist

Created on 29 Jun 2019  路  3Comments  路  Source: netbox-community/netbox

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

bug

Most helpful comment

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

All 3 comments

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.

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.

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
Was this page helpful?
0 / 5 - 0 ratings

Related issues

hoalex picture hoalex  路  3Comments

markve-sa picture markve-sa  路  4Comments

markve-sa picture markve-sa  路  4Comments

Ali-Yazdani picture Ali-Yazdani  路  3Comments

robbagithub picture robbagithub  路  3Comments