jeremyschulman / netbox-plugin-auth-saml2

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

[Question] Netbox 3.0 support #42

Closed tomasaberg closed 3 years ago

tomasaberg commented 3 years ago

EDIT: This can be closed. The error was mine when I tried to upgrade Netbox. This works fine in 3.0

Hi! Netbox 3.0 will be released. As I write this (2021-08-18) beta2 is available. When doing db migrations for the upgrade it get stuck on this plugin.

Do you plan to support Netbox 3.0 (or maybe I'm just doing something wrong and it's already supported)

Edit: more information during upgrade

sudo python3 ./netbox/manage.py migrate 
/opt/netbox/netbox/netbox/settings.py:50: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
  warnings.warn(
/opt/netbox/netbox/netbox/settings.py:50: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
  warnings.warn(
/opt/netbox/netbox/netbox/settings.py:50: UserWarning: The CACHE_TIMEOUT configuration parameter was removed in v3.0.0 and no longer has any effect.
  warnings.warn(
Traceback (most recent call last):
  File "/opt/netbox/netbox/netbox/settings.py", line 577, in <module>
    plugin = importlib.import_module(plugin_name)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'django3_saml2_nbplugin'
[...]
django.core.exceptions.ImproperlyConfigured: Unable to import plugin django3_saml2_nbplugin: Module not found. Check that the plugin module has been installed within the correct Python environment.

However, the plugin is installed

MichalMMac commented 2 years ago

How did you solve it @tomasaberg ?

tomasaberg commented 2 years ago

Hi, sorry for making one of those "oh I fixed it" and not giving the answer :)

The issue was in the ansible role that I've created to deploy netbox, not withing netbox or this plugin. I have the same configuration as I had in the previous version of netbox.

What issues are you facing? Maybe I can help. However, maybe this is of interest 7649

MichalMMac commented 2 years ago

My problem was that netbox-housekeeping image from https://github.com/netbox-community/netbox-docker was crashing because it was missing the django3_saml2_nbplugin (specified in plugin list in configuration/extra.py) Same error as yours.

I had to add this to docker-compose.override.yml:

  netbox-housekeeping:
    image: netbox:latest-plugins

After rebuilding netbox-housekeeping image the error is gone.