You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/01/06 13:02:07 UTC

[GitHub] [superset] OlafKocanda edited a comment on issue #14811: "superset_worker Report state: [Errno -2] Name or service not known" when sending email alerts.

OlafKocanda edited a comment on issue #14811:
URL: https://github.com/apache/superset/issues/14811#issuecomment-1006570740


   actually if anyone else comes across here, we fixed it adding a celerybeat worker
   
   ```
         containers:
         - name: superset
           image: "apache/superset:latest"
           imagePullPolicy: IfNotPresent
           command: ["/bin/sh","-c",". /app/pythonpath/superset_bootstrap.sh; celery --app=superset.tasks.celery_app:app beat"]
   
   ```
   and then step by step checking the superset-config.py file until we ended with
   
   ```
   class CeleryConfig(object):
       BROKER_URL = f"redis://default:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
       CELERY_IMPORTS = ('superset.sql_lab','superset.tasks', )
       CELERY_RESULT_BACKEND = f"redis://default:{env('REDIS_PASSWORD')}@{env('REDIS_HOST')}:{env('REDIS_PORT')}/0"
       CELERYD_PREFETCH_MULTIPLIER = 10
       CELERY_ACKS_LATE = True
       CELERY_TASK_PROTOCOL = 1
       CELERY_LOG_LEVEL = 'DEBUG'
       CELERY_ANNOTATIONS = {'tasks.add': {'rate_limit': '10/s'},
                             'sql_lab.get_sql_results': {'rate_limit': '100/s',},
                             'email_reports.send': {
                             'rate_limit': '1/s',
                             'time_limit': 600,
                             'soft_time_limit': 600,
                             'ignore_result': True,},
                             }
       CELERYBEAT_SCHEDULE = {
         'email_reports.schedule_hourly': {
             'task': 'email_reports.schedule_hourly',
             'schedule': crontab(minute=1, hour='*'),
         },
         'alerts.schedule_check': {
             'task': 'alerts.schedule_check',
             'schedule': crontab(minute='*', hour='*'),
         },
         'reports.scheduler': {
             'task': 'reports.scheduler',
             'schedule': crontab(minute='*', hour='*'),
         },
         'reports.prune_log': {
             'task': 'reports.prune_log',
             'schedule': crontab(minute=0, hour=0),
         },
         'cache-warmup-hourly': {
             'task': 'cache-warmup',
             'schedule': crontab(minute=0, hour='*'), #hourly
              'kwargs': {
                 'strategy_name': 'top_n_dashboards',
                 'top_n': 10,
                 'since': '7 days ago',
             },},}
   
   CELERY_CONFIG = CeleryConfig
   RESULTS_BACKEND = RedisCache(
         host=env('REDIS_HOST'),
         port=env('REDIS_PORT'),
         password=env('REDIS_PASSWORD'),
         key_prefix='superset_results'
   )
   
   #adding email report function
   FEATURE_FLAGS = {
       "ALERT_REPORTS": True,
       "DASHBOARD_NATIVE_FILTERS": True,
       "DASHBOARD_CROSS_FILTERS": True,
       "ENABLE_TEMPLATE_PROCESSING": True,
       "ENABLE_SCHEDULED_EMAIL_REPORTS": True,
       "EMAIL_NOTIFICATIONS": True
   }
   # see: https://superset.apache.org/docs/installation/configuring-superset#sip-15
   SIP_15_ENABLED = True
   
   # If set to true no notification is sent, the worker will just log a message.
   # Useful for debugging
   ALERT_REPORTS_NOTIFICATION_DRY_RUN = False
   
   EMAIL_NOTIFICATIONS = True
   
   SCREENSHOT_LOCATE_WAIT = 100
   SCREENSHOT_LOAD_WAIT = 600
   
   # Email configuration
   SMTP_HOST = "airlapp.isb.lsy.fra.dlh.de" #change to your host
   SMTP_STARTTLS = False
   SMTP_SSL = False
   SMTP_USER = ""
   SMTP_PORT = XXX # your port eg. 587
   SMTP_PASSWORD = ""
   SMTP_MAIL_FROM = " Superset | Reporting Team <XX...@YY.com>"
   
   WEBDRIVER_BASEURL = "http://superset.<namespace>:8088/"
   WEBDRIVER_BASEURL_USER_FRIENDLY = WEBDRIVER_BASEURL
   ```
   
   `SIP_15_ENABLED = True`
   `SMTP_USER = ""` # leaving it empty is important
   `SMTP_PASSWORD = ""` # leaving it empty is important
   
   were important steps - thanks to (among others) https://github.com/apache/superset/issues/11507#issuecomment-841588337


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org