inventree / InvenTree

Open Source Inventory Management System
https://docs.inventree.org
MIT License
4.19k stars 754 forks source link

Internal Error when Attempting to Verify Email Address #5333

Closed antbarney closed 1 year ago

antbarney commented 1 year ago

Please verify that this bug has NOT been raised before.

Describe the bug*

An Internal Error is thrown when following the link to "Verify" an email address

Steps to Reproduce

  1. Send Email Verification email.
  2. Follow the link to verify email address

Expected behaviour

Address is verified

Deployment Method

Version Information

Version Information:

InvenTree-Version: 0.13.0 dev Django Version: 3.2.20 Commit Hash: 9b377cc Commit Date: 2023-07-23

Database: postgresql Debug-Mode: True Deployed using Docker: True Platform: Linux-6.1.34-Unraid-x86_64-with Installer: DOC

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.0.0'}]

Please verify if you can reproduce this bug on the demo site.

Relevant log output

ImproperlyConfigured at /api/auth/registration/account-confirm-email/Mg:1qO0Cd:hlqLndq87ETqUeWWTHXfzPaYql4lxX2IuQLSH3tMe_0/
TemplateResponseMixin requires either a definition of 'template_name' or an implementation of 'get_template_names()'
Request Method: GET
Request URL:    http://10.10.20.10:8000/api/auth/registration/account-confirm-email/Mg:1qO0Cd:hlqLndq87ETqUeWWTHXfzPaYql4lxX2IuQLSH3tMe_0/
Django Version: 3.2.20
Exception Type: ImproperlyConfigured
Exception Value:    
TemplateResponseMixin requires either a definition of 'template_name' or an implementation of 'get_template_names()'
Exception Location: /usr/local/lib/python3.10/site-packages/django/views/generic/base.py, line 147, in get_template_names
Python Executable:  /usr/local/bin/python
Python Version: 3.10.12
Python Path:    
['/home/inventree/InvenTree',
 '/home/inventree',
 '/usr/local/bin',
 '/usr/local/lib/python310.zip',
 '/usr/local/lib/python3.10',
 '/usr/local/lib/python3.10/lib-dynload',
 '/usr/local/lib/python3.10/site-packages',
 '/usr/local/lib/python3.10/site-packages/odf',
 '/usr/local/lib/python3.10/site-packages/odf',
 '/usr/local/lib/python3.10/site-packages/odf',
 '/usr/local/lib/python3.10/site-packages/odf',
 '/usr/local/lib/python3.10/site-packages/odf',
 '/usr/local/lib/python3.10/site-packages/odf',
 '/usr/local/lib/python3.10/site-packages/odf']
Server time:    Mon, 24 Jul 2023 11:31:33 -0700

Environment:

Request Method: GET
Request URL: http://10.10.20.10:8000/api/auth/registration/account-confirm-email/Mg:1qO0Cd:hlqLndq87ETqUeWWTHXfzPaYql4lxX2IuQLSH3tMe_0/

Django Version: 3.2.20
Python Version: 3.10.12
Installed Applications:
['django.contrib.admin',
 'build.apps.BuildConfig',
 'common.apps.CommonConfig',
 'company.apps.CompanyConfig',
 'label.apps.LabelConfig',
 'order.apps.OrderConfig',
 'part.apps.PartConfig',
 'report.apps.ReportConfig',
 'stock.apps.StockConfig',
 'users.apps.UsersConfig',
 'plugin.apps.PluginAppConfig',
 'web',
 'generic',
 'InvenTree.apps.InvenTreeConfig',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'user_sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'maintenance_mode',
 'django_filters',
 'rest_framework',
 'rest_framework.authtoken',
 'corsheaders',
 'crispy_forms',
 'import_export',
 'django_cleanup.apps.CleanupConfig',
 'mptt',
 'markdownify',
 'djmoney',
 'djmoney.contrib.exchange',
 'error_report',
 'django_q',
 'formtools',
 'dbbackup',
 'taggit',
 'flags',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'django_otp',
 'django_otp.plugins.otp_totp',
 'django_otp.plugins.otp_static',
 'allauth_2fa',
 'dj_rest_auth',
 'dj_rest_auth.registration',
 'drf_spectacular',
 'django_ical',
 'sslserver']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'x_forwarded_for.middleware.XForwardedForMiddleware',
 'user_sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'InvenTree.middleware.InvenTreeRemoteUserMiddleware',
 'django_otp.middleware.OTPMiddleware',
 'InvenTree.middleware.CustomAllauthTwoFactorMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'InvenTree.middleware.AuthRequiredMiddleware',
 'InvenTree.middleware.Check2FAMiddleware',
 'maintenance_mode.middleware.MaintenanceModeMiddleware',
 'InvenTree.middleware.InvenTreeExceptionProcessor']

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 160, in get
    return self.render_to_response(context)
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 135, in render_to_response
    template=self.get_template_names(),
  File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 147, in get_template_names
    raise ImproperlyConfigured(

Exception Type: ImproperlyConfigured at /api/auth/registration/account-confirm-email/Mg:1qO0Cd:hlqLndq87ETqUeWWTHXfzPaYql4lxX2IuQLSH3tMe_0/
Exception Value: TemplateResponseMixin requires either a definition of 'template_name' or an implementation of 'get_template_names()'
SchrodingersGat commented 1 year ago

@matmair I can confirm this is an error - you made a recent change to the auth via email, did it touch this?

matmair commented 1 year ago

It did not directly but it seems that the templating names in the library changed; A bit more detailed steps to reproduce would be helpful in the future

SchrodingersGat commented 1 year ago

Steps to reproduce:

  1. Send a confirmation email link to yourself from the settings interface
  2. Click on the link in your inbox
  3. ???

image

mrkylegp commented 1 year ago

Came here to report the same issue.

Version Information: InvenTree-Version: 0.12.2 Django Version: 3.2.19 Commit Hash: 1d51b2a Commit Date: 2023-07-25

Database: postgresql Debug-Mode: False Deployed using Docker: True Platform: Linux-5.4.0-153-generic-x86_64-with-glibc2.36 Installer: DOC

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.0.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}]

Screenshot 2023-07-30 at 2 47 17 pm
sc-steven commented 1 year ago

👍 same issue on my new InvenTree docker setup.