You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A very common error is the following output when someone tries to run the Django migrations after installing NetBox DNS:
Traceback (most recent call last):
File "/opt/netbox/netbox/netbox/settings.py", line 759, in <module>
plugin_config: PluginConfig = plugin.config
^^^^^^^^^^^^^
AttributeError: module 'netbox_dns' has no attribute 'config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/netbox/netbox/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/opt/netbox/lib64/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox/lib64/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox/lib64/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox/lib64/python3.11/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/lib64/python3.11/site-packages/django/core/management/base.py", line 103, in wrapper
saved_locale = translation.get_language()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/lib64/python3.11/site-packages/django/utils/translation/__init__.py", line 210, in get_language
return _trans.get_language()
^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/lib64/python3.11/site-packages/django/utils/translation/__init__.py", line 65, in __getattr__
if settings.USE_I18N:
^^^^^^^^^^^^^^^^^
File "/opt/netbox/lib64/python3.11/site-packages/django/conf/__init__.py", line 102, in __getattr__
self._setup(name)
File "/opt/netbox/lib64/python3.11/site-packages/django/conf/__init__.py", line 89, in _setup
self._wrapped = Settings(settings_module)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/lib64/python3.11/site-packages/django/conf/__init__.py", line 217, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/opt/netbox/netbox/netbox/settings.py", line 761, in <module>
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Plugin netbox_dns does not provide a 'config' variable. This should be defined in the plugin's __init__.py file and point to the PluginConfig subclass.
Usually the reason is that the user first installed the PyPI module netbox-dns (which is the old version of this plugin, still available on PyPI, unsupported, unable to run on NetBox 3.5.0 and later, and probably will live forever because the maintainers are gone AWOL).
Then, when the user finds out that this is the case, they install netbox-plugin-dns. Which doesn't work either, because netbox-dns is still around. OK, so now they uninstall netbox-dns, that should be fine, shouldn't it?
No.
When I forked the old netbox-dns project and created netbox-plugin-dns, I tried to keep everyhing as compatible as possible, so I didn't actually change anything apart from the module name. This turned out to be a double-edged sword: Parts of the file tree of netbox-dns and netbox-plugin-dns overlap, so the deinstallation of netbox-dns removes part of the newer plugin.
Everything looks fine in pip freeze, but the module is broken, and the result is the above exception.
Luckily, the remedy is simple:
pip install --force-reinstall netbox-plugin-dns
... and if that doesn't work it's probably permissions, Another story ...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
A very common error is the following output when someone tries to run the Django migrations after installing NetBox DNS:
Usually the reason is that the user first installed the PyPI module
netbox-dns
(which is the old version of this plugin, still available on PyPI, unsupported, unable to run on NetBox 3.5.0 and later, and probably will live forever because the maintainers are gone AWOL).Then, when the user finds out that this is the case, they install
netbox-plugin-dns
. Which doesn't work either, becausenetbox-dns
is still around. OK, so now they uninstallnetbox-dns
, that should be fine, shouldn't it?No.
When I forked the old
netbox-dns
project and creatednetbox-plugin-dns
, I tried to keep everyhing as compatible as possible, so I didn't actually change anything apart from the module name. This turned out to be a double-edged sword: Parts of the file tree ofnetbox-dns
andnetbox-plugin-dns
overlap, so the deinstallation ofnetbox-dns
removes part of the newer plugin.Everything looks fine in
pip freeze
, but the module is broken, and the result is the above exception.Luckily, the remedy is simple:
... and if that doesn't work it's probably permissions, Another story ...
Beta Was this translation helpful? Give feedback.
All reactions