Error displaying the prefixes of an aggregate #5237

Closed
opened 2025-12-29 19:25:46 +01:00 by adam · 3 comments
Owner

Originally created by @BegBlev on GitHub (Aug 27, 2021).

NetBox version

v2.10.2

Python version

3.8

Steps to Reproduce

As a "superuser" (someone able to create aggregates and prefixes):

  1. Create an aggregate attached to a specifc tenant (here 1.0.0.0/24 attached to "Pikeo" tenant).
    image
  2. Create a prefix attached to the same specific tenant inside that aggregate.
    image
  3. Create a "Permission" allowing to view aggregates of a specific tenant (note the "constraints" field).
    image
  4. Create a "Permission" allowing to view/add/change/delete prefixes for that specific tenant.
    image
  5. Create a group and attach it those 2 "Permissions"
    image
  6. Create a user belonging to this group.
    image
    image
  7. As "toto" user go to the "Aggregates" view.
    image
  8. Click on the aggregate
  9. Delete the prefix
  10. Go back to the aggregate view.
    image

Expected Behavior

I should have "Prefixes" field set to 0... not 1.

Observed Behavior

"Prefixes" field is set to 1 despite Utilization is 0%.
image
If I click on the aggregate I can confirm the whole aggregate is available.
image
If I go to the "Aggregates" view as a "superuser" I observe "Prefixes" is set to 0
image

Originally created by @BegBlev on GitHub (Aug 27, 2021). ### NetBox version v2.10.2 ### Python version 3.8 ### Steps to Reproduce As a "superuser" (someone able to create aggregates and prefixes): 1. Create an aggregate attached to a specifc tenant (here 1.0.0.0/24 attached to "Pikeo" tenant). ![image](https://user-images.githubusercontent.com/27002365/131127392-104b3e1d-826f-4227-bc65-8264c0c2e443.png) 1. Create a prefix attached to the same specific tenant inside that aggregate. ![image](https://user-images.githubusercontent.com/27002365/131126915-e5120dd6-d7c2-451b-80b9-c43f6ef58c40.png) 1. Create a "Permission" allowing to view aggregates of a specific tenant (note the "constraints" field). ![image](https://user-images.githubusercontent.com/27002365/131128286-e9a37c6d-7511-43e2-85fd-ab5501b0dac9.png) 1. Create a "Permission" allowing to view/add/change/delete prefixes for that specific tenant. ![image](https://user-images.githubusercontent.com/27002365/131128834-fb538fef-b7a4-4ae1-b0f9-f2fa2fe4580f.png) 1. Create a group and attach it those 2 "Permissions" ![image](https://user-images.githubusercontent.com/27002365/131129405-2c79b3ba-b9b7-4bf7-a5dc-a3fe0bc742e1.png) 1. Create a user belonging to this group. ![image](https://user-images.githubusercontent.com/27002365/131129891-54aa07e0-5348-4f7d-9641-9e0f08fb15d9.png) ![image](https://user-images.githubusercontent.com/27002365/131129992-f54d21fc-ba7c-4906-88d0-e952022447f6.png) 1. As "toto" user go to the "Aggregates" view. ![image](https://user-images.githubusercontent.com/27002365/131132778-dc54b5d2-eb78-4821-8b85-d45deb80d019.png) 1. Click on the aggregate 1. Delete the prefix 1. Go back to the aggregate view. ![image](https://user-images.githubusercontent.com/27002365/131133234-95925678-dbca-46e4-8cf9-266afe131c56.png) ### Expected Behavior I should have "Prefixes" field set to 0... not 1. ### Observed Behavior "Prefixes" field is set to 1 despite Utilization is 0%. ![image](https://user-images.githubusercontent.com/27002365/131133234-95925678-dbca-46e4-8cf9-266afe131c56.png) If I click on the aggregate I can confirm the whole aggregate is available. ![image](https://user-images.githubusercontent.com/27002365/131133669-d8ec6864-e270-455a-b201-7cd1bdc8317a.png) If I go to the "Aggregates" view as a "superuser" I observe "Prefixes" is set to 0 ![image](https://user-images.githubusercontent.com/27002365/131134592-d6c7696a-3a4c-42d9-94b1-6145e13d5b33.png)
adam added the type: bug label 2025-12-29 19:25:46 +01:00
adam closed this issue 2025-12-29 19:25:46 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 27, 2021):

v2.10.2

Please upgrade to the latest stable release (v2.11.11) and see if the behavior is still present. You might also need to disable queryset caching by setting CACHE_TIMEOUT = 0 in configuration.py.

@jeremystretch commented on GitHub (Aug 27, 2021): > v2.10.2 Please upgrade to the latest stable release (v2.11.11) and see if the behavior is still present. You might also need to disable queryset caching by setting `CACHE_TIMEOUT = 0` in `configuration.py`.
Author
Owner

@BegBlev commented on GitHub (Aug 27, 2021):

CACHE_TIMEOUT = 0 on v2.10.2 solved the problem. 👍
Does it still usefull for you if I make the test with v2.11.11?
I feel this is a "cache management issue" and it should work even with the cache activated but I don't know much about DB caching.

@BegBlev commented on GitHub (Aug 27, 2021): `CACHE_TIMEOUT = 0` on v2.10.2 solved the problem. 👍 Does it still usefull for you if I make the test with v2.11.11? I feel this is a "cache management issue" and it should work even with the cache activated but I don't know much about DB caching.
Author
Owner

@jeremystretch commented on GitHub (Aug 27, 2021):

Nah, it's a caching bug. We've removed this type of caching entirely in the upcoming v3.0 release already. Thanks for the report.

@jeremystretch commented on GitHub (Aug 27, 2021): Nah, it's a caching bug. We've removed this type of caching entirely in the upcoming v3.0 release already. Thanks for the report.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5237