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

Netbox 4.2.3 #609

Open
tonnymn opened this issue Feb 11, 2025 · 3 comments
Open

Netbox 4.2.3 #609

tonnymn opened this issue Feb 11, 2025 · 3 comments

Comments

@tonnymn
Copy link

tonnymn commented Feb 11, 2025

NetBox version

v4.2.3

Topology Views version

v4.2.0

Steps to Reproduce

topology viewer 4.2.3 cannot run on netbox 4.2.3. on docker

Expected Behavior

Plugin to run

Observed Behavior

🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/extra.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
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 416, in execute
django.setup()
File "/opt/netbox/venv/lib/python3.12/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/netbox/venv/lib/python3.12/site-packages/django/apps/registry.py", line 124, in populate
app_config.ready()
File "/opt/netbox/venv/lib/python3.12/site-packages/netbox_topology_views/init.py", line 22, in ready
super().ready()
File "/opt/netbox/netbox/netbox/plugins/init.py", line 116, in ready
if template_extensions := self._load_resource('template_extensions'):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/netbox/netbox/plugins/init.py", line 92, in _load_resource
module = import_module(default_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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/venv/lib/python3.12/site-packages/netbox_topology_views/template_content.py", line 6, in
NETBOX_CURRENT_VERSION = version.parse(settings.VERSION)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/packaging/version.py", line 56, in parse
return Version(version)
^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/packaging/version.py", line 202, in init
raise InvalidVersion(f"Invalid version: {version!r}")
packaging.version.InvalidVersion: Invalid version: '4.2.3-Docker-3.2.0'

@tonnymn tonnymn added the type: bug A confirmed report of unexpected behavior in the application label Feb 11, 2025
@JeanKean-art
Copy link

Hello, same issue on same version on my side ;)

@cruse1977
Copy link
Member

cruse1977 commented Feb 13, 2025

This appears to be docker changing the version string on 4.2.3 images - its not a bug in topology views and impacts anything using version.parse(settings.VERSION)

v4.2.3:

`>>> from django.conf import settings

print(version.parse(settings.VERSION))
Traceback (most recent call last):
File "/usr/lib/python3.12/code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "/opt/netbox/venv/lib/python3.12/site-packages/packaging/version.py", line 56, in parse
return Version(version)
^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/packaging/version.py", line 202, in init
raise InvalidVersion(f"Invalid version: {version!r}")
packaging.version.InvalidVersion: Invalid version: '4.2.3-Docker-3.2.0'
`

vs 4.2.2

`>>> from django.conf import settings

from packaging import version
print(version.parse(settings.VERSION))
4.2.2`

@cruse1977 cruse1977 removed the type: bug A confirmed report of unexpected behavior in the application label Feb 13, 2025
@cruse1977
Copy link
Member

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

No branches or pull requests

3 participants