2.5.1 Import of Cables from CSV looks for data not required, when added unsupported header errors are shown. #2213

Closed
opened 2025-12-29 17:23:40 +01:00 by adam · 1 comment
Owner

Originally created by @ChrisWilkins82 on GitHub (Dec 14, 2018).

Environment

  • Python version: 3.6.5
  • NetBox version: 2.5.1
  • Host OS: Ubuntu 16.4

This looks to still be an issue in the released version of 2.5.1. When I attempt to import cables from a CSV using the default required values, I'm asked for a termination type for the A or B side of the connection (termination_a_type, termination_b_type) These are not indicated as valid values in the import screen.

If I add these as additional headers, then I get another error for having an unsupported header in the dataset. Everything else is working perfectly, all other Netbox import/export functions are working perfectly.

This seems to be related to #2543 - The cable data I can export does not match the data asked for when attempting to import.

Steps to Reproduce

Attempt to import cables using data from a CSV, All tested datasets are copied below:

Data used for import using required values only:

side_a_device side_a_type side_a_name side_b_device side_b_type side_b_name label
pes01awsccc interface Gi1/0/8 SESO1-NC1 interface CIMC CKT2-8474
pes01awsccc interface Gi1/0/7 SESO1-NC2 interface CIMC CKT2-8473
per01awsccc interface Te0/0/0/0 SESO1-NC1 interface PCIe1 - A CKT2-8449
per02awsccc interface Te0/0/0/0 SESO1-NC1 interface PCIe2 - A CKT2-8447
per01awsccc interface Te0/0/0/1 SESO1-NC2 interface PCIe1 - A CKT2-8558
per02awsccc interface Te0/0/0/1 SESO1-NC2 interface PCIe2 - A CKT2-8556
per01awsccc interface Te0/0/0/2 SESO1-NU1 interface PCIe1 - A CKT2-8554
per02awsccc interface Te0/0/0/2 SESO1-NU1 interface PCIe2 - A CKT2-8552
per01awsccc interface Te0/0/0/3 SESO1-NU2 interface PCIe1 - A CKT2-8448
per02awsccc interface Te0/0/0/3 SESO1-NU2 interface PCIe2 - A CKT2-8446
per01awsccc interface Te0/0/0/4 SESO1-NU3 interface PCIe1 - A CKT2-8544
per02awsccc interface Te0/0/0/4 SESO1-NU3 interface PCIe2 - A CKT2-8546
per01awsccc interface Te0/0/0/5 SESO1-NSO1 interface PCIe1 - A CKT2-8547
per02awsccc interface Te0/0/0/5 SESO1-NSO1 interface PCIe2 - A CKT2-8545
per01awsccc interface Te0/0/0/6 SESO1-NC3 interface PCIe1 - A CKT2-8543
per02awsccc interface Te0/0/0/6 SESO1-NC3 interface PCIe1 - D CKT2-8542
per01awsccc interface Te0/0/0/7 SESO1-M5 interface PCIe1 - A CKT2-8450
per02awsccc interface Te0/0/0/7 SESO1-M5 interface PCIe2 - A CKT2-8452

Dataset with termination_b_type added:

