taigaio / taiga-docker

Mozilla Public License 2.0
1.22k stars 305 forks source link

[BUG] ValueError: EMAIL_USE_TLS/EMAIL_USE_SSL are mutually exclusive, so only set one of those settings to True. #69

Open swiss-knight opened 2 years ago

swiss-knight commented 2 years ago

Hello, I'm facing an error why trying to sign-up on a self-hosted taiga instance (local network server) :

Describe the bug

.env:

DEFAULT_FROM_EMAIL=no-reply@my-domain.org
EMAIL_HOST=smtp.my-domain.org
EMAIL_PORT=25
EMAIL_HOST_USER=no-reply@my-domain.org
EMAIL_HOST_PASSWORD="************************"
EMAIL_USE_TLS=True
EMAIL_USE_SSL=False

x-environment in docker-compose.yml:

  EMAIL_BACKEND: "django.core.mail.backends.smtp.EmailBackend"
  DEFAULT_FROM_EMAIL:
  EMAIL_USE_TLS:
  EMAIL_USE_SSL:
  EMAIL_HOST:
  EMAIL_PORT:
  EMAIL_HOST_USER:
  EMAIL_HOST_PASSWORD:

docker-compose up -d && docker-compose logs --tail 50 -f taiga-back

--> trying to sign up, clicking on the "sign-up" button after having correctly filled the fields, I'm getting a: "500 Internal server error" with this log:

taiga-back_1             | WARNING  Property: Unknown Property name. [6:51: -webkit-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [6:82: -ms-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [7:23: mso-table-lspace]
taiga-back_1             | WARNING  Property: Unknown Property name. [7:45: mso-table-rspace]
taiga-back_1             | WARNING  Property: Unknown Property name. [8:17: -ms-interpolation-mode]
taiga-back_1             | ERROR    Property: Invalid value for "CSS Level 2.1" property: 0.8rem 3rem [171:17: padding]
taiga-back_1             | ERROR    Property: Invalid value for "CSS Level 2.1" property: 0.5rem [218:5: margin-left]
taiga-back_1             | WARNING  Property: Unknown Property name. [238:55: -webkit-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name.
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: -webkit-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:31: -ms-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: -webkit-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:31: -ms-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: -webkit-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:31: -ms-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: -webkit-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:31: -ms-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: -webkit-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:31: -ms-text-size-adjust]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: mso-table-lspace]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:20: mso-table-rspace]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: mso-table-lspace]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:20: mso-table-rspace]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: -ms-interpolation-mode]
taiga-back_1             | ERROR    Property: Invalid value for "CSS Level 2.1" property: 0.5rem [1:22: margin-left]
taiga-back_1             | ERROR    Property: Invalid value for "CSS Level 2.1" property: 0.8rem 3rem [1:155: padding]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: -ms-interpolation-mode]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: -ms-interpolation-mode]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: -ms-interpolation-mode]
taiga-back_1             | WARNING  Property: Unknown Property name. [1:1: -ms-interpolation-mode]
taiga-back_1             | ERROR:2022-03-17 00:02:17,459: Internal Server Error: /api/v1/auth/register
taiga-back_1             | Traceback (most recent call last):
taiga-back_1             |   File "/opt/venv/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
taiga-back_1             |     response = get_response(request)
taiga-back_1             |   File "/opt/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
taiga-back_1             |     response = self.process_exception_by_middleware(e, request)
taiga-back_1             |   File "/opt/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
taiga-back_1             |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
taiga-back_1             |   File "/taiga-back/taiga/base/api/viewsets.py", line 104, in view
taiga-back_1             |     return self.dispatch(request, *args, **kwargs)
taiga-back_1             |   File "/opt/venv/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
taiga-back_1             |     return view_func(*args, **kwargs)
taiga-back_1             |   File "/taiga-back/taiga/base/api/views.py", line 458, in dispatch
taiga-back_1             |     response = self.handle_exception(exc)
taiga-back_1             |   File "/taiga-back/taiga/base/api/views.py", line 456, in dispatch
taiga-back_1             |     response = handler(request, *args, **kwargs)
taiga-back_1             |   File "/taiga-back/taiga/auth/api.py", line 97, in register
taiga-back_1             |     return self._public_register(request)
taiga-back_1             |   File "/taiga-back/taiga/auth/api.py", line 73, in _public_register
taiga-back_1             |     user = public_register(**data)
taiga-back_1             |   File "/usr/local/lib/python3.7/contextlib.py", line 74, in inner
taiga-back_1             |     return func(*args, **kwds)
taiga-back_1             |   File "/taiga-back/taiga/auth/services.py", line 128, in public_register
taiga-back_1             |     send_register_email(user)
taiga-back_1             |   File "/taiga-back/taiga/auth/services.py", line 62, in send_register_email
taiga-back_1             |     return bool(email.send())
taiga-back_1             |   File "/opt/venv/lib/python3.7/site-packages/django/core/mail/message.py", line 306, in send
taiga-back_1             |     return self.get_connection(fail_silently).send_messages([self])
taiga-back_1             |   File "/opt/venv/lib/python3.7/site-packages/django/core/mail/message.py", line 263, in get_connection
taiga-back_1             |     self.connection = get_connection(fail_silently=fail_silently)
taiga-back_1             |   File "/opt/venv/lib/python3.7/site-packages/django/core/mail/__init__.py", line 35, in get_connection
taiga-back_1             |     return klass(fail_silently=fail_silently, **kwds)
taiga-back_1             |   File "/opt/venv/lib/python3.7/site-packages/django/core/mail/backends/smtp.py", line 33, in __init__
taiga-back_1             |     "EMAIL_USE_TLS/EMAIL_USE_SSL are mutually exclusive, so only set "
taiga-back_1             | ValueError: EMAIL_USE_TLS/EMAIL_USE_SSL are mutually exclusive, so only set one of those settings to True.

I double checked by logging into the taiga-back container, and echoed $EMAIL_USE_TLS --> True and echoed $EMAIL_USE_SSL --> False.

And in my config.py :

#########################################
## EMAIL
#########################################
# https://docs.djangoproject.com/en/3.1/topics/email/
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
CHANGE_NOTIFICATIONS_MIN_INTERVAL = 120  # seconds

DEFAULT_FROM_EMAIL = os.getenv('DEFAULT_FROM_EMAIL')
EMAIL_HOST = os.getenv('EMAIL_HOST')
EMAIL_PORT = os.getenv('EMAIL_PORT')
#EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER')
#EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD')
EMAIL_USE_TLS = os.getenv('EMAIL_USE_TLS')
EMAIL_USE_SSL = os.getenv('EMAIL_USE_SSL')

I'm then wondering why I'm facing this error? Any hints on how to solve it?

How can we reproduce the behavior

Workarounds

Screenshots image

Taiga environment

Self hosted from the main branch.

Desktop (please complete the following information):