Cannot fix the smtp integrations

Hey Guys,
Have been trying this for 3days reading different forum post. Let me summarise the situation below but before that > one quick question:

  1. Does config.yml files don’t get updated even on docker docker-compose up -d after the first initial setup
  2. Is config.yml will be always the main file for changing the config like SMTP and Github or some other files after the first initial setup?

Version: Sentry10 on premise
Ubuntu.
Installation mode: Docker with that single /install.sh command used for starters like me :slight_smile:

Issue: Am trying to update the SMTP after our initial install.sh but it’s not getting updated at all.

This is how I did

  1. File location: sentry/Onpremise/sentry/
  2. Nano config.yml
  3. Even reverted to the templated one
  4. Save and exit
  5. Docker commands with no errors
    docker-compose build
    docker-compose run --rm web upgrade
    docker-compose up -d

Am very new to this. Can you advice? I have installed sentry in two droplets in DO to test why am facing but still cannot find this issue.
Any Idea?

As I cant two update images. Pasting here the second image

Hi!

You only need to run docker-compose restart web worker cron for this (or can do docker-compose restart to restart all services).

None of the commands you run stops and starts the services again, hence the changes not being picked up :slight_smile:

There’s also sentry.conf.py in that same folder. You probably don’t need that file but some settings have to live there. See https://develop.sentry.dev/config/ for more.

Hi Byk!
Thanks a lot. I ran the docker-compose restart

and i still see those informations not changed (The same information you on the second thread)

And so i tried your cronjob command as well. Still doesn’t change. Except the fact I can see the server goes down for a while to resetup this and bring it back.

Can advice ?

Can you also make sure you are on the latest version of the on-premise repo? The older versions needed a rebuild but the new version just mounts the config folder as a volume.

Also, sharing your config files (both config.yml and sentry.conf.py would be very useful)

Hi Byk,
Yes it’s just cloned last week and done installed using install.sh. Also adding a screenshot on what happened after I ran the restart command

###############

# Mail Server #

###############

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

mail.host: 'smtp'

# mail.port: 25

# mail.username: ''

# mail.password: ''

# mail.use-tls: false

# The email address to send on behalf of

# mail.from: 'root@localhost'

# If you'd like to configure email replies, enable this.

# mail.enable-replies: true

# When email-replies are enabled, this value is used in the Reply-To header

# mail.reply-hostname: ''

# If you're using mailgun for inbound mail, set your API key and configure a

# route to forward to /api/hooks/mailgun/inbound/

# Also don't forget to set `mail.enable-replies: true` above.

# mail.mailgun-api-key: ''

###################

# System Settings #

###################

# If this file ever becomes compromised, it's important to generate a new key.

# Changing this value will result in all current sessions being invalidated.

# A new key can be generated with `$ sentry config generate-secret-key`

system.secret-key: 'e4U)KT0polj2>ccRJ-3gbeiiy-[xLoy#z60)0NasffXow\HUzo'

# The ``redis.clusters`` setting is used, unsurprisingly, to configure Redis

# clusters. These clusters can be then referred to by name when configuring

# backends such as the cache, digests, or TSDB backend.

# redis.clusters:

# default:

# hosts:

# 0:

# host: 127.0.0.1

# port: 6379

################

# File storage #

################

# Uploaded media uses these `filestore` settings. The available

# backends are either `filesystem` or `s3`.

And the sentry.conf.py

from sentry.conf.server import *  # NOQA

DATABASES = {
“default”: {
“ENGINE”: “sentry.db.postgres”,
“NAME”: “postgres”,
“USER”: “postgres”,
“PASSWORD”: “”,
“HOST”: “postgres”,
“PORT”: “”,
}
}

You should not change this setting after your database has been created

unless you have altered all schemas first

SENTRY_USE_BIG_INTS = True

If you’re expecting any kind of real traffic on Sentry, we highly recommend

configuring the CACHES and Redis settings

###########

General

###########

Instruct Sentry that this install intends to be run by a single organization

and thus various UI optimizations should be enabled.

SENTRY_SINGLE_ORGANIZATION = True

SENTRY_OPTIONS[“system.event-retention-days”] = int(
env(‘SENTRY_EVENT_RETENTION_DAYS’, ‘90’)
)

#########

Redis

#########

Generic Redis configuration used as defaults for various things including:

Buffers, Quotas, TSDB

SENTRY_OPTIONS[“redis.clusters”] = {
“default”: {
“hosts”: {0: {“host”: “redis”, “password”: “”, “port”: “6379”, “db”: “0”}}
}
}
# The digest backend powers notification summaries.

SENTRY_DIGESTS = **"sentry.digests.backends.redis.RedisBackend"**

**##############**

**# Web Server #**

**##############**

SENTRY_WEB_HOST = **"0.0.0.0"**

SENTRY_WEB_PORT = 9000

SENTRY_WEB_OPTIONS = {

**"memory-report"** : **False** ,

**# 'workers': 3, # the number of web workers**

}

**###########**

**# SSL/TLS #**

**###########**

**# If you're using a reverse SSL proxy, you should enable the X-Forwarded-Proto**

**# header and enable the settings below**

**# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')**

**# SESSION_COOKIE_SECURE =** **True**

**# CSRF_COOKIE_SECURE =** **True**

**# SOCIAL_AUTH_REDIRECT_IS_HTTPS =** **True**

**# End of SSL/TLS settings**

**############**

**# Features #**

**############**

SENTRY_FEATURES[ **"projects:sample-events"** ] = **False**

SENTRY_FEATURES.update(

{

feature: **True**

**for** feature **in** (

**"organizations:discover"** ,

**"organizations:events"** ,

**"organizations:discover-basic"** ,

**"organizations:discover-query"** ,

**"organizations:events-v2"** ,

**"organizations:global-views"** ,

**"organizations:integrations-issue-basic"** ,

**"organizations:integrations-issue-sync"** ,

**"organizations:invite-members"** ,

**"organizations:sso-basic"** ,

**"organizations:sso-rippling"** ,

**"organizations:sso-saml2"** ,

**"projects:custom-inbound-filters"** ,

**"projects:data-forwarding"** ,

Okay, so once you set the following values in your config file and restart, the values should change then.

I think you set something during the initial setup, which gets recorded to the database, without an easy UI to change it in the future. But you can use the config file as I suggested.

Byk, sorry am trying to understand this. So did you mean that I should change my config,yml according to the quoted content above and docker-compose restart. It should work?

Currently in the front end UI, I have the gmail configuration and in config it’s already become default. and even after I restarted, it is still gmail in the UI.

Thanks for some extra tips.

The “default” configuration is not setting anything so your previously set values in the DB are taking precedence. If you set something in that file, it would be picked up. If you want to reset them, uncomment those lines and explicitly set them to empty strings.

Thanks a lot, Yes after changing the code it works.

3 Learnings:

  1. https://develop.sentry.dev/config/ (This is best file for people to learn about config and sentry.conf.py settings. Currently lot of onpremise documentation links from searches are broken and just redirect to github onpremise page

  2. docker-compose restart to restart all services but when there are servers which are only 3GB ram. it crashes with error of time out (which am not sure where to change). So I learned to use this command to stop containers

docker stop $(docker ps -a -q)

and restart with

Docker-compose restart

  1. The above one which you shared there is a possibility of Default file cannot work even if we do docker recompose and better to edit the file and do that again!

Thank Byk!

1 Like