side_a_device side_a_type side_a_name side_b_device side_b_type side_b_name label termination_b_type
pes01awsccc interface Gi1/0/8 SESO1-NC1 interface CIMC CKT2-8474 dcim.interface
pes01awsccc interface Gi1/0/7 SESO1-NC2 interface CIMC CKT2-8473 dcim.interface
per01awsccc interface Te0/0/0/0 SESO1-NC1 interface PCIe1 - A CKT2-8449 dcim.interface
per02awsccc interface Te0/0/0/0 SESO1-NC1 interface PCIe2 - A CKT2-8447 dcim.interface
per01awsccc interface Te0/0/0/1 SESO1-NC2 interface PCIe1 - A CKT2-8558 dcim.interface
per02awsccc interface Te0/0/0/1 SESO1-NC2 interface PCIe2 - A CKT2-8556 dcim.interface
per01awsccc interface Te0/0/0/2 SESO1-NU1 interface PCIe1 - A CKT2-8554 dcim.interface
per02awsccc interface Te0/0/0/2 SESO1-NU1 interface PCIe2 - A CKT2-8552 dcim.interface
per01awsccc interface Te0/0/0/3 SESO1-NU2 interface PCIe1 - A CKT2-8448 dcim.interface
per02awsccc interface Te0/0/0/3 SESO1-NU2 interface PCIe2 - A CKT2-8446 dcim.interface
per01awsccc interface Te0/0/0/4 SESO1-NU3 interface PCIe1 - A CKT2-8544 dcim.interface
per02awsccc interface Te0/0/0/4 SESO1-NU3 interface PCIe2 - A CKT2-8546 dcim.interface
per01awsccc interface Te0/0/0/5 SESO1-NSO1 interface PCIe1 - A CKT2-8547 dcim.interface
per02awsccc interface Te0/0/0/5 SESO1-NSO1 interface PCIe2 - A CKT2-8545 dcim.interface
per01awsccc interface Te0/0/0/6 SESO1-NC3 interface PCIe1 - A CKT2-8543 dcim.interface
per02awsccc interface Te0/0/0/6 SESO1-NC3 interface PCIe1 - D CKT2-8542 dcim.interface
per01awsccc interface Te0/0/0/7 SESO1-M5 interface PCIe1 - A CKT2-8450 dcim.interface
per02awsccc interface Te0/0/0/7 SESO1-M5 interface PCIe2 - A CKT2-8452 dcim.interface

Cables to be imported into Netbox using the listed headers, and for the export of said data to match the import values.

Multiple different error messages are thrown for missing headers, on unsupported headers. Screen shots of each error case using the test datasets above are shown:

Cables Import Field, listing the required values with potential sample data:

image

Error message displayed when you attempt to import data using only the required values dataset:

image

Error message displayed after adding termination_b_type, using the 2nd dataset listed above.

image

Exported data set from cables that were manually created. This does not match what's being asked for if you attempt to import data

