The total number of components on the device tab displayed in the UI does not match the actual number. #8781

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

Originally created by @penM000 on GitHub (Oct 27, 2023).

NetBox version

v3.6.4

Python version

3.8

Steps to Reproduce

I know of two ways to generate this problem.

Method using front and rear ports

  1. Create a device with a front port and a rear port.
  2. Delete the rear port.
  3. The front port is labeled 24, but no ports exist.
    image
    image
    image

This phenomenon occurs with modules.

  1. Create a module with various components.
  2. module to the device.
  3. component is increasing and confirms that it is indeed present.
  4. Delete the module.
  5. The Interface component has been removed, but the others (console port, power port, etc.) show that there are 32, even though the component is not present.
    image
    image
    image
    image
    image

Expected Behavior

We expect the number of components to match the numbers displayed in the tabs.

Observed Behavior

Different numbers are displayed even though the component does not exist.

Originally created by @penM000 on GitHub (Oct 27, 2023). ### NetBox version v3.6.4 ### Python version 3.8 ### Steps to Reproduce I know of two ways to generate this problem. # Method using front and rear ports 1. Create a device with a front port and a rear port. 2. Delete the rear port. 3. The front port is labeled 24, but no ports exist. ![image](https://github.com/netbox-community/netbox/assets/33054826/8a292ac4-7a18-4ad4-8b20-34f024869140) ![image](https://github.com/netbox-community/netbox/assets/33054826/620ad089-5159-4d3d-a631-faa2a6ebc06b) ![image](https://github.com/netbox-community/netbox/assets/33054826/36e0d34a-75a7-46f4-ae0c-46be283d8a4d) # This phenomenon occurs with modules. 1. Create a module with various components. 2. module to the device. 3. component is increasing and confirms that it is indeed present. 4. Delete the module. 5. The Interface component has been removed, but the others (console port, power port, etc.) show that there are 32, even though the component is not present. ![image](https://github.com/netbox-community/netbox/assets/33054826/d98f8d49-8d45-455f-96d6-36a5e8a1569b) ![image](https://github.com/netbox-community/netbox/assets/33054826/6b9ee357-8ae1-48c4-aa0f-050c76fee119) ![image](https://github.com/netbox-community/netbox/assets/33054826/493f9db5-9ed1-4a5e-856d-07c4f399e8af) ![image](https://github.com/netbox-community/netbox/assets/33054826/5e7d5d1c-cc2f-4a05-a469-2a5ecc3c4513) ![image](https://github.com/netbox-community/netbox/assets/33054826/19bf5a6b-2e42-43c7-9cb7-3788eb87efad) ### Expected Behavior We expect the number of components to match the numbers displayed in the tabs. ### Observed Behavior Different numbers are displayed even though the component does not exist.
adam added the type: bug label 2025-12-29 20:41:06 +01:00
adam closed this issue 2025-12-29 20:41:06 +01:00
Author
Owner

@penM000 commented on GitHub (Oct 27, 2023):

image
If one is added in the state of 32, the display becomes 33.
If I delete it, it just goes back to 32 and cannot be set to 0.
Please let me know how to fix this as well.

@penM000 commented on GitHub (Oct 27, 2023): ![image](https://github.com/netbox-community/netbox/assets/33054826/af496c21-ad5f-4f8e-bf55-30c70fce31c3) If one is added in the state of 32, the display becomes 33. If I delete it, it just goes back to 32 and cannot be set to 0. Please let me know how to fix this as well.
Author
Owner

@arthanson commented on GitHub (Oct 27, 2023):

@penM000 you can run the management command calculate_cached_counts to recalculate the counters to the correct values. There is another bug #14081 that effects removing parent elements that is currently being worked on, but the management command will recalc it to show the correct values.

@arthanson commented on GitHub (Oct 27, 2023): @penM000 you can run the management command `calculate_cached_counts` to recalculate the counters to the correct values. There is another bug #14081 that effects removing parent elements that is currently being worked on, but the management command will recalc it to show the correct values.
Author
Owner

@penM000 commented on GitHub (Nov 1, 2023):

Thank you for your confirmation.
Thank you also for your help on how to correct the problem.
I am aware that this is similar to #14081. Is this ticket closed?

@penM000 commented on GitHub (Nov 1, 2023): Thank you for your confirmation. Thank you also for your help on how to correct the problem. I am aware that this is similar to #14081. Is this ticket closed?
Author
Owner

@arthanson commented on GitHub (Nov 18, 2023):

Closing as dupe of #14081

@arthanson commented on GitHub (Nov 18, 2023): Closing as dupe of #14081
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8781