Front & Rear-Port Bulk-Import CSV-Fields swapped #6242

Closed
opened 2025-12-29 19:38:25 +01:00 by adam · 3 comments
Owner

Originally created by @hwerny on GitHub (Mar 21, 2022).

NetBox version

v3.1.9

Python version

3.7

Steps to Reproduce

  1. Click on Front Ports / Click on Import
  2. There you can see these csv-entries: device,name,type,rear_port,rear_port_position
  3. Same with Rear Ports / Import: device,name,type,positions
  4. So it seems the CSV-Entries where swapped.

Expected Behavior

Use of the right Front-Ports-CSV-Entries at Front Ports and use of the right Rear-Port-CSV-Entries at Rear Ports.

Observed Behavior

When i use the entries from Rear Ports, which should be the right ones, at Front Ports it gaves this error: Unexpected column header "positions" found.
Without "positions" this error: Required column header "rear_port" not found.

Originally created by @hwerny on GitHub (Mar 21, 2022). ### NetBox version v3.1.9 ### Python version 3.7 ### Steps to Reproduce 1. Click on Front Ports / Click on Import 2. There you can see these csv-entries: device,name,type,rear_port,rear_port_position 3. Same with Rear Ports / Import: device,name,type,positions 4. So it seems the CSV-Entries where swapped. ### Expected Behavior Use of the right Front-Ports-CSV-Entries at Front Ports and use of the right Rear-Port-CSV-Entries at Rear Ports. ### Observed Behavior When i use the entries from Rear Ports, which should be the right ones, at Front Ports it gaves this error: Unexpected column header "positions" found. Without "positions" this error: Required column header "rear_port" not found.
adam closed this issue 2025-12-29 19:38:25 +01:00
Author
Owner

@martinum4 commented on GitHub (Mar 22, 2022):

Are you using the csv import or csv upload?
I tried the following with csv text import on demo.netbox.dev and it worked as intended:

Rear ports:

device.id,name,type,positions
1,RP1,8p8c,1
1,RP2,8p8c,1

Front ports

device.id,name,type,rear_port,rear_port_position
1,FP1,8p8c,RP1,1
1,FP2,8p8c,RP2,1

Results in:

grafik

