Change Log server error #4779

Closed
opened 2025-12-29 19:20:22 +01:00 by adam · 9 comments
Owner

Originally created by @ecoutinho on GitHub (Apr 16, 2021).

NetBox version

v2.11.0

Python version

3.8

Steps to Reproduce

After updating from 2.10.9 to 2.11.0, create a new device then access Other > Change Log.

Expected Behavior

List of recent changes.

Observed Behavior

An error occurs:

Server Error

There was a problem with your request. Please contact an administrator.

The complete exception is provided below:

<class 'AttributeError'>

'NoneType' object has no attribute '_base_manager'

Python version: 3.8.3
NetBox version: 2.11.0

Originally created by @ecoutinho on GitHub (Apr 16, 2021). ### NetBox version v2.11.0 ### Python version 3.8 ### Steps to Reproduce After updating from 2.10.9 to 2.11.0, create a new device then access Other > Change Log. ### Expected Behavior List of recent changes. ### Observed Behavior An error occurs: Server Error There was a problem with your request. Please contact an administrator. The complete exception is provided below: <class 'AttributeError'> 'NoneType' object has no attribute '_base_manager' Python version: 3.8.3 NetBox version: 2.11.0
adam added the type: bugstatus: under review labels 2025-12-29 19:20:22 +01:00
adam closed this issue 2025-12-29 19:20:22 +01:00
Author
Owner

@ecoutinho commented on GitHub (Apr 16, 2021):

From the logs:

Internal Server Error: /extras/changelog/
Traceback (most recent call last):
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 829, in _resolve_lookup
    current = current[bit]
