netbox-community / netbox-floorplan-plugin

NetBox Floorplan plugin
GNU Lesser General Public License v3.0
54 stars 14 forks source link

Database migrations fail when trying to install #28

Closed NiFuAxians closed 3 months ago

NiFuAxians commented 3 months ago

I have netbox 4.0.2 and when installing this plugin the database migrations throw errors.

Traceback (most recent call last):
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/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/lib64/python3.12/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/django/core/management/base.py", line 104, in wrapper
    saved_locale = translation.get_language()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/django/utils/translation/__init__.py", line 211, in get_language
    return _trans.get_language()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/django/utils/translation/__init__.py", line 66, in __getattr__
    if settings.USE_I18N:
       ^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/django/conf/__init__.py", line 89, in __getattr__
    self._setup(name)
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/django/conf/__init__.py", line 76, in _setup
    self._wrapped = Settings(settings_module)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/django/conf/__init__.py", line 190, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, 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/lib64/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/netbox_floorplan/__init__.py", line 1, 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/lib64/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/netbox-4.0.2/venv/lib64/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-4.0.2/venv/lib64/python3.12/site-packages/django/core/management/base.py", line 426, in run_from_argv
    connections.close_all()
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/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/lib64/python3.12/site-packages/django/utils/connection.py", line 76, in all
    return [
           ^
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/django/utils/connection.py", line 73, in __iter__
    return iter(self.settings)
                ^^^^^^^^^^^^^
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/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/lib64/python3.12/site-packages/django/utils/connection.py", line 45, in settings
    self._settings = self.configure_settings(self._settings)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/django/db/utils.py", line 148, in configure_settings
    databases = super().configure_settings(databases)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/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/lib64/python3.12/site-packages/django/conf/__init__.py", line 89, in __getattr__
    self._setup(name)
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/django/conf/__init__.py", line 76, in _setup
    self._wrapped = Settings(settings_module)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/django/conf/__init__.py", line 190, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, 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/lib64/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/opt/netbox-4.0.2/venv/lib64/python3.12/site-packages/netbox_floorplan/__init__.py", line 1, in <module>
    from extras.plugins import PluginConfig
ModuleNotFoundError: No module named 'extras.plugins'

Also I noticed when installing this plugin, that for some reason it seems to install the 0.3.6 version instead of 0.4.x. Is there a way to manually install the current version of the plugin? That might fix my issue. Using python12

brandan-schmitz commented 3 months ago

It looks like they have merged the changes for their 0.4.0 release however they have not actually fully followed through with the process of actually creating a GitHub release as of yet. Without them doing that it does not look like it will build and publish the packages to the respective repositories.

cruse1977 commented 3 months ago

It looks like they have merged the changes for their 0.4.0 release however they have not actually fully followed through with the process of actually creating a GitHub release as of yet.

The release was paused due some issues reported with another 4.x release of another plugin and we wanted to ensure there was no obvious gotcha's missed there before this was released.

As things stand, we cannot replicate that issue so this will be released following an additional PR to include a min version on setup ; which would prevent issues like this going forward.

Should be released within the next 24 hours or so.

cruse1977 commented 3 months ago

https://pypi.org/project/netbox-floorplan-plugin/ - 0.4.0 released.