@martinum4 commented on GitHub (Mar 22, 2022): Are you using the csv import or csv upload? I tried the following with csv text import on demo.netbox.dev and it worked as intended: Rear ports: ``` device.id,name,type,positions 1,RP1,8p8c,1 1,RP2,8p8c,1 ``` Front ports ``` device.id,name,type,rear_port,rear_port_position 1,FP1,8p8c,RP1,1 1,FP2,8p8c,RP2,1 ``` Results in: ![grafik](https://user-images.githubusercontent.com/18295403/159457170-691c90d2-c3ce-4029-87bc-fe2c81d90f18.png)
Author
Owner

@jeremystretch commented on GitHub (Mar 22, 2022):

The import forms are working as they should. If you need help importing pass-through ports, please start a discussion.

@jeremystretch commented on GitHub (Mar 22, 2022): The import forms are working as they should. If you need help importing pass-through ports, please start a [discussion](https://github.com/netbox-community/netbox/discussions/new).
Author
Owner

@hwerny commented on GitHub (Mar 22, 2022):

I am using csv-text import.
But is it correct to input data in an front-port-mask where it should be the rear-port-mask?
Did I misunderstood the masks and where to put what data in?

And your example doesn't exactly match mine.
I gave a device name and not a device.id.
The csv-options underneat the csv-text-field gave me no device.id option.
So I changed your example a little bit an tested it on demo.netbox.dev:

device,name,type,rear_port,rear_port_position
EX4200-SA,FP1,8p8c,RP1,1
EX4200-SA,FP2,8p8c,RP2,1

Then it gaves me this error:

Server Error

There was a problem with your request. Please contact an administrator.


The complete exception is provided below:

<class 'dcim.models.device_components.FrontPort.rear_port.RelatedObjectDoesNotExist'>

FrontPort has no rear_port.

Von: martinum4 @.>
Gesendet: Dienstag, 22. März 2022 11:11
An: netbox-community/netbox @.
>
Cc: Werny, Holger @.>; Author @.>
Betreff: Re: [netbox-community/netbox] Front & Rear-Port Bulk-Import CSV-Fields swapped (Issue #8929)

Are you using the csv import or csv upload?
I tried the following with csv text import on demo.netbox.dev and it worked as intended:

Rear ports:

device.id,name,type,positions

1,RP1,8p8c,1

1,RP2,8p8c,1

Front ports

device.id,name,type,rear_port,rear_port_position

1,FP1,8p8c,RP1,1

1,FP2,8p8c,RP2,1

Results in:

[Das Bild wurde vom Absender entfernt. grafik]https://user-images.githubusercontent.com/18295403/159457170-691c90d2-c3ce-4029-87bc-fe2c81d90f18.png


Reply to this email directly, view it on GitHubhttps://github.com/netbox-community/netbox/issues/8929#issuecomment-1074980286, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYKPDUHZSBBMBVGSTCFZVYLVBGMCZANCNFSM5RH3OXWQ.
You are receiving this because you authored the thread.Message ID: @.***>

Amtsgericht Arnsberg, HRA 4722, pers. haftender Gesellschafter: HJS Fahrzeugtechnik Beteiligungs GmbH, AG Arnsberg, HRB 4771, Geschäftsführer: Jan-Michael Ebbing.

@hwerny commented on GitHub (Mar 22, 2022): I am using csv-text import. But is it correct to input data in an front-port-mask where it should be the rear-port-mask? Did I misunderstood the masks and where to put what data in? And your example doesn't exactly match mine. I gave a device name and not a device.id. The csv-options underneat the csv-text-field gave me no device.id option. So I changed your example a little bit an tested it on demo.netbox.dev: device,name,type,rear_port,rear_port_position EX4200-SA,FP1,8p8c,RP1,1 EX4200-SA,FP2,8p8c,RP2,1 Then it gaves me this error: Server Error There was a problem with your request. Please contact an administrator. ________________________________ The complete exception is provided below: <class 'dcim.models.device_components.FrontPort.rear_port.RelatedObjectDoesNotExist'> FrontPort has no rear_port. Von: martinum4 ***@***.***> Gesendet: Dienstag, 22. März 2022 11:11 An: netbox-community/netbox ***@***.***> Cc: Werny, Holger ***@***.***>; Author ***@***.***> Betreff: Re: [netbox-community/netbox] Front & Rear-Port Bulk-Import CSV-Fields swapped (Issue #8929) Are you using the csv import or csv upload? I tried the following with csv text import on demo.netbox.dev and it worked as intended: Rear ports: device.id,name,type,positions 1,RP1,8p8c,1 1,RP2,8p8c,1 Front ports device.id,name,type,rear_port,rear_port_position 1,FP1,8p8c,RP1,1 1,FP2,8p8c,RP2,1 Results in: [Das Bild wurde vom Absender entfernt. grafik]<https://user-images.githubusercontent.com/18295403/159457170-691c90d2-c3ce-4029-87bc-fe2c81d90f18.png> — Reply to this email directly, view it on GitHub<https://github.com/netbox-community/netbox/issues/8929#issuecomment-1074980286>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AYKPDUHZSBBMBVGSTCFZVYLVBGMCZANCNFSM5RH3OXWQ>. You are receiving this because you authored the thread.Message ID: ***@***.***> Amtsgericht Arnsberg, HRA 4722, pers. haftender Gesellschafter: HJS Fahrzeugtechnik Beteiligungs GmbH, AG Arnsberg, HRB 4771, Geschäftsführer: Jan-Michael Ebbing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6242