jeremyschulman / netbox-plugin-auth-saml2

Netbox plugin for SSO using SAML2
119 stars 23 forks source link

NetBox-v4.0.0 #80

Closed HungryHowies closed 6 months ago

HungryHowies commented 6 months ago

All,

I've used this plugin for a while now but I'm running into a compatibility issue ( I think) with NetBox-4.0.2

Netbox instance is running on Ubuntu 22.0.4, Python 3.10.12.

I upgraded to the latest version of 3.7.8. Everything worked as expected.

When upgrading to version 4.0.2 using the upgrade script, I received the following errors:

Successfully installed PyJWT-1.7.1 django-rest-auth-0.9.5 django3-auth-saml2-0.6.1 django_saml2_auth-2.2.1 djangorestframework-jwt-1.11.0 elementpath-4.4.0 netbox-plugin-auth-saml2-2.4 pyopenssl-24.1.0 pysaml2-7.5.0 pytz-2024.1 xmlschema-2.5.1
Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/core/management/base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/core/management/base.py", line 104, in wrapper
    saved_locale = translation.get_language()
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/utils/translation/__init__.py", line 211, in get_language
    return _trans.get_language()
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/utils/translation/__init__.py", line 66, in __getattr__
    if settings.USE_I18N:
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 89, in __getattr__
    self._setup(name)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 76, in _setup
    self._wrapped = Settings(settings_module)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 190, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/netbox-4.0.2/netbox/netbox/settings.py", line 750, in <module>
    raise e
  File "/opt/netbox-4.0.2/netbox/netbox/settings.py", line 743, in <module>
    plugin = importlib.import_module(plugin_name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django3_saml2_nbplugin/__init__.py", line 11, in <module>
    from extras.plugins import PluginConfig
ModuleNotFoundError: No module named 'extras.plugins'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/netbox-4.0.2/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/core/management/base.py", line 426, in run_from_argv
    connections.close_all()
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/utils/connection.py", line 84, in close_all
    for conn in self.all(initialized_only=True):
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/utils/connection.py", line 76, in all
    return [
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/utils/connection.py", line 73, in __iter__
    return iter(self.settings)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/utils/functional.py", line 47, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/utils/connection.py", line 45, in settings
    self._settings = self.configure_settings(self._settings)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/db/utils.py", line 148, in configure_settings
    databases = super().configure_settings(databases)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/utils/connection.py", line 50, in configure_settings
    settings = getattr(django_settings, self.settings_name)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 89, in __getattr__
    self._setup(name)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 76, in _setup
    self._wrapped = Settings(settings_module)
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django/conf/__init__.py", line 190, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/netbox-4.0.2/netbox/netbox/settings.py", line 750, in <module>
    raise e
  File "/opt/netbox-4.0.2/netbox/netbox/settings.py", line 743, in <module>
    plugin = importlib.import_module(plugin_name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/netbox-4.0.2/venv/lib/python3.10/site-packages/django3_saml2_nbplugin/__init__.py", line 11, in <module>
    from extras.plugins import PluginConfig
ModuleNotFoundError: No module named 'extras.plugins'

I looks like NetBox-v4 just came out so this is probably expected. I just want to give head up, we end up stay on version 3.7.8 for now.

markkuleinio commented 6 months ago

FYI: https://github.com/jeremyschulman/netbox-plugin-auth-saml2/pull/79

HungryHowies commented 6 months ago

FYI: #79 Ah Thank you..

jeremyschulman commented 6 months ago

New version 3.0 just released to PyPi. Thank you @ProbstenHias

HungryHowies commented 6 months ago

Thank you @ProbstenHias , no issues at all, works great