deleting rear port does not update front port count #8782

Closed
opened 2025-12-29 20:41:09 +01:00 by adam · 1 comment
Owner

Originally created by @matejv on GitHub (Oct 30, 2023).

NetBox version

v3.6.4

Python version

3.11

Steps to Reproduce

#6347 added cached counts for device components. It seems these cached counts are not updated when deleting rear ports. Deleting rear port also automatically deletes any front ports assigned to it.

  1. create device
  2. add rear port (name: rp1, positions: 1)
  3. add front port (name fp1, rear ports: rp1:1)
  4. observe that front port and read port counts are correct (each shows 1)
  5. delete rear port rp1

Expected Behavior

Front port count should be 0 and front ports tab should not be shown on device view.

Observed Behavior

Front port count remains at 1, even though deleting rear port removed front port as well.

image

Running python manage.py calculate_cached_counts fixes the count.

Originally created by @matejv on GitHub (Oct 30, 2023). ### NetBox version v3.6.4 ### Python version 3.11 ### Steps to Reproduce #6347 added cached counts for device components. It seems these cached counts are not updated when deleting rear ports. Deleting rear port also automatically deletes any front ports assigned to it. 1. create device 2. add rear port (name: rp1, positions: 1) 3. add front port (name fp1, rear ports: rp1:1) 4. observe that front port and read port counts are correct (each shows 1) 5. delete rear port rp1 ### Expected Behavior Front port count should be 0 and front ports tab should not be shown on device view. ### Observed Behavior Front port count remains at 1, even though deleting rear port removed front port as well. ![image](https://github.com/netbox-community/netbox/assets/1256843/21897496-c8a7-4752-bbf3-04c39b701582) Running `python manage.py calculate_cached_counts` fixes the count.
adam added the type: bugstatus: duplicate labels 2025-12-29 20:41:09 +01:00
adam closed this issue 2025-12-29 20:41:09 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 30, 2023):

Thank you for submitting this issue, however it appears that this topic has already been raised. Please see issue #14129 for further discussion.

@jeremystretch commented on GitHub (Oct 30, 2023): Thank you for submitting this issue, however it appears that this topic has already been raised. Please see issue #14129 for further discussion.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8782