Hi,
I tried to get the Sentry up and running using docker-compose. It seems to work and I can log events. But Sentry is not sending emails. Where should I specify SMTP configuration?
I tried to put it into config.yml and docker-compose.yml file using ENV variables. But I still see this error in a log file:
10:50:14 [ERROR] celery.worker.job: Task sentry.tasks.email.send_email[fef406ee-af45-4ae6-b163-a27d6cf6c0cc] raised unexpected: SMTPServerDisconnected('Connection unexpectedly closed: timed out',) (data={u'hostname': 'celery@2173820268c7', u'name': 'sentry.tasks.email.send_email', u'args': '[]', u'internal': False, u'kwargs': "{'message': <django.core.mail.message.EmailMultiAlternatives object at 0x7fb3f5666050>}", u'id': 'fef406ee-af45-4ae6-b163-a27d6cf6c0cc'})
Check the environment variables - https://github.com/getsentry/onpremise/blob/master/sentry.conf.py#L4
I have these:
SENTRY_EMAIL_HOST: "my-host"
SENTRY_EMAIL_PORT: 465
SENTRY_EMAIL_USER: "[email protected]"
SENTRY_EMAIL_PASSWORD: "secret"
SENTRY_EMAIL_USE_TLS:
SENTRY_ENABLE_EMAIL_REPLIES:
Are they correct or should I use them differently or different variables?
@CrNix where do you get the logs from?
@brunis These are from worker container logs:
docker logs worker
But have it already running. Problem was that original SMTP configuration had problems with SMTP server using encryption (TLS).
My colleague found out how to fix this so I'll ask him and I'll post a solution later.
OK, this is what helped. First install django-smtp-ssl which supports ssl:
sudo pip install -U django-smtp-ssl
Than you can use this configuration:
mail.backend: 'django_smtp_ssl.SSLEmailBackend'
mail.use-tls: true
好的,这是有帮助的。首先安装支持ssl的django-smtp-ssl:
sudo pip install -U django-smtp-ssl你可以使用这个配置:
mail.backend: 'django_smtp_ssl.SSLEmailBackend' mail.use-tls: true
Which docker container do you install django-smtp-ssl into?
Has been solved, it can be installed in the web container
it works!
I installed in 'onpremise_worker_1','onpremise_web_1' and 'onpremise_cron_1'
Closing this out as SSL is a very old protocol and we already support TLS for e-mails which is the way to go. Feel free to open a new issue with the e-mail host provider details for us to reeavaluate.
OK, this is what helped. First install django-smtp-ssl which supports ssl:
sudo pip install -U django-smtp-sslThan you can use this configuration:
mail.backend: 'django_smtp_ssl.SSLEmailBackend' mail.use-tls: true
I still can't send a mail
@cdd111 - please use the forums: create a new topic with your Sentry version, installation method, and full mail configuration so people there can help you.
it works!
I installed in 'onpremise_worker_1','onpremise_web_1' and 'onpremise_cron_1'
Could you tell me the specific shell scripts. I'm not familiar with docker.
OK, this is what helped. First install django-smtp-ssl which supports ssl:
sudo pip install -U django-smtp-sslThan you can use this configuration:
mail.backend: 'django_smtp_ssl.SSLEmailBackend' mail.use-tls: true
I needed this command in two containers: web and work
sudo pip install -U django-smtp-sslThis works for me, I'm running with docker swarm.
Thanks.
@luizjr if you put django-smtp-ssl==1.0 in sentry/requirements.txt before running the install script, it would take care of it for all your containers.
Unfortunately this problem persist even on 20.7.0.dev0. Had to install django-smtp-ssl to send the invite emails. And sadly even after updating the workers don't pick up the config, test mail from manage/status/mail/ page will work perfectly.
Don't forget to do a docker-compose down and up to let the workers pick up the new config.
Most helpful comment
@luizjr if you put
django-smtp-ssl==1.0insentry/requirements.txtbefore running the install script, it would take care of it for all your containers.