SMTP configuration for my on premise sentry running on docker

Hi

I am new to sentry as well as docker and was also having issues with installing sentry 10 so i have installed sentry 9.1.2 successfully and able to use it but now we observed that we are not getting emails.

Please let us know the steps to configure SMTP to my sentry 9.1.2 running on docker without disturbing the data on the sentry server.

Note: We are directly using the docker images to run the sentry.

I don’t see separate container for SMTP

[root@vm-qa-sentry10 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
redis latest a4d3716dbb72 4 months ago 98.3MB
postgres latest 0f10374e5170 4 months ago 314MB
sentry latest fe6992de61df 10 months ago 869MB
[root@vm-qa-sentry10 ~]#

Thanks,
Sunil Palugula

@BYK Can you please suggest a solution for me to to configure th SMTP to my existing sentry running on docker.

Thanks,

Sunil Palugula

Looks like you are not following our recommended setup from the onpremise repo here: https://github.com/getsentry/onpremise/tree/9.1.2

So all I can refer you to is https://develop.sentry.dev/services/email/#outbound-email for smtp configuration.

Thanks @BYK for the quick response, I was following below page for running sentry and while i was installing i did not configure SMTP but now i would like to configure

https://hub.docker.com/_/sentry

As mentioned in the above link i have passed the below arguments to the sentry docker run command and able to see the settings from sentry UI. But when i try to test the settings from Sentry UI getting following error “STARTTLS extension not supported by server.”

docker run -d -p 8080:9000 --name my-sentry -e SENTRY_EMAIL_HOST=‘x.x.x.x’ -e SENTRY_EMAIL_PORT=‘25’ -e SENTRY_EMAIL_USER=‘user@xyz.com’ -e SENTRY_EMAIL_PASSWORD=‘xxxxxxxx’ -e SENTRY_EMAIL_USE_TLS=‘true’ -e SENTRY_SECRET_KEY=‘xxxxxxxxxx’ --link sentry-redis:redis --link sentry-postgres:postgres sentry

Note: I have tried using SENTRY_EMAIL_USE_TLS=‘false’ also but still see the same issue.

When you set SENTRY_EMAIL_USE_TLS=‘false’, have you made sure this setting was applied as the error seems like Sentry is trying to use TLS and the server does not support that.

It may be the case that the Server requires SSL instead which is not supported by the version of Sentry you are using. I recommend (in any case) trying out a more recent version like 20.8.0 or 20.7.2: https://github.com/getsentry/onpremise/releases/

You can find more information over at https://develop.sentry.dev/self-hosted/. The Docker Hub page is stuck at 9.1.2 for now and we are trying to work with the Docker Library team to get that updated.

@BYK Thanks for the quick update, but i don’t see any document with instructions for upgrading my existing sentry 9.1.2 running on docker to latest version 20.8.0 or 20.7.2 without losing the data which already exists in our sentry server.

If possible can you please provide the steps for me or point e the document as i not that much familiar with docker.

I appreciate once again your fast responses to all the my questions that I asked

Thanks,
Sunil Palugula

Please see https://develop.sentry.dev/self-hosted/#upgrading

It should be safe to upgrade from 9.1.2 to 20.8.0. I’d wait until September 15th, if you are not in a rush, for 20.9.0 to be out with a fix for upgrades from 9.1.2.

Hi BYK,

The document which you have provided was pointing to docker-compose version of upgrade method but my existing 9.1.2 installed is purely running the official images provided by Sentry so below upgrade steps are not applicable for my installation type.

" To upgrade, all you need to do is download or check out the version of on-premise repository you want, replace your existing folder’s contents with that, and then run ./install.sh"

Can you please let me know if i have option to upgrade my existing sentry installed using the instruction from below article.

https://hub.docker.com/_/sentry

Thanks,
Sunil Palugula

You have the option, you just need to migrate to the docker-compose based setup manually. Since you should already have the sentry-redis and sentry-postgres volumes, you’d just need to port your configuration into the sentry/sentry.conf.py and sentry/config.yml files and then the install script would take care of the rest.

After this, you won’t need (well, you shoultdn’t use) the manual docker run --link commands, just docker-compose up -d.

Thanks @BYK for the explanation - Since i’m new to docker as well as Sentry, I did not understand exactly what you mean by "port your configuration into the sentry/sentry.conf.py and sentry/config.yml".

Can you please let me know what exactly needs to be configured in both the files sentry/sentry.conf.py and sentry/config.yml for upgrading to latest version.

I am really really sorry for wasting your precious time with my silly questions.

Thanks once again for your help.

Thanks,
Sunil Palugula

Hi

You may

  1. set all your SMTP email settings in sentry/config.yml as

    mail.port: your SMTP port number
    mail.username: your SMTP user name
    mail.password: your SMTP password
    mail.host: your SMTP hostname/address
    mail.from: your SMTP mail from, please notice that some SMTP provider may have restriction for security reason and allow only your registerred email address here

  2. run ./install.sh to activate your settings

  3. run docker-compose up -d to pull up whole Sentry service

  4. go to user–>admin–>email, to test your mail settings

1 Like

How would i link my existing sentry-redis and `sentry-postgres containers to the new docker-compose installation. What setting needs to be updated in sentry/sentry.conf.py and sentry/config.yml for migration to new installation type.

Thanks,
Sunil Palugula

You are not wasting anyone’s time and these are not silly questions. We want this forum to be a safe and respectful place (including towards yourself!) :wink:

These are volumes and you don’t need to do anything special as the new on-premise setup just uses these globally available volumes automatically.

For the config files, if you have not deviated from the defaults, I’d simply use the ones coming with the repo as they configure all the hostnames etc. If you have changed some settings, I’d say it should be easier to apply them onto the default configs shipping with the repo here: https://github.com/getsentry/onpremise/tree/master/sentry

As long as you back up your data. A quick Google search led me to this project for backing up named volumes: https://github.com/loomchild/volume-backup

Hope this helps. FYI you can also find some more information over at that docs link I provided above.

Hi @BYK , Thanks once again for your response.

Let me rephrase my question so that i will get exactly what i required.

I have first installed Sentry On-premise version 9.1.2 following the instructions from below sentry docker page and we are directly running official images provided by Sentry. We are good with the installation and we have created 5 projects in this version of sentry. The only issue we have in this installation is email configuration.

If you see the comments above you have suggested us to upgrade to latest version and following is your comment - “It may be the case that the Server requires SSL instead which is not supported by the version of Sentry you are using. I recommend (in any case) trying out a more recent version like 20.8.0 or 20.7.2: https://github.com/getsentry/onpremise/releases/

https://hub.docker.com/_/sentry

As instructed by you i have now trying to upgrade sentry to latest version 20.8.0 and after installation we are able to access the sentry but need to know how the 5 projects and errors recorded in those 5 projects from our 9.1.2 version need to move to our new sentry 20.8.0

I thought of trying the instructions provided in the below link but unfortunately postgres version in Sentry 9.1.2 is 9.6 and in sentry latest version it is 12

cd /var/lib/docker/volumes
 yes | cp -R onpremise_sentry-postgres/_data/ sentry-postgres/
 yes | cp -R onpremise_sentry-data/_data/ sentry-data/

Thanks,
Sunil Palugula

What I have been telling is, if you already have the sentry-postgres and sentry-redis volumes defined in Docker (you said you did), then the install script in the onpremise repo will automatically use those volumes and perform all necessary upgrades and migrations:

This is incorrect. As you can see we are still using Postgres 9.6: https://github.com/getsentry/onpremise/blob/313fef026a675ddc1d851a59b45b485c78d61e8f/docker-compose.yml#L61

I am not sure if this applies to you if you already have the volumes defined as sentry-postgres, sentry-redis and sentry-data.

@BYK, I have 5 containers from previous 9.1.2 installation and when i try to install latest 20.8.0 new postgres & redis containers are getting created and new installation is not using old sentry-postgres and sentry-redis containers.

See below for all my containers on the server.

Note: last seven containers in the above image belongs to version 9.1.2

Aha, we finally found the root of the confusion :slight_smile: You are talking about containers and I am talking about volumes. The onpremise repo will not use any of the existing containers. It will only use the data volumes if they are there.

What do you get when you run docker volume ls?

Below is what we see when we run “docker volume ls”

Can you please let me know the process of migrating from 9.1.2 to latest 20.8.0 including the data exists in our current version of Sentry 9.1.2

Thanks,
Sunil Palugula

Can you also share how you are running your old postgres and redis containers as from this output, it is not possible to see which volumes belong to the old setup.

Below are the volumes of old containers from version 9.1.2

image

below commands from https://hub.docker.com/_/sentry created the above containers as part of sentry 9.1.2 installation.

docker run -d --name sentry-redis redis
docker run -d --name sentry-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=sentry postgres

Thanks,
Sunil Palugula