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
Middleware(s): Nautobot is running on Ubuntu 22.04.3 LTS
Steps to Reproduce
Open nautobot_config.py and go to PLUGINS_CONFIG > nautobot_ssot dictionary.
In our case, we are using the infoblox ssot plugin. Try to insert a key-value pair that has an incorrect logic, like applying .split() to a list. Then save the file.
"infoblox_import_subnets": [x for x in ["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"].split(",") if x]
Note: Tried this one in python (cli). The above should give an AttributeError because a list does not have .split() attribute.
When you run nautobot-server post_upgrade, you'll get an error message about SECRET_KEY being empty, even though it has a value in nautobot_config.py.
nautobot@lab:~$ nautobot-server post_upgrade
Traceback (most recent call last):
File "/opt/nautobot/bin/nautobot-server", line 8, in <module>
sys.exit(main())
File "/opt/nautobot/lib/python3.10/site-packages/nautobot/core/cli/__init__.py", line 52, in main
run_app(
File "/opt/nautobot/lib/python3.10/site-packages/nautobot/core/runner/runner.py", line 297, in run_app
management.execute_from_command_line([runner_name, command, *command_args])
File "/opt/nautobot/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/opt/nautobot/lib/python3.10/site-packages/django/core/management/__init__.py", line 395, in execute
django.setup()
File "/opt/nautobot/lib/python3.10/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/nautobot/lib/python3.10/site-packages/django/apps/registry.py", line 122, in populate
app_config.ready()
File "/opt/nautobot/lib/python3.10/site-packages/nautobot/core/apps/__init__.py", line 846, in ready
super().ready()
File "/opt/nautobot/lib/python3.10/site-packages/nautobot/core/apps/__init__.py", line 68, in ready
registry["new_ui_ready_routes"].update(get_all_new_ui_ready_routes())
File "/opt/nautobot/lib/python3.10/site-packages/nautobot/core/utils/navigation.py", line 47, in get_all_new_ui_ready_routes
url_patterns = resolver.url_patterns
File "/opt/nautobot/lib/python3.10/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/opt/nautobot/lib/python3.10/site-packages/django/urls/resolvers.py", line 602, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/opt/nautobot/lib/python3.10/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/opt/nautobot/lib/python3.10/site-packages/django/urls/resolvers.py", line 595, in urlconf_module
return import_module(self.urlconf_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/nautobot/lib/python3.10/site-packages/nautobot/core/urls.py", line 7, in <module>
from nautobot.core.views import (
File "/opt/nautobot/lib/python3.10/site-packages/nautobot/core/views/__init__.py", line 11, in <module>
from django.contrib.auth.mixins import AccessMixin, LoginRequiredMixin
File "/opt/nautobot/lib/python3.10/site-packages/django/contrib/auth/mixins.py", line 5, in <module>
from django.contrib.auth.views import redirect_to_login
File "/opt/nautobot/lib/python3.10/site-packages/django/contrib/auth/views.py", line 10, in <module>
from django.contrib.auth.forms import (
File "/opt/nautobot/lib/python3.10/site-packages/django/contrib/auth/forms.py", line 11, in <module>
from django.contrib.auth.tokens import default_token_generator
File "/opt/nautobot/lib/python3.10/site-packages/django/contrib/auth/tokens.py", line 117, in <module>
default_token_generator = PasswordResetTokenGenerator()
File "/opt/nautobot/lib/python3.10/site-packages/django/contrib/auth/tokens.py", line 18, in __init__
self.secret = self.secret or settings.SECRET_KEY
File "/opt/nautobot/lib/python3.10/site-packages/django/conf/__init__.py", line 90, in __getattr__
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
Expected Behavior
We were expecting to see the AttributeError instead of the SECRET_KEY being empty.
Observed Behavior
We saw the incorrect error message above. This could be a potential red herring to other engineers too.
The text was updated successfully, but these errors were encountered:
Environment
Steps to Reproduce
"infoblox_import_subnets": [x for x in ["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"].split(",") if x]
Note: Tried this one in python (cli). The above should give an AttributeError because a list does not have
.split()
attribute.nautobot-server post_upgrade
, you'll get an error message about SECRET_KEY being empty, even though it has a value in nautobot_config.py.Expected Behavior
We were expecting to see the AttributeError instead of the SECRET_KEY being empty.
Observed Behavior
We saw the incorrect error message above. This could be a potential red herring to other engineers too.
The text was updated successfully, but these errors were encountered: