Upgrading from v2.10.x to v2.11.x failing #6271
Replies: 1 comment 4 replies
-
COL_TENANT doesn't appear anywhere in the v2.11.0 source code. In fact, COL_TENANT was removed in this commit from 4 March 2021. However, on my system, it exists in some pre-compiled python bytecode files:
Note: those This makes me think that on your system, you also have some stale pyc files lying around, which can cause old python code to be wrongly run. Therefore, I suggest you delete all netbox pyc files ( The pyc files will be automatically regenerated, as long as the 'netbox' user has write permissions to the source directories. Even if they can't be written it doesn't really matter, it's only an optimisation - although if you want, you can set the permissions so that they can ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Upgrading from a v2.10.x release to v2.11.x is failing and gives the following error : "ImportError: cannot import name 'COL_TENANT' from 'tenancy.tables' (/opt/netbox-2.11.0/netbox/tenancy/tables.py)"
Upgrading from v2.10.8 to v2.10.9 and following to v2.10.10 works perfectly however upgrading to v2.11.x is not working.
Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
File "netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/core/management/init.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/core/management/base.py", line 89, in wrapped
res = handle_func(*args, **kwargs)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 75, in handle
self.check(databases=[database])
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/core/management/base.py", line 419, in check
all_issues = checks.run_checks(
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 412, in check
for pattern in self.url_patterns:
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 598, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 591, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/opt/netbox-2.11.0/netbox/netbox/urls.py", line 8, in
from extras.plugins.urls import plugin_admin_patterns, plugin_patterns, plugin_api_patterns
File "/opt/netbox-2.11.0/netbox/extras/plugins/urls.py", line 28, in
urlpatterns = import_object(f"{plugin_path}.urls.urlpatterns")
File "/opt/netbox-2.11.0/netbox/extras/plugins/utils.py", line 31, in import_object
spec.loader.exec_module(module)
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/config_officer/urls.py", line 2, in
from . import views
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/config_officer/views.py", line 36, in
from .tables import (
File "/opt/netbox-2.11.0/venv/lib/python3.8/site-packages/config_officer/tables.py", line 10, in
from tenancy.tables import COL_TENANT
ImportError: cannot import name 'COL_TENANT' from 'tenancy.tables' (/opt/netbox-2.11.0/netbox/tenancy/tables.py)
Beta Was this translation helpful? Give feedback.
All reactions