Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
koratfood opened this issue Dec 18, 2024 · 5 comments · Fixed by #18262
Closed

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

koratfood opened this issue Dec 18, 2024 · 5 comments · Fixed by #18262
Assignees
Labels
severity: high Completely breaks certain functions, or substantially degrades performance application-wide status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@koratfood
Copy link
Contributor

koratfood commented Dec 18, 2024

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.

@koratfood koratfood added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Dec 18, 2024
@koratfood koratfood changed the title Object changes are not recorded after upgrade to 4.1.9 Object changes are not recorded after upgrade to v4.1.9 Dec 18, 2024
@sleepinggenius2
Copy link
Contributor

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.

@koratfood koratfood changed the title Object changes are not recorded after upgrade to v4.1.9 Object changes are not logged after upgrade to v4.1.9 Dec 19, 2024
@tobiasge
Copy link
Member

tobiasge commented Dec 19, 2024

I noticed the same. The problem was likely introduced in this PR: #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')
[]

@layer3lv
Copy link

Same problem in docker version

@abhi1693
Copy link
Member

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

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation severity: high Completely breaks certain functions, or substantially degrades performance application-wide and removed status: needs triage This issue is awaiting triage by a maintainer labels Dec 23, 2024
@jeremystretch jeremystretch self-assigned this Dec 23, 2024
@jeremystretch
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: high Completely breaks certain functions, or substantially degrades performance application-wide status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants