Comments (6)
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:
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 [1][2].
To continue talking to Dosu, mention @dosu.
from superset.
It looks like you have correctly configured the Redis settings for Celery. However, there are a few additional configurations and checks you should ensure are in place:
-
Enable the
ALERT_REPORTS
Feature Flag:
Ensure that theALERT_REPORTS
feature flag is enabled in your configuration:FEATURE_FLAGS = { 'ALERT_REPORTS': True, 'DASHBOARD_RBAC': True, 'ENABLE_TEMPLATE_PROCESSING': True, }
-
Set
ALERT_REPORTS_NOTIFICATION_DRY_RUN
toFalse
:
Make sure this setting is correctly set toFalse
to enable actual notifications:ALERT_REPORTS_NOTIFICATION_DRY_RUN = False
-
Configure the WebDriver:
Ensure that the WebDriver is correctly configured for taking screenshots: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"
-
Set the User for Rendering Dashboards:
Ensure that the user for rendering dashboards is set:from superset.tasks.types import ExecutorType THUMBNAIL_SELENIUM_USER = 'admin' ALERT_REPORTS_EXECUTE_AS = [ExecutorType.SELENIUM]
-
Check Celery Workers:
Ensure that Celery workers are running and can connect to Redis. You can start the Celery worker with:celery -A superset.tasks.celery_app:app worker --loglevel=info
-
Check Celery Beat:
Ensure that Celery beat is running to schedule tasks:celery -A superset.tasks.celery_app:app beat --loglevel=info
-
Verify Redis Connection:
Ensure that Redis is running and accessible. You can test the connection using a Redis client:redis-cli -h localhost -p 6379 ping
-
SMTP Configuration:
Ensure that your SMTP settings are correctly configured for email notifications: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
By ensuring these configurations and checks are in place, you should be able to set up alerts and reports in Apache Superset 4.0.1. If the issue persists, check the Superset logs for any errors or warnings that might provide more insights [1][2].
To continue talking to Dosu, mention @dosu.
from superset.
I installed the redis manually, and update the config as following, but NO LUCK
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}/0"
imports = (
"superset.sql_lab",
"superset.tasks.scheduler",
)
result_backend = f"redis://{REDIS_HOST}:{REDIS_PORT}/0"
worker_prefetch_multiplier = 10
task_acks_late = True
task_annotations = {
"sql_lab.get_sql_results": {
"rate_limit": "100/s",
},
}
beat_schedule = {
"reports.scheduler": {
"task": "reports.scheduler",
"schedule": crontab(minute="*", hour="*"),
},
"reports.prune_log": {
"task": "reports.prune_log",
"schedule": crontab(minute=0, hour=0),
},
}
In report log, seems no error message, but no email was sent or received.
from superset.
after config as above, the log report STARTTLS extension not supported by server.
from superset.
If you followed the PyPi installation, have you set up a Celery instance?
from superset.
If you followed the PyPi installation, have you set up a Celery instance?
Currently, the log shows failed as STARTTLS extension not supported by server.
And cerely is configured as
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}/0"
imports = (
"superset.sql_lab",
"superset.tasks.scheduler",
)
result_backend = f"redis://{REDIS_HOST}:{REDIS_PORT}/0"
worker_prefetch_multiplier = 10
task_acks_late = True
task_annotations = {
"sql_lab.get_sql_results": {
"rate_limit": "100/s",
},
}
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
from flask_caching.backends.rediscache import RedisCache
RESULTS_BACKEND = RedisCache(
host=REDIS_HOST, port=REDIS_PORT, key_prefix='superset_results')
from superset.
Related Issues (20)
- Duplicated entries in Alerts & Reports execution log HOT 1
- /api/v1/dashboard/{id_or_slug}/copy with "duplicate_slices" = true not working because The "json_metadata" take from /api/v1/dashboard/{id_or_slug} doesn't have "positions" HOT 4
- Bar Chart: Bar Chart Echart X Axis and Y Axis labels not showing HOT 3
- The default URL generated by Dashboard has security risks! HOT 22
- Advanced Period filter bug HOT 2
- Switching languages doesn't take effect on some menu elements if BABEL_DEFAULT_LOCALE is not "en" HOT 11
- ENABLE_JAVASCRIPT_CONTROLS use HOT 2
- [SIP-144] Proposal to Integrate VisActor Visualization Plugin into Superset HOT 2
- Dashboard Color Scheme keeps changing every refresh HOT 4
- Bug: fetchGuestToken function is not called after internet is disconnected and error is encountered during embedded report access HOT 3
- The in-memory storage for tracking rate limits HOT 14
- Filtered values not appearing/not working after selected from dropdown Post Migration to Latest SS Version HOT 6
- Proxy is unable to function properly HOT 8
- Importing example dataset failes because of database constraint HOT 3
- DynamoDB Chart Failure HOT 1
- Unable to create/see datasets HOT 1
- [4.1.0rc1] Building Docker image from sources fails HOT 3
- `Error: Referenced columns not available in DataFrame` in Mixed Charts when one query has only nulls HOT 1
- Inconsistencies in the handling of misspelled URLs HOT 2
- AttributeError: 'Template' object has no attribute 'strip' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.