SMTP configuration for my on premise sentry running on docker

Okay sorry, new direction :slight_smile:

So, first of all, delete the new on-premise installation first:

docker-compose down --remove-orphans --rmi local -v
docker volume rm sentry-clickhouse
docker volume rm sentry-data
docker volume rm sentry-postgres
docker volume rm sentry-redis
docker volume rm sentry-kafka
docker volume rm sentry-zookeeper
docker volume rm sentry-symbolicator

This should remove everything the onpremise repo created, including its data.

Now you need to do:

docker inspect sentry-redis
docker inspect sentry-postgres
docker inspect my-sentry

To find which volume is used by which container. Note the output of these docker inspect calls as now we’ll use them to rename these unnamed volumes.

First, create the named, empty volumes:

docker volume create sentry-data
docker volume create sentry-postgres
docker volume create sentry-redis

Then copy from the old unnamed to new, named volumes:

docker run --rm -v <volume_name_used_by_sentry-postgres>:/from -v sentry-postgres:/to alpine ash -c "cd /from ; cp -av . /to"
docker run --rm -v <volume_name_used_by_sentry-redis>:/from -v sentry-redis:/to alpine ash -c "cd /from ; cp -av . /to"
docker run --rm -v <volume_name_used_by_my-sentry>:/from -v sentry-data:/to alpine ash -c "cd /from ; cp -av . /to"

Once this is done, when you run ./install.sh it should now take your old data and upgrade it. If this works well, you can then delete all the old stuff (the my-sentry, sentry-postgres containers etc. and all associated unnamed volumes).

Hope this helps.

@BYK I have tried the steps mentioned above to install the latest version 20.8.0 but getting below error. Can you please suggest me with next steps.

Can you share the full install log? Have you modified your docker-compos.yml file or any other configuration?

@BYK Thanks for the update - I have now attached the full log for your reference. I did not modify docker-compos.yml but i have modifed install.sh file as suggested by you in Onpremise sentry 10 installation issue - #5 by spalugula

Thanks,
Sunil Palugula

@BYK Can you please see above full log and let me know the next steps.

Note: I am able to install latest version without any issues with out performing below steps suggested by you.

Thanks,
Sunil Palugula

Hi Team,

Can someone please help me with the issue?

Thanks in Advance.

Thanks,
Sunil Palugula

Looks like you had some networking issues during the install phase. I’d just try running it again. This is visible from the logs and we expect self-hosted users to debug these issues themselves.

Of course you can but you’d start with an empty state, losing all your old data.

Hi @BYK, I am not able to figure out the issue as i am new to docker as well as sentry so can you please help me out.

Thanks,
Sunil Palugula

We do not recommend running self-hosted Sentry for anything serious or in production capacity if you don’t feel like you can unblock yourself as this won’t be your first struggle as you scale up.

If you are doing this mostly as a learning experience, you should be able to find resources online to unblock yourself. If, however, this is going to be used by any production service, I strongly recommend going with our hosted sentry.io solution due to reasons mentioned above.

Hi @BYK
Thanks for the update, I have now installed latest version of Sentry 20.8.0 and configured email using below parameters in config.yml file but still we are getting following error ‘SMTP AUTH extension not supported by server’ even though if we mail.use-tls as false or true

Note: We are able to send emails from telnet client from the same server where we are installing sentry but getting issue from sentry UI.

mail.backend: ‘smtp’ # Use dummy if you want to disable email entirely

mail.host: ‘x.x.x.x’
mail.port: 25
mail.username: ‘sentry@example.com’
mail.password: ‘xxxxxx’
mail.use-tls: false

The email address to send on behalf of

mail.from: ‘sentry@example.com’

Thanks,
Sunil Palugula

Have you tried using the ports 587 or 465 as they are the preferred ones for secure hand shakes? If that doesn’t work you can try setting EMAIL_USE_SSL=True in your sentry.conf.py file while making sure mail.use-tls is set to false in your config.yml file.

I have tried the solution mentioned above but we are now getting different error.

image

Note: When we use 587 or 465 we are getting “[Errno 111] Connection refused” I have verified and we are not able to telnet those ports on SMTP server.

Thanks,
Sunil Palugula

That indicates the SMTP server is not using SSL. At this point I’m out of ideas. If your SMTP server is only listening on port 25 and it is refusing SSL, I’d guess it is not using any encryption so you should set use-tls and EMAIL_USE_SSL to False. This also makes sense as you can login via telnet.

Hi @BYK When we set both use-tls and EMAIL_USE_SSL to False sentry is not starting and we are seeing below issue in the sentry web container log and if we only set use-tls to false and if we remove MAIL_USE_SSL then we are seeing same error as earlier - “STARTTLS extension not supported by server.”

I have requested our IT team to open secure port and they have suggested me to use smtp.office365.com but i am still waiting for their final confirmation and i will give a try with the above and let you know my results as soon as i am done.

!! Configuration error: NameError: name ‘false’ is not defined
!! Configuration error: NameError: name ‘false’ is not defined
!! Configuration error: NameError: name ‘false’ is not defined
!! Configuration error: NameError: name ‘false’ is not defined
!! Configuration error: NameError: name ‘false’ is not defined
!! Configuration error: NameError: name ‘false’ is not defined
!! Configuration error: NameError: name ‘false’ is not defined
!! Configuration error: NameError: name ‘false’ is not defined
!! Configuration error: NameError: name ‘false’ is not defined
!! Configuration error: NameError: name ‘false’ is not defined
!! Configuration error: NameError: name ‘false’ is not defined

Thanks,
Sunil Palugula

This means you messed up one of your configuration files. In Python, you need to type False (with a capital F) and in yaml I think both false and False are valid.

Hi @BYK, I have now update the config file was suggested by you i.e. both are set to false but still getting same below error. As said earlier i will try with secure port and redirecting the request to [smtp.office365.com] (http://smtp.office365.com/) and let you know the results.

image

Hi @BYK, Sorry for the delayed response, Our IT team has configured a new SMTP server with secure port enabled but still i am getting below error and i am working on it this with our IT team.

Can you please let me know how we can enable debug logging on sentry for this email portion so that we can get to the root of the issue.

image

Thanks,
Sunil Palugula

Hi @spalugula - you can read more about logging levels for Sentry here: https://develop.sentry.dev/config/#logging

There’s no specific level for the email portion but if you are testing the settings from the UI (seems like you do), just setting the logging level to debug and watching the logs as you try to send a test email should be sufficient.

That said I don’t think you’d get any useful logs. I’m guessing you did not forget to update your mail.port setting and restart Sentry?

Thanks @BYK I will enable the logging on the server and will see if that is useful.

I have updated the email config and restarted the sentry but still i see the same issue, Anyhow i am working with my IT team on the email issue. I will keep you posted if i have an update.

thanks,
Sunil Palugula

1 Like

@BYK Thanks for all your help on this issue.

We are for now able to send the emails after setting up the new SMTP server with TLS enabled. Even after configuring new server i was hitting some issues but not sure what changes were did by our IT team on the server.

Anyhow if i have an update on the issue from our team i will sure post it here.

Thanks once again for your help.

Thanks,
Sunil Palugula

1 Like