Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install to netbox 4.x fails #14

Closed
goteamkor opened this issue Jul 6, 2024 · 6 comments · Fixed by #15
Closed

install to netbox 4.x fails #14

goteamkor opened this issue Jul 6, 2024 · 6 comments · Fixed by #15

Comments

@goteamkor
Copy link

Not sure what modifications need to be made to support the new netbox 4.x train, but I tried to install the plugin using the instructions and it fails. Causes netbox to spit out a 503 when accessed.

@eduuTr
Copy link

eduuTr commented Jul 19, 2024

I've problems to install too, i cant install due this error bellow:

File "/opt/netbox-4.0.7/venv/lib64/python3.12/site-packages/nb_service/init.py", line 1, in
from extras.plugins import PluginConfig
ModuleNotFoundError: No module named 'extras.plugins'

@renatoalmeidaoliveira
Copy link
Owner

@eduuTr , @goteamkor, Just updated the plugin for NetBox v4.0.x please test with:
pip install -U nb-service==3.0.0

@goteamkor
Copy link
Author

still fails.

if I do the pip install and just restart netbox I get the internal server error. If I run upgrade.sh it fails here.

Requirement already satisfied: asgiref<4,>=3.7.0 in ./venv/lib/python3.12/site-packages (from django>=2.2.16->drf-yasg->nb-service->-r local_requirements.txt (line 3)) (3.8.1)
Requirement already satisfied: sqlparse>=0.3.1 in ./venv/lib/python3.12/site-packages (from django>=2.2.16->drf-yasg->nb-service->-r local_requirements.txt (line 3)) (0.5.1)
Using cached netbox_reorder_rack-1.1.1-py3-none-any.whl (70 kB)
Downloading netbox_data_flows-1.0.3-py3-none-any.whl (72 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.9/72.9 kB 3.9 MB/s eta 0:00:00
Using cached nb_service-3.0.0-py3-none-any.whl (1.0 MB)
Using cached drf_yasg-1.21.7-py3-none-any.whl (4.3 MB)
Using cached pytz-2024.1-py2.py3-none-any.whl (505 kB)
Installing collected packages: pytz, netbox-reorder-rack, netbox-data-flows, drf-yasg, nb-service
Successfully installed drf-yasg-1.21.7 nb-service-3.0.0 netbox-data-flows-1.0.3 netbox-reorder-rack-1.1.1 pytz-2024.1
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/lib/python3.12/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 107, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/commands/migrate.py", line 100, in handle
self.check(databases=[database])
File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 486, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 42, in check_url_namespaces_unique
all_namespaces = _load_all_namespaces(resolver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 61, in _load_all_namespaces
url_patterns = getattr(resolver, "url_patterns", [])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/utils/functional.py", line 47, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 738, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/utils/functional.py", line 47, in get
res = instance.dict[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 731, in urlconf_module
return import_module(self.urlconf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "/opt/netbox/netbox/netbox/urls.py", line 12, in
from netbox.plugins.urls import plugin_patterns, plugin_api_patterns
File "/opt/netbox/netbox/netbox/plugins/urls.py", line 35, in
urlpatterns = import_string(f"{plugin_path}.api.urls.urlpatterns")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/utils/module_loading.py", line 30, in import_string
return cached_import(module_path, class_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/utils/module_loading.py", line 15, in cached_import
module = import_module(module_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/nb_service/api/urls.py", line 2, in
from . import views
File "/opt/netbox/venv/lib/python3.12/site-packages/nb_service/api/views.py", line 5, in
from . import serializers
File "/opt/netbox/venv/lib/python3.12/site-packages/nb_service/api/serializers.py", line 1, in
from drf_yasg.utils import swagger_serializer_method
File "/opt/netbox/venv/lib/python3.12/site-packages/drf_yasg/init.py", line 2, in
from pkg_resources import DistributionNotFound, get_distribution
ModuleNotFoundError: No module named 'pkg_resources'

@renatoalmeidaoliveira
Copy link
Owner

Thanks @goteamkor it seens something related with drf_yasg. It doesn't support python 3.12 yet axnsan12/drf-yasg#874
I can make some changes on the plugin to remove it and support python 3.12.

@goteamkor
Copy link
Author

are there any updates on this?

@renatoalmeidaoliveira
Copy link
Owner

@goteamkor fixed, please update the plugin, to v3.0.1 for NetBox 4.0.x, or v4.0.0 for NetBox v4.1.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants