Error during upgrade 2.1.3 to 2.1.5 #1284

Closed
opened 2025-12-29 16:31:04 +01:00 by adam · 2 comments
Owner

Originally created by @brianblac on GitHub (Oct 6, 2017).

When upgrading 2.1.3 to 2.1.5 I get the following error during ./upgrade.sh

When browsing to the website, Internal Server Error is displayed.

Applying database migrations (python netbox/manage.py migrate)...
Traceback (most recent call last):
File "netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 327, in execute
self.check()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
issues.extend(super(Command, self)._run_checks(**kwargs))
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/opt/netbox/netbox/netbox/urls.py", line 3, in
from rest_framework_swagger.views import get_swagger_view
File "/usr/local/lib/python2.7/dist-packages/rest_framework_swagger/views.py", line 5, in
from rest_framework.schemas import SchemaGenerator
File "/usr/local/lib/python2.7/dist-packages/rest_framework/schemas/init.py", line 32, in
authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
File "/usr/local/lib/python2.7/dist-packages/rest_framework/settings.py", line 223, in getattr
val = perform_import(val, attr)
File "/usr/local/lib/python2.7/dist-packages/rest_framework/settings.py", line 168, in perform_import
return [import_from_string(item, setting_name) for item in val]
File "/usr/local/lib/python2.7/dist-packages/rest_framework/settings.py", line 184, in import_from_string
raise ImportError(msg)
ImportError: Could not import 'utilities.api.TokenAuthentication' for API setting 'DEFAULT_AUTHENTICATION_CLASSES'. ImportError: cannot import name is_authenticated.
Collecting static files (python netbox/manage.py collectstatic --no-input)...

0 static files copied to '/opt/netbox/netbox/static', 264 unmodified.

Originally created by @brianblac on GitHub (Oct 6, 2017). When upgrading 2.1.3 to 2.1.5 I get the following error during ./upgrade.sh When browsing to the website, Internal Server Error is displayed. Applying database migrations (python netbox/manage.py migrate)... Traceback (most recent call last): File "netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 356, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 327, in execute self.check() File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 359, in check include_deployment_checks=include_deployment_checks, File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 62, in _run_checks issues.extend(super(Command, self)._run_checks(**kwargs)) File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 346, in _run_checks return checks.run_checks(**kwargs) File "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py", line 81, in run_checks new_errors = check(app_configs=app_configs) File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 16, in check_url_config return check_resolver(resolver) File "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line 26, in check_resolver return check_method() File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 254, in check for pattern in self.url_patterns: File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 405, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 35, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/usr/local/lib/python2.7/dist-packages/django/urls/resolvers.py", line 398, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/opt/netbox/netbox/netbox/urls.py", line 3, in <module> from rest_framework_swagger.views import get_swagger_view File "/usr/local/lib/python2.7/dist-packages/rest_framework_swagger/views.py", line 5, in <module> from rest_framework.schemas import SchemaGenerator File "/usr/local/lib/python2.7/dist-packages/rest_framework/schemas/__init__.py", line 32, in <module> authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES, File "/usr/local/lib/python2.7/dist-packages/rest_framework/settings.py", line 223, in __getattr__ val = perform_import(val, attr) File "/usr/local/lib/python2.7/dist-packages/rest_framework/settings.py", line 168, in perform_import return [import_from_string(item, setting_name) for item in val] File "/usr/local/lib/python2.7/dist-packages/rest_framework/settings.py", line 184, in import_from_string raise ImportError(msg) ImportError: Could not import 'utilities.api.TokenAuthentication' for API setting 'DEFAULT_AUTHENTICATION_CLASSES'. ImportError: cannot import name is_authenticated. Collecting static files (python netbox/manage.py collectstatic --no-input)... 0 static files copied to '/opt/netbox/netbox/static', 264 unmodified.
adam closed this issue 2025-12-29 16:31:04 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 6, 2017):

Thank you for your interest in NetBox. GitHub issues are intended for reporting bugs and requesting features, and must be submitted using the template provided here. For general discussion, questions, or assistance with installation issues, please post to our mailing list.

@jeremystretch commented on GitHub (Oct 6, 2017): Thank you for your interest in NetBox. GitHub issues are intended for reporting bugs and requesting features, and must be submitted using the template provided [here](https://raw.githubusercontent.com/digitalocean/netbox/develop/.github/ISSUE_TEMPLATE.md). For general discussion, questions, or assistance with installation issues, please post to our [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss).
Author
Owner

@brianblac commented on GitHub (Oct 6, 2017):

My apologies.

@brianblac commented on GitHub (Oct 6, 2017): My apologies.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1284