Search broken (for devices)... 'NoneType' object has no attribute '_base_manager' #9656

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

Originally created by @Azmodeszer on GitHub (May 11, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.0.1

Python Version

3.10

Steps to Reproduce

  1. Search for a string that should yield a result in the database

Expected Behavior

Well, you know...

Observed Behavior

<class 'AttributeError'>

'NoneType' object has no attribute '_base_manager'

Seems to only apply if the matching results contain objects of type device.

Originally created by @Azmodeszer on GitHub (May 11, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.0.1 ### Python Version 3.10 ### Steps to Reproduce 1. Search for a string that should yield a result in the database ### Expected Behavior Well, you know... ### Observed Behavior ``` <class 'AttributeError'> 'NoneType' object has no attribute '_base_manager' ``` Seems to only apply if the matching results contain objects of type device.
adam closed this issue 2025-12-29 21:20:29 +01:00
Author
Owner

@PaulR282 commented on GitHub (May 13, 2024):

Having the same issue, but only certain searches throw this exception, it works most of the time for me.

@PaulR282 commented on GitHub (May 13, 2024): Having the same issue, but only certain searches throw this exception, it works most of the time for me.
Author
Owner

@jeffgdotorg commented on GitHub (May 13, 2024):

I've been unable to reproduce this problem on a fresh 4.0.1 installation with a bare minimum object population consisting of:

  • One device role
  • One manufacturer
  • One device type
  • One site
  • One device

I tried several different searches which either do or do not match the solitary device, including some that match the device type and the device.

If you're able to find a full stack trace in the logs, it might provide hints about which kinds of objects are implicated. One way or another, we need to be able to reproduce the problem on a clean system before we can confirm a bug.

@jeffgdotorg commented on GitHub (May 13, 2024): I've been unable to reproduce this problem on a fresh 4.0.1 installation with a bare minimum object population consisting of: - One device role - One manufacturer - One device type - One site - One device I tried several different searches which either do or do not match the solitary device, including some that match the device type and the device. If you're able to find a full stack trace in the logs, it might provide hints about which kinds of objects are implicated. One way or another, we need to be able to reproduce the problem on a clean system before we can confirm a bug.
Author
Owner

@PaulR282 commented on GitHub (May 13, 2024):

If you're able to find a full stack trace in the logs, it might provide hints about which kinds of objects are implicated. One way or another, we need to be able to reproduce the problem on a clean system before we can confirm a bug.

Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/netbox/netbox/views/misc.py", line 83, in get
    results = search_backend.search(
              
  File "/opt/netbox/netbox/netbox/search/backends.py", line 174, in search
    objects = [r for r in results if r.object_type == object_type]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 2127, in __iter__
    self._fetch_all()
    ^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 2116, in _fetch_all
    self._prefetch_related_objects()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 2095, in _prefetch_related_objects
    prefetch_related_objects(self._result_cache, *self._prefetch_related_lookups)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 2381, in prefetch_related_objects
    obj_list, additional_lookups = prefetch_one_level(
                                   
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 2545, in prefetch_one_level
    ) = prefetcher.get_prefetch_querysets(
        
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/contrib/contenttypes/fields.py", line 230, in get_prefetch_querysets
    ret_val.extend(ct.get_all_objects_for_this_type(pk__in=fkeys))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/contrib/contenttypes/models.py", line 190, in get_all_objects_for_this_type
    return self.model_class()._base_manager.using(self._state.db).filter(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Exception Type: AttributeError at /search/
Exception Value: 'NoneType' object has no attribute '_base_manager'
@PaulR282 commented on GitHub (May 13, 2024): > If you're able to find a full stack trace in the logs, it might provide hints about which kinds of objects are implicated. One way or another, we need to be able to reproduce the problem on a clean system before we can confirm a bug. ``` Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view return self.dispatch(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 143, in dispatch return handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/netbox/netbox/views/misc.py", line 83, in get results = search_backend.search( File "/opt/netbox/netbox/netbox/search/backends.py", line 174, in search objects = [r for r in results if r.object_type == object_type] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 2127, in __iter__ self._fetch_all() ^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 2116, in _fetch_all self._prefetch_related_objects() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 2095, in _prefetch_related_objects prefetch_related_objects(self._result_cache, *self._prefetch_related_lookups) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 2381, in prefetch_related_objects obj_list, additional_lookups = prefetch_one_level( File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/models/query.py", line 2545, in prefetch_one_level ) = prefetcher.get_prefetch_querysets( File "/opt/netbox/venv/lib/python3.11/site-packages/django/contrib/contenttypes/fields.py", line 230, in get_prefetch_querysets ret_val.extend(ct.get_all_objects_for_this_type(pk__in=fkeys)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/contrib/contenttypes/models.py", line 190, in get_all_objects_for_this_type return self.model_class()._base_manager.using(self._state.db).filter(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Exception Type: AttributeError at /search/ Exception Value: 'NoneType' object has no attribute '_base_manager' ```
Author
Owner

@Azmodeszer commented on GitHub (May 13, 2024):

Internal Server Error: /search/
Traceback (most recent call last):
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/netbox/netbox/netbox/views/misc.py", line 83, in get
    results = search_backend.search(
  File "/opt/netbox/netbox/netbox/search/backends.py", line 174, in search
    objects = [r for r in results if r.object_type == object_type]
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/db/models/query.py", line 2127, in __iter__
    self._fetch_all()
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/db/models/query.py", line 2116, in _fetch_all
    self._prefetch_related_objects()
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/db/models/query.py", line 2095, in _prefetch_related_objects
    prefetch_related_objects(self._result_cache, *self._prefetch_related_lookups)
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/db/models/query.py", line 2381, in prefetch_related_objects
    obj_list, additional_lookups = prefetch_one_level(
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/db/models/query.py", line 2545, in prefetch_one_level
    ) = prefetcher.get_prefetch_querysets(
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/contrib/contenttypes/fields.py", line 230, in get_prefetch_querysets
    ret_val.extend(ct.get_all_objects_for_this_type(pk__in=fkeys))
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/contrib/contenttypes/models.py", line 190, in get_all_objects_for_this_type
    return self.model_class()._base_manager.using(self._state.db).filter(**kwargs)
AttributeError: 'NoneType' object has no attribute '_base_manager'

It's indeed not a fresh install but a system upgraded from the last v3 release. I've seen this bug on two such systems now.

@Azmodeszer commented on GitHub (May 13, 2024): ``` Internal Server Error: /search/ Traceback (most recent call last): File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 104, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 143, in dispatch return handler(request, *args, **kwargs) File "/opt/netbox/netbox/netbox/views/misc.py", line 83, in get results = search_backend.search( File "/opt/netbox/netbox/netbox/search/backends.py", line 174, in search objects = [r for r in results if r.object_type == object_type] File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/db/models/query.py", line 2127, in __iter__ self._fetch_all() File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/db/models/query.py", line 2116, in _fetch_all self._prefetch_related_objects() File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/db/models/query.py", line 2095, in _prefetch_related_objects prefetch_related_objects(self._result_cache, *self._prefetch_related_lookups) File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/db/models/query.py", line 2381, in prefetch_related_objects obj_list, additional_lookups = prefetch_one_level( File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/db/models/query.py", line 2545, in prefetch_one_level ) = prefetcher.get_prefetch_querysets( File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/contrib/contenttypes/fields.py", line 230, in get_prefetch_querysets ret_val.extend(ct.get_all_objects_for_this_type(pk__in=fkeys)) File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/contrib/contenttypes/models.py", line 190, in get_all_objects_for_this_type return self.model_class()._base_manager.using(self._state.db).filter(**kwargs) AttributeError: 'NoneType' object has no attribute '_base_manager' ``` It's indeed not a fresh install but a system upgraded from the last v3 release. I've seen this bug on two such systems now.
Author
Owner

@jeremystretch commented on GitHub (May 13, 2024):

This issue can occur because NetBox is matching on one or more cached search results that reference a type of object which no longer exists (e.g. because a plugin was removed). If you've removed a plugin (likely due to incompatibility with v4.0), be sure to clear the global search index to remove any stale entries.

@jeremystretch commented on GitHub (May 13, 2024): This issue can occur because NetBox is matching on one or more cached search results that reference a type of object which no longer exists (e.g. because a plugin was removed). If you've removed a plugin (likely due to incompatibility with v4.0), be sure to [clear the global search index](https://docs.netbox.dev/en/stable/plugins/removal/#re-index-search-entries) to remove any stale entries.
Author
Owner

@PaulR282 commented on GitHub (May 13, 2024):

This issue can occur because NetBox is matching on one or more cached search results that reference a type of object which no longer exists (e.g. because a plugin was removed). If you've removed a plugin (likely due to incompatibility with v4.0), be sure to clear the global search index to remove any stale entries.

That worked for me. Thanks

@PaulR282 commented on GitHub (May 13, 2024): > This issue can occur because NetBox is matching on one or more cached search results that reference a type of object which no longer exists (e.g. because a plugin was removed). If you've removed a plugin (likely due to incompatibility with v4.0), be sure to [clear the global search index](https://docs.netbox.dev/en/stable/plugins/removal/#re-index-search-entries) to remove any stale entries. That worked for me. Thanks
Author
Owner

@Azmodeszer commented on GitHub (May 13, 2024):

No such luck for me. When I try to run the reindex command in the venv, I get:

Traceback (most recent call last):
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 255, in fetch_command
    app_name = commands[subcommand]
KeyError: 'reindex'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/netbox-main/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 262, in fetch_command
    settings.INSTALLED_APPS
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 89, in __getattr__
    self._setup(name)
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 76, in _setup
    self._wrapped = Settings(settings_module)
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 190, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/netbox-main/netbox/netbox/settings.py", line 739, in <module>
    plugin = importlib.import_module(plugin_name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/netbox-main/venv/lib/python3.10/site-packages/netbox_topology_views/__init__.py", line 1, in <module>
    from extras.plugins import PluginConfig
ImportError: cannot import name 'PluginConfig' from 'extras.plugins' (unknown location)
@Azmodeszer commented on GitHub (May 13, 2024): No such luck for me. When I try to run the reindex command in the venv, I get: ``` Traceback (most recent call last): File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 255, in fetch_command app_name = commands[subcommand] KeyError: 'reindex' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/netbox-main/netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 262, in fetch_command settings.INSTALLED_APPS File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 89, in __getattr__ self._setup(name) File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 76, in _setup self._wrapped = Settings(settings_module) File "/opt/netbox-main/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 190, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/opt/netbox-main/netbox/netbox/settings.py", line 739, in <module> plugin = importlib.import_module(plugin_name) File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/opt/netbox-main/venv/lib/python3.10/site-packages/netbox_topology_views/__init__.py", line 1, in <module> from extras.plugins import PluginConfig ImportError: cannot import name 'PluginConfig' from 'extras.plugins' (unknown location) ```
Author
Owner

@PaulR282 commented on GitHub (May 13, 2024):

@Azmodeszer You need to disable the topology views plugin because it is currently not compatible with v4.0

@PaulR282 commented on GitHub (May 13, 2024): @Azmodeszer You need to disable the topology views plugin because it is currently not compatible with v4.0
Author
Owner

@Azmodeszer commented on GitHub (May 13, 2024):

Oh ffs, I'm an idiot... Thanks, done and fixed now.

@Azmodeszer commented on GitHub (May 13, 2024): Oh ffs, I'm an idiot... Thanks, done and fixed now.
Author
Owner

@bitcollector1 commented on GitHub (May 16, 2024):

I'm seeing this issue when I click on a user in NetBox.....not all users....just one

Screenshot 2024-05-16 at 10 15 30 Screenshot 2024-05-16 at 10 14 10

The re-index did not help with this issue that I stumbled across.

@bitcollector1 commented on GitHub (May 16, 2024): I'm seeing this issue when I click on a user in NetBox.....not all users....just one <img width="322" alt="Screenshot 2024-05-16 at 10 15 30" src="https://github.com/netbox-community/netbox/assets/50723251/d4821584-c662-434f-b2c4-c03876ecda08"> <img width="812" alt="Screenshot 2024-05-16 at 10 14 10" src="https://github.com/netbox-community/netbox/assets/50723251/52e0e234-35db-4f64-880c-fc7eefc8fe28"> The re-index did not help with this issue that I stumbled across.
Author
Owner

@bitcollector1 commented on GitHub (May 16, 2024):

I also tried the following that had helped in the past with a similar issue but no luck this time :(

https://github.com/netbox-community/netbox/issues/13507

(venv) ebay@netdevbox:/opt/netbox/netbox$ python3 manage.py nbshell
### NetBox interactive shell (netdevbox)
### Python 3.12.3 | Django 5.0.6 | NetBox 4.0.2
### lsmodels() will show available models. Use help(<model>) for more info.
>>> 
>>> from netbox.search.backends import search_backend
>>> search_backend.clear()
53173
>>> exit()
(venv) ebay@netdevbox:/opt/netbox/netbox$ python manage.py reindex
Reindexing 81 models.
Clearing cached values... 0 entries deleted.
Indexing models
  netbox_dns.record... 7640 entries cached.
  netbox_dns.view... 2 entries cached.
  netbox_dns.nameserver... 4 entries cached.
  netbox_dns.zone... 10 entries cached.
  netbox_dns.contact... No objects found.
  netbox_dns.registrar... No objects found.
  core.datasource... 9 entries cached.
  core.datafile... 231 entries cached.
  circuits.circuit... No objects found.
  circuits.circuittermination... No objects found.
  circuits.circuittype... 2 entries cached.
  circuits.provider... No objects found.
  circuits.providernetwork... No objects found.
  dcim.cable... 3 entries cached.
  dcim.consoleport... 136 entries cached.
  dcim.consoleserverport... 714 entries cached.
  dcim.device... 5687 entries cached.
  dcim.devicebay... 581 entries cached.
  dcim.devicerole... 39 entries cached.
  dcim.devicetype... 312 entries cached.
  dcim.frontport... 258 entries cached.
  dcim.interface... 18805 entries cached.
  dcim.inventoryitem... 8353 entries cached.
  dcim.location... 29 entries cached.
  dcim.manufacturer... 179 entries cached.
  dcim.module... No objects found.
  dcim.modulebay... No objects found.
  dcim.moduletype... No objects found.
  dcim.platform... 9 entries cached.
  dcim.powerfeed... 55 entries cached.
  dcim.poweroutlet... 1703 entries cached.
  dcim.powerpanel... 4 entries cached.
  dcim.powerport... 1280 entries cached.
  dcim.rack... 38 entries cached.
  dcim.rackreservation... 1 entries cached.
  dcim.rackrole... 29 entries cached.
  dcim.rearport... 252 entries cached.
  dcim.region... 6 entries cached.
  dcim.site... 30 entries cached.
  dcim.sitegroup... 14 entries cached.
  dcim.virtualchassis... No objects found.
  dcim.virtualdevicecontext... No objects found.
  ipam.aggregate... No objects found.
  ipam.asn... 14 entries cached.
  ipam.asnrange... No objects found.
  ipam.fhrpgroup... 2 entries cached.
  ipam.ipaddress... 5560 entries cached.
  ipam.iprange... 107 entries cached.
  ipam.prefix... 450 entries cached.
  ipam.rir... 3 entries cached.
  ipam.role... 2 entries cached.
  ipam.routetarget... No objects found.
  ipam.service... 70 entries cached.
  ipam.servicetemplate... No objects found.
  ipam.vlan... 66 entries cached.
  ipam.vlangroup... No objects found.
  ipam.vrf... 2 entries cached.
  extras.customfield... 76 entries cached.
  extras.journalentry... 228 entries cached.
  extras.webhook... No objects found.
  tenancy.contact... 11 entries cached.
  tenancy.contactgroup... 4 entries cached.
  tenancy.contactrole... 2 entries cached.
  tenancy.tenant... 134 entries cached.
  tenancy.tenantgroup... 27 entries cached.
  virtualization.cluster... No objects found.
  virtualization.clustergroup... No objects found.
  virtualization.clustertype... No objects found.
  virtualization.virtualmachine... No objects found.
  virtualization.vminterface... No objects found.
  virtualization.virtualdisk... No objects found.
  vpn.tunnel... No objects found.
  vpn.ikeproposal... No objects found.
  vpn.ikepolicy... No objects found.
  vpn.ipsecproposal... No objects found.
  vpn.ipsecpolicy... No objects found.
  vpn.ipsecprofile... No objects found.
  vpn.l2vpn... No objects found.
  wireless.wirelesslan... No objects found.
  wireless.wirelesslangroup... No objects found.
  wireless.wirelesslink... No objects found.
Completed. Total entries: 53173
@bitcollector1 commented on GitHub (May 16, 2024): I also tried the following that had helped in the past with a similar issue but no luck this time :( https://github.com/netbox-community/netbox/issues/13507 ``` (venv) ebay@netdevbox:/opt/netbox/netbox$ python3 manage.py nbshell ### NetBox interactive shell (netdevbox) ### Python 3.12.3 | Django 5.0.6 | NetBox 4.0.2 ### lsmodels() will show available models. Use help(<model>) for more info. >>> >>> from netbox.search.backends import search_backend >>> search_backend.clear() 53173 >>> exit() ``` ``` (venv) ebay@netdevbox:/opt/netbox/netbox$ python manage.py reindex Reindexing 81 models. Clearing cached values... 0 entries deleted. Indexing models netbox_dns.record... 7640 entries cached. netbox_dns.view... 2 entries cached. netbox_dns.nameserver... 4 entries cached. netbox_dns.zone... 10 entries cached. netbox_dns.contact... No objects found. netbox_dns.registrar... No objects found. core.datasource... 9 entries cached. core.datafile... 231 entries cached. circuits.circuit... No objects found. circuits.circuittermination... No objects found. circuits.circuittype... 2 entries cached. circuits.provider... No objects found. circuits.providernetwork... No objects found. dcim.cable... 3 entries cached. dcim.consoleport... 136 entries cached. dcim.consoleserverport... 714 entries cached. dcim.device... 5687 entries cached. dcim.devicebay... 581 entries cached. dcim.devicerole... 39 entries cached. dcim.devicetype... 312 entries cached. dcim.frontport... 258 entries cached. dcim.interface... 18805 entries cached. dcim.inventoryitem... 8353 entries cached. dcim.location... 29 entries cached. dcim.manufacturer... 179 entries cached. dcim.module... No objects found. dcim.modulebay... No objects found. dcim.moduletype... No objects found. dcim.platform... 9 entries cached. dcim.powerfeed... 55 entries cached. dcim.poweroutlet... 1703 entries cached. dcim.powerpanel... 4 entries cached. dcim.powerport... 1280 entries cached. dcim.rack... 38 entries cached. dcim.rackreservation... 1 entries cached. dcim.rackrole... 29 entries cached. dcim.rearport... 252 entries cached. dcim.region... 6 entries cached. dcim.site... 30 entries cached. dcim.sitegroup... 14 entries cached. dcim.virtualchassis... No objects found. dcim.virtualdevicecontext... No objects found. ipam.aggregate... No objects found. ipam.asn... 14 entries cached. ipam.asnrange... No objects found. ipam.fhrpgroup... 2 entries cached. ipam.ipaddress... 5560 entries cached. ipam.iprange... 107 entries cached. ipam.prefix... 450 entries cached. ipam.rir... 3 entries cached. ipam.role... 2 entries cached. ipam.routetarget... No objects found. ipam.service... 70 entries cached. ipam.servicetemplate... No objects found. ipam.vlan... 66 entries cached. ipam.vlangroup... No objects found. ipam.vrf... 2 entries cached. extras.customfield... 76 entries cached. extras.journalentry... 228 entries cached. extras.webhook... No objects found. tenancy.contact... 11 entries cached. tenancy.contactgroup... 4 entries cached. tenancy.contactrole... 2 entries cached. tenancy.tenant... 134 entries cached. tenancy.tenantgroup... 27 entries cached. virtualization.cluster... No objects found. virtualization.clustergroup... No objects found. virtualization.clustertype... No objects found. virtualization.virtualmachine... No objects found. virtualization.vminterface... No objects found. virtualization.virtualdisk... No objects found. vpn.tunnel... No objects found. vpn.ikeproposal... No objects found. vpn.ikepolicy... No objects found. vpn.ipsecproposal... No objects found. vpn.ipsecpolicy... No objects found. vpn.ipsecprofile... No objects found. vpn.l2vpn... No objects found. wireless.wirelesslan... No objects found. wireless.wirelesslangroup... No objects found. wireless.wirelesslink... No objects found. Completed. Total entries: 53173 ```
Author
Owner

@Kani999 commented on GitHub (May 29, 2024):

I've got same problem as @bitcollector1
When I click on certain User, it shows this error.

@Kani999 commented on GitHub (May 29, 2024): I've got same problem as @bitcollector1 When I click on certain User, it shows this error.
Author
Owner

@Kani999 commented on GitHub (May 29, 2024):

@bitcollector1 I found the bug and have reported it in a new issue: #16335

@Kani999 commented on GitHub (May 29, 2024): @bitcollector1 I found the bug and have reported it in a new issue: #16335
Author
Owner

@Kani999 commented on GitHub (May 29, 2024):

Okay, so It's not a core NetBox problem. It's a problem with NetBox Topology Views plugin.
IndividualOption model is defined in the plugin.

Workaround:

# enter nbshell
individual_option = ObjectType.objects.get(model='individualoptions')
changes = ObjectChange.objects.filter(changed_object_type_id = individual_option.id)
changes.delete()

After deleting the changes everything works just fine.


I suppose that Plugin Removal would work too, but I did not try it out.

@Kani999 commented on GitHub (May 29, 2024): Okay, so It's not a core NetBox problem. It's a problem with NetBox Topology Views plugin. IndividualOption model is defined in the plugin. Workaround: ```python # enter nbshell individual_option = ObjectType.objects.get(model='individualoptions') changes = ObjectChange.objects.filter(changed_object_type_id = individual_option.id) changes.delete() ``` After deleting the changes everything works just fine. ___ I suppose that [Plugin Removal](https://netboxlabs.com/docs/netbox/en/stable/plugins/removal/ ) would work too, but I did not try it out.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9656