TypeError: 'ObjectChange' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/utilities/views.py", line 93, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/netbox/netbox/netbox/views/generic.py", line 210, in get
    return render(request, self.template_name, context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/shortcuts.py", line 19, in render
    content = loader.render_to_string(template_name, context, request, using=using)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/loader.py", line 62, in render_to_string
    return template.render(context, request)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 170, in render
    return self._render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 516, in render
    return self.nodelist.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 312, in render
    return nodelist.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/templatetags/django_tables2.py", line 167, in render
    return template.render(context={"table": table}, request=request)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 170, in render
    return self._render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 211, in render
    nodelist.append(node.render_annotated(context))
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 167, in render
    values = list(values)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/rows.py", line 244, in items
    column.current_value = self.get_cell(column.name)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/rows.py", line 197, in get_cell
    return self._get_and_render_with(
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/rows.py", line 173, in _get_and_render_with
    return render_func(bound_column, value)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/rows.py", line 206, in _call_render
    content = call_with_appropriate(bound_column.render, render_kwargs)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/utils.py", line 572, in call_with_appropriate
    return fn(**kwargs)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/columns/templatecolumn.py", line 66, in render
    return Template(self.template_code).render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 172, in render
    return self._render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/test/utils.py", line 100, in instrumented_test_render
    return self.nodelist.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render
    bit = node.render_annotated(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated
    return self.render(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 305, in render
    match = condition.eval(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 889, in eval
    return self.value.resolve(context, ignore_failures=True)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 671, in resolve
    obj = self.var.resolve(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 796, in resolve
    value = self._resolve_lookup(context)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 837, in _resolve_lookup
    current = getattr(current, bit)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/contrib/contenttypes/fields.py", line 241, in __get__
    rel_obj = ct.get_object_for_this_type(pk=pk_val)
  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/contrib/contenttypes/models.py", line 175, in get_object_for_this_type
    return self.model_class()._base_manager.using(self._state.db).get(**kwargs)
AttributeError: 'NoneType' object has no attribute '_base_manager'
@ecoutinho commented on GitHub (Apr 16, 2021): From the logs: ``` Internal Server Error: /extras/changelog/ Traceback (most recent call last): File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 829, in _resolve_lookup current = current[bit] TypeError: 'ObjectChange' object is not subscriptable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/views/generic/base.py", line 70, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox/netbox/utilities/views.py", line 93, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/views/generic/base.py", line 98, in dispatch return handler(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/views/generic.py", line 210, in get return render(request, self.template_name, context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/shortcuts.py", line 19, in render content = loader.render_to_string(template_name, context, request, using=using) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/loader.py", line 62, in render_to_string return template.render(context, request) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 170, in render return self._render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/test/utils.py", line 100, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/test/utils.py", line 100, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/test/utils.py", line 100, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 516, in render return self.nodelist.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 312, in render return nodelist.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/templatetags/django_tables2.py", line 167, in render return template.render(context={"table": table}, request=request) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 170, in render return self._render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/test/utils.py", line 100, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 211, in render nodelist.append(node.render_annotated(context)) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 167, in render values = list(values) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/rows.py", line 244, in items column.current_value = self.get_cell(column.name) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/rows.py", line 197, in get_cell return self._get_and_render_with( File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/rows.py", line 173, in _get_and_render_with return render_func(bound_column, value) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/rows.py", line 206, in _call_render content = call_with_appropriate(bound_column.render, render_kwargs) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/utils.py", line 572, in call_with_appropriate return fn(**kwargs) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django_tables2/columns/templatecolumn.py", line 66, in render return Template(self.template_code).render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 172, in render return self._render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/test/utils.py", line 100, in instrumented_test_render return self.nodelist.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 938, in render bit = node.render_annotated(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 905, in render_annotated return self.render(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 305, in render match = condition.eval(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/defaulttags.py", line 889, in eval return self.value.resolve(context, ignore_failures=True) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 671, in resolve obj = self.var.resolve(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 796, in resolve value = self._resolve_lookup(context) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/template/base.py", line 837, in _resolve_lookup current = getattr(current, bit) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/contrib/contenttypes/fields.py", line 241, in __get__ rel_obj = ct.get_object_for_this_type(pk=pk_val) File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/contrib/contenttypes/models.py", line 175, in get_object_for_this_type return self.model_class()._base_manager.using(self._state.db).get(**kwargs) AttributeError: 'NoneType' object has no attribute '_base_manager' ```
Author
Owner

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

I'm not able to replicate this, and I'm pretty sure I would have run into it by now given all the times I've migrated v2.10 data to v2.11 during development. I'm not sure what's going on here, but this:

  File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/contrib/contenttypes/models.py", line 175, in get_object_for_this_type
    return self.model_class()._base_manager.using(self._state.db).get(**kwargs)
AttributeError: 'NoneType' object has no attribute '_base_manager'

indicates that the ContentType instance isn't resolving to a model class, which is very strange. Did all of your migrations complete successfully during the upgrade to v2.10? Also, can you try running manage.py remove_stale_contenttypes to see if that does anything unexpected?

@jeremystretch commented on GitHub (Apr 16, 2021): I'm not able to replicate this, and I'm pretty sure I would have run into it by now given all the times I've migrated v2.10 data to v2.11 during development. I'm not sure what's going on here, but this: ``` File "/opt/netbox-2.11.0/venv/lib64/python3.8/site-packages/django/contrib/contenttypes/models.py", line 175, in get_object_for_this_type return self.model_class()._base_manager.using(self._state.db).get(**kwargs) AttributeError: 'NoneType' object has no attribute '_base_manager' ``` indicates that the ContentType instance isn't resolving to a model class, which is very strange. Did all of your migrations complete successfully during the upgrade to v2.10? Also, can you try running `manage.py remove_stale_contenttypes` to see if that does anything unexpected?
Author
Owner

@ecoutinho commented on GitHub (Apr 16, 2021):

Thanks for your reply. I had to disable a plugin from local_requirements.txt (ntc-netbox-plugin-onboarding), but apart from that, the update didn't produce any error. All migrations returned 'ok'.

I've also upgraded from python 3.6 to python 3.8 on CentOS 8.3, prior to netbox upgrade. Could this be related to that?

I've run this manage.py command, it didn't produce any output and the 'change log' error remains.

@ecoutinho commented on GitHub (Apr 16, 2021): Thanks for your reply. I had to disable a plugin from local_requirements.txt (ntc-netbox-plugin-onboarding), but apart from that, the update didn't produce any error. All migrations returned 'ok'. I've also upgraded from python 3.6 to python 3.8 on CentOS 8.3, prior to netbox upgrade. Could this be related to that? I've run this manage.py command, it didn't produce any output and the 'change log' error remains.
Author
Owner

@ecoutinho commented on GitHub (Apr 16, 2021):

I've rolled back the virtual machine to a snapshot I had taken prior to the update. Back on version 2.10, I see that on Change Log there are some entries related to the plugin netbox_onboarding. As I had to disable this plugin on 2.11, do you think Change Log is trying to list an event for which it doesn't have enough information and that results in an error?

@ecoutinho commented on GitHub (Apr 16, 2021): I've rolled back the virtual machine to a snapshot I had taken prior to the update. Back on version 2.10, I see that on Change Log there are some entries related to the plugin netbox_onboarding. As I had to disable this plugin on 2.11, do you think Change Log is trying to list an event for which it doesn't have enough information and that results in an error?
Author
Owner

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

Ah, good catch! That's very likely the case.

The simplest fix, if you don't mind losing that change history, is to just delete all ObjectChanges which pertain to a model provided by the plugin. I can help with that if you'd like.

@jeremystretch commented on GitHub (Apr 16, 2021): Ah, good catch! That's very likely the case. The simplest fix, if you don't mind losing that change history, is to just delete all ObjectChanges which pertain to a model provided by the plugin. I can help with that if you'd like.
Author
Owner

@ecoutinho commented on GitHub (Apr 16, 2021):

Let's try it! Could you please tell me what I've got to do? Thanks

@ecoutinho commented on GitHub (Apr 16, 2021): Let's try it! Could you please tell me what I've got to do? Thanks
Author
Owner

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

I'll try to walk through it short of actually installing v2.10 with the plugin...

First, enter the NetBox shell:

$ ./manage.py nbshell
### NetBox interactive shell (jstretch-workstation)
### Python 3.7.9 | Django 3.2 | NetBox 2.11.0
### lsmodels() will show available models. Use help(<model>) for more info.
>>>

We need to find all ContentTypes installed by the plugin. This should do it:

>>> plugin_cts = ContentType.objects.filter(app_label='netbox_onboarding')
>>> plugin_cts.count()

The second line should return a non-zero value. If it's zero, this isn't working.

Next, look for ObjectChange records matching those content types:

>>> ObjectChange.objects.filter(changed_object_type__in=plugin_cts).count()

Again, this should be non-zero. If it looks good, we can delete them with

>>> ObjectChange.objects.filter(changed_object_type__in=plugin_cts).delete()

Let me know how that goes!

@jeremystretch commented on GitHub (Apr 16, 2021): I'll try to walk through it short of actually installing v2.10 with the plugin... First, enter the NetBox shell: ``` $ ./manage.py nbshell ### NetBox interactive shell (jstretch-workstation) ### Python 3.7.9 | Django 3.2 | NetBox 2.11.0 ### lsmodels() will show available models. Use help(<model>) for more info. >>> ``` We need to find all ContentTypes installed by the plugin. This should do it: ``` >>> plugin_cts = ContentType.objects.filter(app_label='netbox_onboarding') >>> plugin_cts.count() ``` The second line should return a non-zero value. If it's zero, this isn't working. Next, look for ObjectChange records matching those content types: ``` >>> ObjectChange.objects.filter(changed_object_type__in=plugin_cts).count() ``` Again, this should be non-zero. If it looks good, we can delete them with ``` >>> ObjectChange.objects.filter(changed_object_type__in=plugin_cts).delete() ``` Let me know how that goes!
Author
Owner

@ecoutinho commented on GitHub (Apr 16, 2021):

Thanks! It worked!

NetBox interactive shell (su5002nb)

Python 3.6.8 | Django 3.1.8 | NetBox 2.10.9

lsmodels() will show available models. Use help() for more info.

plugin_cts = ContentType.objects.filter(app_label='netbox_onboarding')
plugin_cts.count()
2
ObjectChange.objects.filter(changed_object_type__in=plugin_cts).count()
40
ObjectChange.objects.filter(changed_object_type__in=plugin_cts).delete()
(40, {'extras.ObjectChange': 40})

I had exported the logs and filtered for 'netbox_onboarding', so I can confirm there were 40 events.

After upgrading to version 2.11, going to Change Log it is working as expected.

Thanks once again for your support. Have a nice weekend!

@ecoutinho commented on GitHub (Apr 16, 2021): Thanks! It worked! ### NetBox interactive shell (su5002nb) ### Python 3.6.8 | Django 3.1.8 | NetBox 2.10.9 ### lsmodels() will show available models. Use help(<model>) for more info. >>> plugin_cts = ContentType.objects.filter(app_label='netbox_onboarding') >>> plugin_cts.count() 2 >>> ObjectChange.objects.filter(changed_object_type__in=plugin_cts).count() 40 >>> ObjectChange.objects.filter(changed_object_type__in=plugin_cts).delete() (40, {'extras.ObjectChange': 40}) I had exported the logs and filtered for 'netbox_onboarding', so I can confirm there were 40 events. After upgrading to version 2.11, going to Change Log it is working as expected. Thanks once again for your support. Have a nice weekend!
Author
Owner

@PieterL75 commented on GitHub (May 4, 2021):

This is soo wierd.. I had exactly the same issue today, and also with trying "ntc-netbox-plugin-onboarding" addon, and removing it, because it did not do what I expected...

Is there a way to 'just dont care' about ChangeLog items that point to addons that are no longer there ?

Pieter

@PieterL75 commented on GitHub (May 4, 2021): This is soo wierd.. I had exactly the same issue today, and also with trying "ntc-netbox-plugin-onboarding" addon, and removing it, because it did not do what I expected... Is there a way to 'just dont care' about ChangeLog items that point to addons that are no longer there ? Pieter
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4779