Object changes are not logged after upgrade to v4.1.9 #10587

Closed
opened 2025-12-29 21:33:25 +01:00 by adam · 5 comments
Owner

Originally created by @koratfood on GitHub (Dec 18, 2024).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.9

Python Version

3.12

Steps to Reproduce

  1. [v4.1.8] Create site "Testsite1" with slug "testsite1" and otherwise default values
  2. [v4.1.8] Edit site "Testsite1", enter "hello" in the Description field, and save
  3. [v4.1.8] Delete site "Testsite1"
  4. Upgrade to v4.1.9
  5. [v4.1.9] Create site "Testsite2" with slug "testsite2" and otherwise default values
  6. [v4.1.9] Edit site "Testsite2", enter "hello" in the Description field, and save
  7. [v4.1.9] Delete site "Testsite2"

Expected Behavior

All 6 changes are found in the Changelog.

Observed Behavior

Only changes made in reproduction steps 1-3 (i.e. before we upgraded to v4.1.9) are found in the Changelog.

Originally created by @koratfood on GitHub (Dec 18, 2024). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### Triage priority N/A ### NetBox Version v4.1.9 ### Python Version 3.12 ### Steps to Reproduce 1. [v4.1.8] Create site "Testsite1" with slug "testsite1" and otherwise default values 2. [v4.1.8] Edit site "Testsite1", enter "hello" in the Description field, and save 3. [v4.1.8] Delete site "Testsite1" 4. Upgrade to v4.1.9 5. [v4.1.9] Create site "Testsite2" with slug "testsite2" and otherwise default values 6. [v4.1.9] Edit site "Testsite2", enter "hello" in the Description field, and save 7. [v4.1.9] Delete site "Testsite2" ### Expected Behavior All 6 changes are found in the Changelog. ### Observed Behavior Only changes made in reproduction steps 1-3 (i.e. before we upgraded to v4.1.9) are found in the Changelog.
adam added the type: bugstatus: acceptedseverity: high labels 2025-12-29 21:33:25 +01:00
adam closed this issue 2025-12-29 21:33:25 +01:00
Author
Owner

@sleepinggenius2 commented on GitHub (Dec 18, 2024):

I can confirm the same issue. For some additional context, starting with a v4.1.9 environment, simply a git checkout v4.1.8 and restarting the service without running update.sh is sufficient to restore changelog functionality. I have also confirmed that this applies to changes made through the UI, scripts, and API.

@sleepinggenius2 commented on GitHub (Dec 18, 2024): I can confirm the same issue. For some additional context, starting with a v4.1.9 environment, simply a `git checkout v4.1.8` and restarting the service **without** running `update.sh` is sufficient to restore changelog functionality. I have also confirmed that this applies to changes made through the UI, scripts, and API.
Author
Owner

@tobiasge commented on GitHub (Dec 19, 2024):

I noticed the same. The problem was likely introduced in this PR: https://github.com/netbox-community/netbox/pull/18225
The event_tracking request processor is not put into the registry.

From our installation:

./netbox/manage.py shell
Python 3.12.8 (main, Dec  4 2024, 06:51:15) [GCC 14.2.1 20241116] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from netbox.registry import registry
>>> registry.keys()
dict_keys(['counter_fields', 'data_backends', 'denormalized_fields', 'event_types', 'model_features', 'models', 'plugins', 'request_processors', 'search', 'tables', 'views', 'widgets'])
>>> registry.get('data_backends')
{'local': <class 'core.data_backends.LocalBackend'>, 'git': <class 'core.data_backends.GitBackend'>, 'amazon-s3': <class 'core.data_backends.S3Backend'>}
>>> registry.get('request_processors')
[]
@tobiasge commented on GitHub (Dec 19, 2024): I noticed the same. The problem was likely introduced in this PR: https://github.com/netbox-community/netbox/pull/18225 The `event_tracking` request processor is not put into the registry. From our installation: ``` ./netbox/manage.py shell Python 3.12.8 (main, Dec 4 2024, 06:51:15) [GCC 14.2.1 20241116] on linux Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from netbox.registry import registry >>> registry.keys() dict_keys(['counter_fields', 'data_backends', 'denormalized_fields', 'event_types', 'model_features', 'models', 'plugins', 'request_processors', 'search', 'tables', 'views', 'widgets']) >>> registry.get('data_backends') {'local': <class 'core.data_backends.LocalBackend'>, 'git': <class 'core.data_backends.GitBackend'>, 'amazon-s3': <class 'core.data_backends.S3Backend'>} >>> registry.get('request_processors') [] ```
Author
Owner

@layer3lv commented on GitHub (Dec 20, 2024):

Same problem in docker version

@layer3lv commented on GitHub (Dec 20, 2024): Same problem in docker version
Author
Owner

@abhi1693 commented on GitHub (Dec 22, 2024):

Webhooks are also not triggered. The related PR fixes that too.

@abhi1693 commented on GitHub (Dec 22, 2024): Webhooks are also not triggered. The related PR fixes that too.
Author
Owner

@jeremystretch commented on GitHub (Dec 23, 2024):

I tracked down why this regression was not caught by CI for PR #18225. When the change logging tests are run in isolation, they fail:

$ ./manage.py test --keepdb core.tests.test_changelog
Found 13 test(s).
Using existing test database for alias 'default'...
System check identified no issues (0 silenced).
FFFEEEEEEEEF.
...

This is because the event_tracking context manager is never imported, and thus does not get registered (which PR #18262 fixes).

However, when the entire test suite is run (as during CI), event_tracking is coincidentally imported by a test module for event rules, which happens to run before the change logging tests.

Reliably checking for the registration of event_tracking in a test might prove difficult. Will have to give it some more thought.

@jeremystretch commented on GitHub (Dec 23, 2024): I tracked down why this regression was not caught by CI for PR #18225. When the change logging tests are run in isolation, they fail: ``` $ ./manage.py test --keepdb core.tests.test_changelog Found 13 test(s). Using existing test database for alias 'default'... System check identified no issues (0 silenced). FFFEEEEEEEEF. ... ``` This is because the `event_tracking` context manager is never imported, and thus does not get registered (which PR #18262 fixes). However, when the entire test suite is run (as during CI), `event_tracking` is coincidentally [imported by a test module](https://github.com/netbox-community/netbox/blob/8c07978042e8c80259d7ad5b2b44c7adfc551716/netbox/extras/tests/test_event_rules.py#L20) for event rules, which happens to run _before_ the change logging tests. Reliably checking for the registration of `event_tracking` in a test might prove difficult. Will have to give it some more thought.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10587