Deleting module can break cable edit functionality #8456

Closed
opened 2025-12-29 20:36:59 +01:00 by adam · 4 comments
Owner

Originally created by @wz4 on GitHub (Aug 11, 2023).

NetBox version

3.5.7

Python version

3.9

Steps to Reproduce

  1. Add module with ports to a device
  2. Add cable and terminate at least one end to a port on the module
  3. Delete the module
  4. Try to edit the cable
  5. Server error is produced

Expected Behavior

A module should not be allowed to be deleted if it has ports that are terminated to one end of a cable.

Observed Behavior

Error generated when trying to edit the cable.

<class 'AttributeError'>

'str' object has no attribute 'label'

Originally created by @wz4 on GitHub (Aug 11, 2023). ### NetBox version 3.5.7 ### Python version 3.9 ### Steps to Reproduce 1. Add module with ports to a device 2. Add cable and terminate at least one end to a port on the module 3. Delete the module 4. Try to edit the cable 5. Server error is produced ### Expected Behavior A module should not be allowed to be deleted if it has ports that are terminated to one end of a cable. ### Observed Behavior Error generated when trying to edit the cable. <class 'AttributeError'> 'str' object has no attribute 'label'
adam added the type: bugstatus: duplicate labels 2025-12-29 20:36:59 +01:00
adam closed this issue 2025-12-29 20:36:59 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 11, 2023):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@jeremystretch commented on GitHub (Aug 11, 2023): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
Author
Owner

@wz4 commented on GitHub (Aug 11, 2023):

Revised Steps to Reproduce

Step 1:
Create New Module Type (Devices -> Module Type)

  1. Create new Module Type
  2. Add Components -> Rear Ports

Step2:
Create New Device (Devices -> Devices)

  1. Create New Device
  2. Add Components -> Module Bay
  3. Insert created Module Type into Module Bay
  4. Repeat for a second device

Step3:
Connect Rear Ports (Devices -> Devices -> [Device])

  1. Select Rear Ports tab
  2. Connect a Rear Port to a Rear Port of second Device
  3. Note cable is created

Step 4:
Remove Module (Devices -> Devices -> [Device])

  1. Select Module Bays tab
  2. Remove inserted Module

Step 5:
Edit Cable (Connections -> Cables)

  1. Select Cable that was created in Step 3
  2. Select Edit
  3. AttributeError is produced
@wz4 commented on GitHub (Aug 11, 2023): **Revised Steps to Reproduce** Step 1: Create New Module Type (Devices -> Module Type) 1. Create new Module Type 2. Add Components -> Rear Ports Step2: Create New Device (Devices -> Devices) 1. Create New Device 2. Add Components -> Module Bay 3. Insert created Module Type into Module Bay 4. Repeat for a second device Step3: Connect Rear Ports (Devices -> Devices -> [Device]) 1. Select Rear Ports tab 2. Connect a Rear Port to a Rear Port of second Device 3. Note cable is created Step 4: Remove Module (Devices -> Devices -> [Device]) 1. Select Module Bays tab 2. Remove inserted Module Step 5: Edit Cable (Connections -> Cables) 1. Select Cable that was created in Step 3 2. Select Edit 3. AttributeError is produced
Author
Owner

@DanSheps commented on GitHub (Aug 11, 2023):

Please use the search in the future

@DanSheps commented on GitHub (Aug 11, 2023): Please use the search in the future
Author
Owner

@DanSheps commented on GitHub (Aug 11, 2023):

Duplicate of #11460

@DanSheps commented on GitHub (Aug 11, 2023): Duplicate of #11460
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8456