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

New docker versioning - Use new version identifier from Netbox #67

Closed
Kani999 opened this issue Mar 18, 2025 · 5 comments
Closed

New docker versioning - Use new version identifier from Netbox #67

Kani999 opened this issue Mar 18, 2025 · 5 comments
Labels
bug Something isn't working status: needs triage This issue is awaiting triage by a maintainer

Comments

@Kani999
Copy link

Kani999 commented Mar 18, 2025

Diode version

v0.6.0

Deployment type

docker compose

Deployment type version

v4.2.3-Docker-3.2.0

Diode SDK type

diode-sdk-python

Diode SDK version

v0.4.0

Diode NetBox Plugin version

v0.6.0

NetBox version

v4.2.3

Steps to reproduce

With the new way of versioning docker Netbox, I can't install the plugin.

This was old style, which works well:
v4.2.2

But there is new one:
v4.2.3-Docker-3.2.0

This produce error on installation:

netbox-docker_netbox-worker_1 exited with code 1
netbox_1               | 🧬 loaded config '/etc/netbox/config/configuration.py'
netbox_1               | 🧬 loaded config '/etc/netbox/config/extra.py'
netbox_1               | 🧬 loaded config '/etc/netbox/config/logging.py'
netbox_1               | 🧬 loaded config '/etc/netbox/config/plugins.py'
netbox_1               | Plugin Reloader: Registered 1 previously missed models
netbox_1               | Traceback (most recent call last):
netbox_1               |   File "/opt/netbox/netbox/./manage.py", line 10, in <module>
netbox_1               |     execute_from_command_line(sys.argv)
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
netbox_1               |     utility.execute()
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
netbox_1               |     self.fetch_command(subcommand).run_from_argv(self.argv)
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
netbox_1               |     self.execute(*args, **cmd_options)
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 454, in execute
netbox_1               |     self.check()
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 486, in check
netbox_1               |     all_issues = checks.run_checks(
netbox_1               |                  ^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/checks/registry.py", line 88, in run_checks
netbox_1               |     new_errors = check(app_configs=app_configs, databases=databases)
netbox_1               |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 44, in check_url_namespaces_unique
netbox_1               |     all_namespaces = _load_all_namespaces(resolver)
netbox_1               |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 63, in _load_all_namespaces
netbox_1               |     url_patterns = getattr(resolver, "url_patterns", [])
netbox_1               |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/utils/functional.py", line 47, in __get__
netbox_1               |     res = instance.__dict__[self.name] = self.func(instance)
netbox_1               |                                          ^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 718, in url_patterns
netbox_1               |     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
netbox_1               |                        ^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/utils/functional.py", line 47, in __get__
netbox_1               |     res = instance.__dict__[self.name] = self.func(instance)
netbox_1               |                                          ^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 711, in urlconf_module
netbox_1               |     return import_module(self.urlconf_name)
netbox_1               |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
netbox_1               |     return _bootstrap._gcd_import(name[level:], package, level)
netbox_1               |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
netbox_1               |   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
netbox_1               |   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
netbox_1               |   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
netbox_1               |   File "<frozen importlib._bootstrap_external>", line 995, in exec_module
netbox_1               |   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
netbox_1               |   File "/opt/netbox/netbox/netbox/urls.py", line 11, in <module>
netbox_1               |     from netbox.plugins.urls import plugin_patterns, plugin_api_patterns
netbox_1               |   File "/opt/netbox/netbox/netbox/plugins/urls.py", line 26, in <module>
netbox_1               |     urlpatterns = import_string(f"{plugin_path}.urls.urlpatterns")
netbox_1               |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/utils/module_loading.py", line 30, in import_string
netbox_1               |     return cached_import(module_path, class_name)
netbox_1               |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/django/utils/module_loading.py", line 15, in cached_import
netbox_1               |     module = import_module(module_path)
netbox_1               |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
netbox_1               |     return _bootstrap._gcd_import(name[level:], package, level)
netbox_1               |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/netbox_diode_plugin/urls.py", line 7, in <module>
netbox_1               |     from . import views
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/netbox_diode_plugin/views.py", line 26, in <module>
netbox_1               |     from netbox_diode_plugin.tables import IngestionLogsTable
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/netbox_diode_plugin/tables.py", line 11, in <module>
netbox_1               |     if version.parse(settings.VERSION).major >= 4:
netbox_1               |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/packaging/version.py", line 56, in parse
netbox_1               |     return Version(version)
netbox_1               |            ^^^^^^^^^^^^^^^^
netbox_1               |   File "/opt/netbox/venv/lib/python3.12/site-packages/packaging/version.py", line 202, in __init__
netbox_1               |     raise InvalidVersion(f"Invalid version: {version!r}")
netbox_1               | packaging.version.InvalidVersion: Invalid version: '4.2.3-Docker-3.2.0'
netbox_1               | ⏳ Waiting on DB... (0s / 30s)

Expected behavior

use proper version. It can be better to use
settings.RELEASE.version

settings.RELEASE.version
'4.2.3'

Observed behavior

Cannot install plugin

@Kani999 Kani999 added bug Something isn't working status: needs triage This issue is awaiting triage by a maintainer labels Mar 18, 2025
@Kani999 Kani999 changed the title a New docker versioning - Use new version identifier from Netbox Mar 18, 2025
@mfiedorowicz
Copy link
Member

Hi @Kani999, the issue is on recent netbox-docker in first place and then in the plugin when parsing invalid version as reported, the fix #59 is in review

@Kani999
Copy link
Author

Kani999 commented Mar 18, 2025

Hi @mfiedorowicz, I apologize for missing the Pull Request. I will now close the associated issue.

I made the same changes Kani999@83490b4 , and it's working for me. I see you already included them in the PR #59

@Kani999 Kani999 closed this as completed Mar 18, 2025
@djagoo
Copy link

djagoo commented Mar 22, 2025

Just stumbled upon this error myself and found this closed issue. Maybe it's better to reopen it till PR #59 gets merged.

@RedLine89
Copy link

Just stumbled upon this error myself and found this closed issue. Maybe it's better to reopen it till PR #59 gets merged.

Same here.. The fix is not pushed yet

@RedLine89
Copy link

Plugin installation is failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status: needs triage This issue is awaiting triage by a maintainer
Projects
None yet
Development

No branches or pull requests

4 participants