Change log becomes out of sync when updating an object with tags via REST API #4659

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

Originally created by @brodie-roberts-ix on GitHub (Mar 12, 2021).

NetBox version

v2.10.4

Python version

3.8

Steps to Reproduce

  1. Create a Device with one or more tags assigned
  2. Update any other property of the Device by making a PATCH API request, but do not specify the "tags" field in the JSON. For example, send {"serial": "12345"} as the PATCH body.
  3. Click "Edit" on the same object in the UI, then click "Update" without making any changes.

Expected Behavior

  • The change log for operation 2 shows the serial field changing and nothing else.
  • The change log for operation 3 shows no change.

Observed Behavior

  • The change log for operation 2 shows the serial field changing AND the list of tags becoming empty. The actual object itself still shows its tags in the UI and via GET API request. It appears the change log has become out of sync with the actual object.
  • The change log for operation 3 shows the list of tags being restored to what it actually is. The change log becomes in sync with the actual object again.

Additional Notes

This appears to be directly related to https://github.com/netbox-community/netbox/issues/5118. I believe the fix to that issue introduced this bug, possibly on this line: 4466458076 (diff-48e44e81277ac8d14d08f8ce8e8753ef7a93f77ba9706945317c80744ede07e1R115)

This doesn't appear to be a functional bug. However, this bug made it very difficult for me and my team as we were trying to learn how to properly interact with tags via the REST API.

Originally created by @brodie-roberts-ix on GitHub (Mar 12, 2021). ### NetBox version v2.10.4 ### Python version 3.8 ### Steps to Reproduce 1. Create a Device with one or more tags assigned 2. Update any other property of the Device by making a PATCH API request, but do not specify the "tags" field in the JSON. For example, send `{"serial": "12345"}` as the PATCH body. 3. Click "Edit" on the same object in the UI, then click "Update" without making any changes. ### Expected Behavior - The change log for operation 2 shows the serial field changing and nothing else. - The change log for operation 3 shows no change. ### Observed Behavior - The change log for operation 2 shows the serial field changing AND the list of tags becoming empty. The actual object itself still shows its tags in the UI and via GET API request. It appears the change log has become out of sync with the actual object. - The change log for operation 3 shows the list of tags being restored to what it actually is. The change log becomes in sync with the actual object again. ### Additional Notes This appears to be directly related to https://github.com/netbox-community/netbox/issues/5118. I believe the fix to that issue introduced this bug, possibly on this line: https://github.com/netbox-community/netbox/commit/4466458076b4cfd1b3d97a234d7f34ef9e191e8c#diff-48e44e81277ac8d14d08f8ce8e8753ef7a93f77ba9706945317c80744ede07e1R115 This doesn't appear to be a functional bug. However, this bug made it very difficult for me and my team as we were trying to learn how to properly interact with tags via the REST API.
adam added the type: bugstatus: duplicate labels 2025-12-29 19:19:14 +01:00
adam closed this issue 2025-12-29 19:19:14 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 13, 2021):

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

@jeremystretch commented on GitHub (Apr 13, 2021): Thank you for submitting this issue, however it appears that this topic has already been raised. Please see issue #5583 for further discussion.
Author
Owner

@brodie-roberts-ix commented on GitHub (Apr 14, 2021):

I think this ticket raised an issue not technically covered by https://github.com/netbox-community/netbox/issues/5583, but it looks like the overhaul to change logging being done in https://github.com/netbox-community/netbox/issues/5913 should cover it anyway. Will update if this issue persists for me in 2.11.

Cheers!

@brodie-roberts-ix commented on GitHub (Apr 14, 2021): I think this ticket raised an issue not technically covered by https://github.com/netbox-community/netbox/issues/5583, but it looks like the overhaul to change logging being done in https://github.com/netbox-community/netbox/issues/5913 should cover it anyway. Will update if this issue persists for me in 2.11. Cheers!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4659