termination_a_type termination_a_id termination_b_type termination_b_id type status label color length length_unit
dcim.consoleport 1 dcim.consoleserverport 1   Connected        
dcim.powerport 3 dcim.poweroutlet 1   Connected        
dcim.interface 6 dcim.interface 5   Connected        
dcim.interface 10 dcim.interface 11   Connected        
dcim.interface 168 dcim.interface 121   Connected        
dcim.interface 169 dcim.interface 165   Connected        
dcim.interface 170 dcim.interface 162   Connected        
dcim.interface 171 dcim.interface 159   Connected        
dcim.interface 622 dcim.interface 634   Connected        
dcim.interface 5847 dcim.interface 5841 CAT6 Connected CKT2-8467 2196f3    
dcim.interface 5848 dcim.interface 5839 CAT6 Connected CKT2-8468 2196f3    
dcim.interface 5849 dcim.interface 5840 CAT6 Connected CKT2-8469 2196f3    
dcim.interface 5850 dcim.interface 5838 CAT6 Connected CKT2-8470 2196f3    
dcim.interface 5851 dcim.interface 5842 CAT6 Connected CKT2-8471 2196f3    
dcim.interface 5852 dcim.interface 5843 CAT6 Connected CKT2-8472 2196f3    
Originally created by @ChrisWilkins82 on GitHub (Dec 14, 2018). ### Environment * Python version: 3.6.5 * NetBox version: 2.5.1 * Host OS: Ubuntu 16.4 This looks to still be an issue in the released version of 2.5.1. When I attempt to import cables from a CSV using the default required values, I'm asked for a termination type for the A or B side of the connection (termination_a_type, termination_b_type) These are not indicated as valid values in the import screen. If I add these as additional headers, then I get another error for having an unsupported header in the dataset. Everything else is working perfectly, all other Netbox import/export functions are working perfectly. This seems to be related to #2543 - The cable data I can export does not match the data asked for when attempting to import. ### Steps to Reproduce Attempt to import cables using data from a CSV, All tested datasets are copied below: **Data used for import using required values only:** side_a_device | side_a_type | side_a_name | side_b_device | side_b_type | side_b_name | label -- | -- | -- | -- | -- | -- | -- pes01awsccc | interface | Gi1/0/8 | SESO1-NC1 | interface | CIMC | CKT2-8474 pes01awsccc | interface | Gi1/0/7 | SESO1-NC2 | interface | CIMC | CKT2-8473 per01awsccc | interface | Te0/0/0/0 | SESO1-NC1 | interface | PCIe1 - A | CKT2-8449 per02awsccc | interface | Te0/0/0/0 | SESO1-NC1 | interface | PCIe2 - A | CKT2-8447 per01awsccc | interface | Te0/0/0/1 | SESO1-NC2 | interface | PCIe1 - A | CKT2-8558 per02awsccc | interface | Te0/0/0/1 | SESO1-NC2 | interface | PCIe2 - A | CKT2-8556 per01awsccc | interface | Te0/0/0/2 | SESO1-NU1 | interface | PCIe1 - A | CKT2-8554 per02awsccc | interface | Te0/0/0/2 | SESO1-NU1 | interface | PCIe2 - A | CKT2-8552 per01awsccc | interface | Te0/0/0/3 | SESO1-NU2 | interface | PCIe1 - A | CKT2-8448 per02awsccc | interface | Te0/0/0/3 | SESO1-NU2 | interface | PCIe2 - A | CKT2-8446 per01awsccc | interface | Te0/0/0/4 | SESO1-NU3 | interface | PCIe1 - A | CKT2-8544 per02awsccc | interface | Te0/0/0/4 | SESO1-NU3 | interface | PCIe2 - A | CKT2-8546 per01awsccc | interface | Te0/0/0/5 | SESO1-NSO1 | interface | PCIe1 - A | CKT2-8547 per02awsccc | interface | Te0/0/0/5 | SESO1-NSO1 | interface | PCIe2 - A | CKT2-8545 per01awsccc | interface | Te0/0/0/6 | SESO1-NC3 | interface | PCIe1 - A | CKT2-8543 per02awsccc | interface | Te0/0/0/6 | SESO1-NC3 | interface | PCIe1 - D | CKT2-8542 per01awsccc | interface | Te0/0/0/7 | SESO1-M5 | interface | PCIe1 - A | CKT2-8450 per02awsccc | interface | Te0/0/0/7 | SESO1-M5 | interface | PCIe2 - A | CKT2-8452 **Dataset with termination_b_type added:** side_a_device | side_a_type | side_a_name | side_b_device | side_b_type | side_b_name | label | termination_b_type -- | -- | -- | -- | -- | -- | -- | -- pes01awsccc | interface | Gi1/0/8 | SESO1-NC1 | interface | CIMC | CKT2-8474 | dcim.interface pes01awsccc | interface | Gi1/0/7 | SESO1-NC2 | interface | CIMC | CKT2-8473 | dcim.interface per01awsccc | interface | Te0/0/0/0 | SESO1-NC1 | interface | PCIe1 - A | CKT2-8449 | dcim.interface per02awsccc | interface | Te0/0/0/0 | SESO1-NC1 | interface | PCIe2 - A | CKT2-8447 | dcim.interface per01awsccc | interface | Te0/0/0/1 | SESO1-NC2 | interface | PCIe1 - A | CKT2-8558 | dcim.interface per02awsccc | interface | Te0/0/0/1 | SESO1-NC2 | interface | PCIe2 - A | CKT2-8556 | dcim.interface per01awsccc | interface | Te0/0/0/2 | SESO1-NU1 | interface | PCIe1 - A | CKT2-8554 | dcim.interface per02awsccc | interface | Te0/0/0/2 | SESO1-NU1 | interface | PCIe2 - A | CKT2-8552 | dcim.interface per01awsccc | interface | Te0/0/0/3 | SESO1-NU2 | interface | PCIe1 - A | CKT2-8448 | dcim.interface per02awsccc | interface | Te0/0/0/3 | SESO1-NU2 | interface | PCIe2 - A | CKT2-8446 | dcim.interface per01awsccc | interface | Te0/0/0/4 | SESO1-NU3 | interface | PCIe1 - A | CKT2-8544 | dcim.interface per02awsccc | interface | Te0/0/0/4 | SESO1-NU3 | interface | PCIe2 - A | CKT2-8546 | dcim.interface per01awsccc | interface | Te0/0/0/5 | SESO1-NSO1 | interface | PCIe1 - A | CKT2-8547 | dcim.interface per02awsccc | interface | Te0/0/0/5 | SESO1-NSO1 | interface | PCIe2 - A | CKT2-8545 | dcim.interface per01awsccc | interface | Te0/0/0/6 | SESO1-NC3 | interface | PCIe1 - A | CKT2-8543 | dcim.interface per02awsccc | interface | Te0/0/0/6 | SESO1-NC3 | interface | PCIe1 - D | CKT2-8542 | dcim.interface per01awsccc | interface | Te0/0/0/7 | SESO1-M5 | interface | PCIe1 - A | CKT2-8450 | dcim.interface per02awsccc | interface | Te0/0/0/7 | SESO1-M5 | interface | PCIe2 - A | CKT2-8452 | dcim.interface <!-- What did you expect to happen? --> Cables to be imported into Netbox using the listed headers, and for the export of said data to match the import values. <!-- What happened instead? --> Multiple different error messages are thrown for missing headers, on unsupported headers. Screen shots of each error case using the test datasets above are shown: **Cables Import Field, listing the required values with potential sample data:** ![image](https://user-images.githubusercontent.com/45879761/50014686-d4bfbe00-ff81-11e8-8296-3abe25b28ea6.png) **Error message displayed when you attempt to import data using only the required values dataset:** ![image](https://user-images.githubusercontent.com/45879761/50015973-261d7c80-ff85-11e8-839e-164f3c5327ad.png) **Error message displayed after adding termination_b_type, using the 2nd dataset listed above.** ![image](https://user-images.githubusercontent.com/45879761/50016037-477e6880-ff85-11e8-8b27-ef1e6de5f7f3.png) **Exported data set from cables that were manually created. This does not match what's being asked for if you attempt to import data** termination_a_type | termination_a_id | termination_b_type | termination_b_id | type | status | label | color | length | length_unit -- | -- | -- | -- | -- | -- | -- | -- | -- | -- dcim.consoleport | 1 | dcim.consoleserverport | 1 |   | Connected |   |   |   |   dcim.powerport | 3 | dcim.poweroutlet | 1 |   | Connected |   |   |   |   dcim.interface | 6 | dcim.interface | 5 |   | Connected |   |   |   |   dcim.interface | 10 | dcim.interface | 11 |   | Connected |   |   |   |   dcim.interface | 168 | dcim.interface | 121 |   | Connected |   |   |   |   dcim.interface | 169 | dcim.interface | 165 |   | Connected |   |   |   |   dcim.interface | 170 | dcim.interface | 162 |   | Connected |   |   |   |   dcim.interface | 171 | dcim.interface | 159 |   | Connected |   |   |   |   dcim.interface | 622 | dcim.interface | 634 |   | Connected |   |   |   |   dcim.interface | 5847 | dcim.interface | 5841 | CAT6 | Connected | CKT2-8467 | 2196f3 |   |   dcim.interface | 5848 | dcim.interface | 5839 | CAT6 | Connected | CKT2-8468 | 2196f3 |   |   dcim.interface | 5849 | dcim.interface | 5840 | CAT6 | Connected | CKT2-8469 | 2196f3 |   |   dcim.interface | 5850 | dcim.interface | 5838 | CAT6 | Connected | CKT2-8470 | 2196f3 |   |   dcim.interface | 5851 | dcim.interface | 5842 | CAT6 | Connected | CKT2-8471 | 2196f3 |   |   dcim.interface | 5852 | dcim.interface | 5843 | CAT6 | Connected | CKT2-8472 | 2196f3 |   |  
adam closed this issue 2025-12-29 17:23:40 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 19, 2018):

This was discussed in #2543. The import and export formats are different. This is intentional.

@jeremystretch commented on GitHub (Dec 19, 2018): This was discussed in #2543. The import and export formats are different. This is intentional.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2213