ImportError on database migration #468
Replies: 8 comments
-
Hi,
That's strange, the EventRulesMixin still exists although I have not tested with 3.7.1 yet.
I will see if I can replicate the issue.
…________________________________
From: darkcloud784 ***@***.***>
Sent: Tuesday, January 30, 2024 5:19:41 AM
To: mattieserver/netbox-topology-views ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [mattieserver/netbox-topology-views] ImportError on database migration (Issue #451)
NetBox version
3.7.1
Topology Views version
3.9.0
Steps to Reproduce
Install plugin as directed in the readme.
Apply database migrations by running manage.py
I also tried adding this to my local_requirements.txt, and configuration.py then allowing the netbox update script install the packages and run the migrations, same result.
Expected Behavior
Apply database migrations and everything be groovy
Observed Behavior
On applying database migrations I get the following.
Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
File "/opt/netbox/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox/venv/lib64/python3.9/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib64/python3.9/site-packages/django/core/management/init.py", line 416, in execute
django.setup()
File "/opt/netbox/venv/lib64/python3.9/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/netbox/venv/lib64/python3.9/site-packages/django/apps/registry.py", line 116, in populate
app_config.import_models()
File "/opt/netbox/venv/lib64/python3.9/site-packages/django/apps/config.py", line 269, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib64/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/opt/netbox/venv/lib64/python3.9/site-packages/netbox_topology_views/models.py", line 13, in
from netbox.models.features import (
ImportError: cannot import name 'EventRulesMixin' from 'netbox.models.features
—
Reply to this email directly, view it on GitHub<#451>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAXITDGY5CJBN7CMNM3FUWTYRBYF3AVCNFSM6AAAAABCQRXL3OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYDMOJSGIZTGMQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thanks, |
Beta Was this translation helpful? Give feedback.
-
I just had the same issue, but realized that pip installed 3.7.0 by default. After running
Everything works fine: Running migrations: |
Beta Was this translation helpful? Give feedback.
-
I also just tried and got the same error. Netbox v 3.6.9. Was able to successfully migrate after doing pip install netbox-topology-views==3.8.1 |
Beta Was this translation helpful? Give feedback.
-
I attempted this but looks like its already installed. Requirement already satisfied: netbox-topology-views==3.9.0 in /opt/netbox/venv/lib/python3.9/site-packages (3.9.0) |
Beta Was this translation helpful? Give feedback.
-
This seems to work, but I have to install this version on every upgrade otherwise it fails. |
Beta Was this translation helpful? Give feedback.
-
You have to write the explicit version into the local_requirements.txt if you want to install with updates automatically. Otherwise the current version from https://pypi.org/project/netbox-topology-views/ is used. I wonder if this is really considered as a bug. Seems to be a discussion thread in my opinion. |
Beta Was this translation helpful? Give feedback.
-
Moved to Q&A. |
Beta Was this translation helpful? Give feedback.
-
NetBox version
3.7.1
Topology Views version
3.9.0
Steps to Reproduce
Install plugin as directed in the readme.
Apply database migrations by running manage.py
I also tried adding this to my local_requirements.txt, and configuration.py then allowing the netbox update script install the packages and run the migrations, same result.
Expected Behavior
Apply database migrations and everything be groovy
Observed Behavior
On applying database migrations I get the following.
Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
File "/opt/netbox/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox/venv/lib64/python3.9/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib64/python3.9/site-packages/django/core/management/init.py", line 416, in execute
django.setup()
File "/opt/netbox/venv/lib64/python3.9/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/netbox/venv/lib64/python3.9/site-packages/django/apps/registry.py", line 116, in populate
app_config.import_models()
File "/opt/netbox/venv/lib64/python3.9/site-packages/django/apps/config.py", line 269, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib64/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/opt/netbox/venv/lib64/python3.9/site-packages/netbox_topology_views/models.py", line 13, in
from netbox.models.features import (
ImportError: cannot import name 'EventRulesMixin' from 'netbox.models.features
Beta Was this translation helpful? Give feedback.
All reactions