ConfigContext still assigned to Device, while disassociated from it's Site #5138

Closed
opened 2025-12-29 19:24:44 +01:00 by adam · 2 comments
Owner

Originally created by @sdktr on GitHub (Aug 4, 2021).

NetBox version

v2.11.10

Python version

3.8

Steps to Reproduce

  1. Create ConfigContext 'Region', with json 'region-key' : 'region-value', assign to Region of Device
  2. Create ConfigContext 'Site', with json 'site-key': 'site-value', assign to Site of Device
  3. Check renderd config context shows:
    image
  4. Open ConfigContext 'Site' and disassociate the Site of your test device
  5. Refresh device page in UI

Expected Behavior

The (now dissasociated) Site-level configcontext should no longer be in the rendered config context.

Observed Behavior

The Site-level configcontext is still there.

Workaround: After disabling/enabling the Site Config Context it is gone from the Device.

Note that this was observed on a setup with CACHE_TIMEOUT=0 as well on demo.netbox.dev (which presummably runs without query caching as well, since that's the default in 2.11.10)

Originally created by @sdktr on GitHub (Aug 4, 2021). ### NetBox version v2.11.10 ### Python version 3.8 ### Steps to Reproduce 1. Create ConfigContext 'Region', with json 'region-key' : 'region-value', assign to Region of Device 2. Create ConfigContext 'Site', with json 'site-key': 'site-value', assign to Site of Device 3. Check renderd config context shows: ![image](https://user-images.githubusercontent.com/19833687/128253276-9c1350ee-2cd1-4c1b-ba9a-f5ccf40e3a7f.png) 4. Open ConfigContext 'Site' and disassociate the Site of your test device 5. Refresh device page in UI ### Expected Behavior The (now dissasociated) Site-level configcontext should no longer be in the rendered config context. ### Observed Behavior The Site-level configcontext is still there. Workaround: After disabling/enabling the Site Config Context it is gone from the Device. Note that this was observed on a setup with CACHE_TIMEOUT=0 as well on demo.netbox.dev (which presummably runs without query caching as well, since that's the default in 2.11.10)
adam closed this issue 2025-12-29 19:24:44 +01:00
Author
Owner

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

  1. Open ConfigContext 'Site' and disassociate the Site of your test device

This results in the config context no longer having any constraints, in which case it now applies to all devices. Note that if you delete the config context, or assign it to a different site, this no longer occurs.

Note that this was observed on a setup with CACHE_TIMEOUT=0 as well on demo.netbox.dev (which presummably runs without query caching as well, since that's the default in 2.11.10)

The demo instance was actually still configured with caching enabled, though since we've disabled it in v2.11.10 as you note, I've just tweaked it so that caching is now disabled.

@jeremystretch commented on GitHub (Aug 5, 2021): > 4. Open ConfigContext 'Site' and disassociate the Site of your test device This results in the config context no longer having _any_ constraints, in which case it now applies to **all** devices. Note that if you delete the config context, or assign it to a different site, this no longer occurs. > Note that this was observed on a setup with CACHE_TIMEOUT=0 as well on demo.netbox.dev (which presummably runs without query caching as well, since that's the default in 2.11.10) The demo instance was actually still configured with caching enabled, though since we've disabled it in v2.11.10 as you note, I've just tweaked it so that caching is now disabled.
Author
Owner

@sdktr commented on GitHub (Aug 5, 2021):

The title in the GUI shows 'association' while you state it should read as 'constraint'?

Eighter way, something is broken. In my case, the site cfg context is disassociated from the device after disabling and enabling again. If what you state is the intended behavior, it should return on the device after reenabling it.

Setting up a config context without any associations/constraints doesn't show up in any of my devices. Reproduced on demo instance as well.
What are your thoughts on this @jeremystretch ?

@sdktr commented on GitHub (Aug 5, 2021): The title in the GUI shows 'association' while you state it should read as 'constraint'? Eighter way, something is broken. In my case, the site cfg context is disassociated from the device after disabling and enabling again. If what you state is the intended behavior, it should return on the device after reenabling it. Setting up a config context without any associations/constraints doesn't show up in any of my devices. Reproduced on demo instance as well. What are your thoughts on this @jeremystretch ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5138