Assigning multiple front-ports to one rear raises an class 'IndexError' #7332

Closed
opened 2025-12-29 20:22:00 +01:00 by adam · 3 comments
Owner

Originally created by @Philtouk on GitHub (Dec 7, 2022).

NetBox version

v3.3.8

Python version

3.8

Steps to Reproduce

  1. Create a module type "test"
  2. Create one rear port "RP"
  3. Create multiple front ports "FP[1-6]"
  4. Attache them to the rear port "RP"
  5. click "create"

Then I get the server error:
<class 'IndexError'>

list index out of range

Python version: 3.8.10
NetBox version: 3.3.8

Expected Behavior

Create multiple front ports 1 to 6 attached to the rear port RP

Observed Behavior

Then I get the server error:
<class 'IndexError'>

list index out of range

Python version: 3.8.10
NetBox version: 3.3.8

Originally created by @Philtouk on GitHub (Dec 7, 2022). ### NetBox version v3.3.8 ### Python version 3.8 ### Steps to Reproduce 1. Create a module type "test" 2. Create one rear port "RP" 3. Create multiple front ports "FP[1-6]" 4. Attache them to the rear port "RP" 5. click "create" Then I get the server error: <class 'IndexError'> list index out of range Python version: 3.8.10 NetBox version: 3.3.8 ### Expected Behavior Create multiple front ports 1 to 6 attached to the rear port RP ### Observed Behavior Then I get the server error: <class 'IndexError'> list index out of range Python version: 3.8.10 NetBox version: 3.3.8
adam added the type: bug label 2025-12-29 20:22:00 +01:00
adam closed this issue 2025-12-29 20:22:00 +01:00
Author
Owner

@MBcom commented on GitHub (Dec 8, 2022):

We have the same bug in v3.3.9.
image

127.0.0.1 - - [08/Dec/2022:08:20:45 +0000] "POST /dcim/front-ports/add/?device=10&return_url=/dcim/devices/10/front-ports/ HTTP/1.0" 500 1568 "https://*******/dcim/front-ports/add/?device=10&return_url=/dcim/devices/10/front-ports/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
@MBcom commented on GitHub (Dec 8, 2022): We have the same bug in v3.3.9. ![image](https://user-images.githubusercontent.com/27956078/206399083-01e995ed-327d-466f-adf3-cc66cd6ec70a.png) ``` 127.0.0.1 - - [08/Dec/2022:08:20:45 +0000] "POST /dcim/front-ports/add/?device=10&return_url=/dcim/devices/10/front-ports/ HTTP/1.0" 500 1568 "https://*******/dcim/front-ports/add/?device=10&return_url=/dcim/devices/10/front-ports/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" ```
Author
Owner

@kkthxbye-code commented on GitHub (Dec 8, 2022):

This is mostly a validation issue I believe. The correct way to create the module type in your example would be to set the rearport positions value to 6. Then it works as intended.

For reference, the rearport positions field is documented here:

https://docs.netbox.dev/en/stable/models/dcim/rearport/

@kkthxbye-code commented on GitHub (Dec 8, 2022): This is mostly a validation issue I believe. The correct way to create the module type in your example would be to set the rearport positions value to 6. Then it works as intended. For reference, the rearport positions field is documented here: https://docs.netbox.dev/en/stable/models/dcim/rearport/
Author
Owner

@Philtouk commented on GitHub (Dec 8, 2022):

Indeed It works !
I didn't notice this point in the documentation...
Thanks a lot

@Philtouk commented on GitHub (Dec 8, 2022): Indeed It works ! I didn't notice this point in the documentation... Thanks a lot
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7332