Getting error while generating database migrations #8819
hamidallaoui
started this conversation in
General
Replies: 1 comment 1 reply
-
If you want to customize the way Netbox works, there are a number of supported ways to do this, in particular Plugins and Custom Fields. The latter is the only supported way to modify core Netbox models. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I did somes updates on core dcim site model and when I tried to generate DB migrations I got below errors.
cd /opt/netbox/netbox
source /opt/netbox/venv/bin/activate
python3 manage.py makemigrations dcim -n update_dcim_site_model
Traceback (most recent call last):
File "/opt/netbox-3.1.8/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/django/core/management/init.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/django/core/management/base.py", line 393, in execute
self.check()
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/django/core/management/base.py", line 419, in check
all_issues = checks.run_checks(
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/debug_toolbar/apps.py", line 60, in check_middleware
if is_middleware_class(GZipMiddleware, middleware):
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/debug_toolbar/apps.py", line 115, in is_middleware_class
middleware_cls = import_string(middleware_path)
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/django/utils/module_loading.py", line 17, in import_string
module = import_module(module_path)
File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/opt/netbox-3.1.8/netbox/netbox/middleware.py", line 14, in
from netbox.views import server_error
File "/opt/netbox-3.1.8/netbox/netbox/views/init.py", line 26, in
from netbox.constants import SEARCH_MAX_RESULTS, SEARCH_TYPES
File "/opt/netbox-3.1.8/netbox/netbox/constants.py", line 3, in
from circuits.filtersets import CircuitFilterSet, ProviderFilterSet, ProviderNetworkFilterSet
File "/opt/netbox-3.1.8/netbox/circuits/filtersets.py", line 4, in
from dcim.filtersets import CableTerminationFilterSet
File "/opt/netbox-3.1.8/netbox/dcim/filtersets.py", line 5, in
from extras.filtersets import LocalConfigContextFilterSet
File "/opt/netbox-3.1.8/netbox/extras/filtersets.py", line 217, in
class ConfigContextFilterSet(ChangeLoggedModelFilterSet):
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/django_filters/filterset.py", line 71, in new
new_class.base_filters = new_class.get_filters()
File "/opt/netbox-3.1.8/netbox/netbox/filtersets.py", line 188, in get_filters
additional_filters.update(cls.get_additional_lookups(existing_filter_name, existing_filter))
File "/opt/netbox-3.1.8/netbox/netbox/filtersets.py", line 146, in get_additional_lookups
resolve_field(field, lookup_expr) # Will raise FieldLookupError if the lookup is invalid
File "/opt/netbox-3.1.8/venv/lib/python3.10/site-packages/django_filters/utils.py", line 196, in resolve_field
query = model_field.model._default_manager.all().query
AttributeError: 'NoneType' object has no attribute 'model'
Any help will be high appreciated.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions