Empty search entries are being created for device asset tags #9426

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

Originally created by @jeremystretch on GitHub (Apr 3, 2024).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

NetBox Cloud

NetBox Version

v3.7.4

Python Version

3.11

Steps to Reproduce

  1. Create a new device and note its database ID
  2. In the NetBox shell, inspect all search entries associated with it:
ct = ContentType.objects.get_for_model(Device)
device_id = 107
entries = CachedValue.objects.filter(object_type=ct, object_id=device_id)
for entry in entries:
    print(f'{entry.field}: {entry.value}')

Expected Behavior

Only fields which have a meaningful value set should have search entries created.

Observed Behavior

After creating a device with a description, I see three entries for it:

asset_tag: None
name: device1
description: asdasdasd

The value of asset_tag is null.

Originally created by @jeremystretch on GitHub (Apr 3, 2024). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type NetBox Cloud ### NetBox Version v3.7.4 ### Python Version 3.11 ### Steps to Reproduce 1. Create a new device and note its database ID 2. In the NetBox shell, inspect all search entries associated with it: ```python ct = ContentType.objects.get_for_model(Device) device_id = 107 entries = CachedValue.objects.filter(object_type=ct, object_id=device_id) for entry in entries: print(f'{entry.field}: {entry.value}') ``` ### Expected Behavior Only fields which have a meaningful value set should have search entries created. ### Observed Behavior After creating a device with a description, I see three entries for it: ``` asset_tag: None name: device1 description: asdasdasd ``` The value of `asset_tag` is null.
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:49:40 +01:00
adam closed this issue 2025-12-29 20:49:40 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 3, 2024):

This bug appears to affect any field which returns a null value (None).

@jeremystretch commented on GitHub (Apr 3, 2024): This bug appears to affect any field which returns a null value (None).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9426