GitHub user dosubot[bot] added a comment to the discussion: Failed to setup
alerts and reports based pypi installation
<!-- Answer -->
To resolve the issue with setting up alerts and reports in Apache Superset, you
need to ensure that the Redis service is properly configured and activated.
Based on your provided configuration, it appears that the `broker_url` and
`result_backend` for Celery are not set, which are essential for connecting to
the Redis service.
Here is the updated configuration with the necessary Redis settings:
```python
FEATURE_FLAGS = {
'ALERT_REPORTS' : True,
'DASHBOARD_RBAC': True,
'ENABLE_TEMPLATE_PROCESSING': True,
}
from celery.schedules import crontab
REDIS_HOST = "localhost" # Change this to your Redis host
REDIS_PORT = "6379" # Change this to your Redis port if different
REDIS_CELERY_DB = "0"
REDIS_RESULTS_DB = "1"
class CeleryConfig:
broker_url = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}"
result_backend = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}"
beat_schedule = {
"reports.scheduler": {
"task": "reports.scheduler",
"schedule": crontab(minute="*", hour="*"),
},
"reports.prune_log": {
"task": "reports.prune_log",
"schedule": crontab(minute=0, hour=0),
},
}
CELERY_CONFIG = CeleryConfig
SCREENSHOT_LOCATE_WAIT = 100
SCREENSHOT_LOAD_WAIT = 600
ALERT_REPORTS = True
EMAIL_NOTIFICATIONS = True
ALERT_REPORTS_NOTIFICATION_DRY_RUN = False
EMAIL_NOTIFICATIONS = False # all the emails are sent using dryrun
SMTP_HOST = "SMTP_HOST"
SMTP_STARTTLS = True
SMTP_SSL = True
SMTP_USER = "SMTP_USER"
SMTP_PORT = 465
SMTP_PASSWORD = "SMTP_PASSWORD"
SMTP_MAIL_FROM = "SMTP_MAIL_FROM"
SMTP_SSL_SERVER_AUTH = False
WEBDRIVER_TYPE = "chrome"
WEBDRIVER_OPTION_ARGS = [
"--force-device-scale-factor=2.0",
"--high-dpi-support=2.0",
"--headless",
"--disable-gpu",
"--disable-dev-shm-usage",
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-extensions",
]
WEBDRIVER_BASEURL = "http://localhost:8088"
WEBDRIVER_BASEURL_USER_FRIENDLY = "http://IP:8088"
from superset.tasks.types import ExecutorType
THUMBNAIL_SELENIUM_USER = 'admin'
ALERT_REPORTS_EXECUTE_AS = [ExecutorType.SELENIUM]
```
Make sure that the Redis service is running and accessible at the specified
`REDIS_HOST` and `REDIS_PORT`. This should enable the Celery workers to connect
to Redis and process the tasks for alerts and reports. Additionally, ensure
that the `REDIS_CELERY_DB` and `REDIS_RESULTS_DB` are correctly set to match
your Redis configuration
<sup>[[1]](https://github.com/apache/superset/blob/master/docs/docs/configuration/alerts-reports.mdx)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/docker/pythonpath_dev/superset_config.py)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
GitHub link:
https://github.com/apache/superset/discussions/32798#discussioncomment-12581956
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]