IndexError: list index out of range when adding a new front port with a label #10967

Closed
opened 2025-12-29 21:38:32 +01:00 by adam · 2 comments
Owner

Originally created by @LabelWriter450 on GitHub (Mar 31, 2025).

Originally assigned to: @pheus on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.2.6

Python Version

3.10

Steps to Reproduce

When attempting to add a new front port on a device and providing a label, an IndexError occurs.

Steps to Reproduce:

  1. Go to Device.
  2. Add 'Add a new front port'.
  3. Select Device.
  4. Give name [0-9].
  5. Give Label.
  6. Assign Type.
  7. Assign Rear Port.

Expected Behavior

To see the range of ports created successfully.

Observed Behavior

Get error:

Server Error

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


The complete exception is provided below:

<class 'IndexError'>
list index out of range
Python version: 3.10.12
NetBox version: 4.2.6
Plugins: None installed

Please note that the issue only occurs, when a label is assigned in the process. Without a label it works fine.

Originally created by @LabelWriter450 on GitHub (Mar 31, 2025). Originally assigned to: @pheus on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.2.6 ### Python Version 3.10 ### Steps to Reproduce When attempting to add a new front port on a device and providing a label, an `IndexError` occurs. ## Steps to Reproduce: 1. Go to Device. 2. Add 'Add a new front port'. 3. Select Device. 4. Give name [0-9]. 5. Give Label. 6. Assign Type. 7. Assign Rear Port. ### Expected Behavior To see the range of ports created successfully. ### Observed Behavior Get error: ``` Server Error There was a problem with your request. Please contact an administrator. The complete exception is provided below: <class 'IndexError'> list index out of range Python version: 3.10.12 NetBox version: 4.2.6 Plugins: None installed ``` **Please note that the issue only occurs, when a label is assigned in the process. Without a label it works fine.**
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:38:33 +01:00
adam closed this issue 2025-12-29 21:38:33 +01:00
Author
Owner

@pheus commented on GitHub (Apr 1, 2025):

I've identified the root cause of this issue. If the issue is assigned to me, I’d be happy to submit a pull request with a fix.

@pheus commented on GitHub (Apr 1, 2025): I've identified the root cause of this issue. If the issue is assigned to me, I’d be happy to submit a pull request with a fix.
Author
Owner

@jeremystretch commented on GitHub (Apr 1, 2025):

Thanks @pheus, I've assigned this to you.

@jeremystretch commented on GitHub (Apr 1, 2025): Thanks @pheus, I've assigned this to you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10967