You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "hswlxc (via GitHub)" <gi...@apache.org> on 2024/07/10 13:01:58 UTC
[I] The alarm and email sending functions of superset are unavailable [superset]
hswlxc opened a new issue, #29541:
URL: https://github.com/apache/superset/issues/29541
### Bug description
[superset_config.py.zip](https://github.com/user-attachments/files/16162372/superset_config.py.zip)
This is my profile, and according to this configuration, the email cannot be sent
### How to reproduce the bug
<img width="1422" alt="image" src="https://github.com/apache/superset/assets/11643933/81594389-c94f-47d5-b1cf-b162d34fcfe5">
<img width="1433" alt="image" src="https://github.com/apache/superset/assets/11643933/53bb641c-b727-4926-b001-2af31c3d7b93">
### Screenshots/recordings
_No response_
### Superset version
4.0.1
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
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.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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2220516745
<!-- Greeting -->
Hey @hswlxc, I'm here to assist you with any bugs, questions, or contributions you may have. Let's tackle this issue together!
<!-- Answer -->
To resolve the issue where the alarm and email sending functions of Superset are unavailable, you need to ensure that the `ALERT_REPORTS` configuration is set to `True` in your `superset_config.py` file.
From the provided context, it appears that the `ALERT_REPORTS` setting might be set to `False`. You should change this setting to `True`:
```py
# Enables Alerts and reports new implementation
"ALERT_REPORTS": True,
```
This change will enable the alerts and reports functionality, which includes the alarm and email sending features <sup>[[1]](https://github.com/apache/superset/blob/master/superset/config.py)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222414743
<!-- Answer -->
Since the `reports.scheduler` task is registered with Celery but still not sending tasks, let's ensure a few more configurations and checks:
1. **Verify Celery Beat Schedule**:
Ensure that the Celery beat schedule includes the `reports.scheduler` task and that it is correctly configured to run at the desired intervals. Here is an example configuration:
```python
from celery.schedules import crontab
class CeleryConfig:
broker_url = "redis://localhost:6379/0"
result_backend = "redis://localhost:6379/0"
imports = ("superset.sql_lab", "superset.tasks.scheduler")
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
```
2. **Check Celery Beat Logs**:
Review the Celery beat logs to ensure that the `reports.scheduler` task is being scheduled. Look for log entries indicating that the task is being added to the schedule.
3. **Manual Trigger**:
Manually trigger the `reports.scheduler` task to verify if it can run as expected. You can do this by calling the `scheduler` task directly using Celery's `send_task` method:
```python
from superset.extensions import celery_app
# Trigger the scheduler task manually
celery_app.send_task('reports.scheduler')
```
4. **Check Task Execution Logs**:
Check the Celery worker logs for any errors or warnings related to the execution of the `reports.scheduler` task. Ensure that the task is being picked up and executed by the worker.
5. **Superset Logs**:
Review the Superset logs for any additional information or errors that might indicate why the emails and alarms are not being triggered. Look for log entries related to the `reports.scheduler` task.
6. **Feature Flags**:
Ensure that the necessary feature flags are enabled in your `superset_config.py`:
```python
FEATURE_FLAGS = {
"ALERT_REPORTS": True,
"EMAIL_NOTIFICATIONS": True,
}
```
7. **Dry-Run Mode**:
Ensure that the `ALERT_REPORTS_NOTIFICATION_DRY_RUN` setting is set to `False` to disable dry-run mode and start receiving notifications:
```python
ALERT_REPORTS_NOTIFICATION_DRY_RUN = False
```
By following these steps, you should be able to identify and resolve the issue with the `reports.scheduler` task not sending tasks and ensure it is correctly scheduled and executed by Celery <sup>[[1]](https://github.com/apache/superset/blob/master/superset/tasks/scheduler.py)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/docs/docs/configuration/alerts-reports.mdx)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "hswlxc (via GitHub)" <gi...@apache.org>.
hswlxc commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222435123
from celery.schedules import crontab
class CeleryConfig:
broker_url = "redis://localhost:6379/0"
result_backend = "redis://localhost:6379/0"
imports = ("superset.sql_lab", "superset.tasks.scheduler")
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
FEATURE_FLAGS = {
"ALERT_REPORTS": True,
"EMAIL_NOTIFICATIONS": True,
}
ALERT_REPORTS_NOTIFICATION_DRY_RUN = False
<img width="1171" alt="image" src="https://github.com/apache/superset/assets/11643933/f956f435-4616-4532-a355-70626a57e4cf">
The above configuration is correct, but I found a problem. I registered multiple tasks, but only the cache_dashboard_thumbnail task was executed, and none of the other tasks were executed properly. Could you please confirm the reason for this @dosu
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "hswlxc (via GitHub)" <gi...@apache.org>.
hswlxc commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222303144
from superset.extensions import celery_app
# Trigger the scheduler task manually
celery_app.send_task('reports.scheduler')
<img width="1043" alt="image" src="https://github.com/apache/superset/assets/11643933/55360046-fb22-45ea-a9ef-5d7f693aa2d1">
When manually triggered, the message was that I could not connect, but my redis service started normally, and I could take screenshots and use the cache normally
This error occurs, where the configuration is incorrect
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "hswlxc (via GitHub)" <gi...@apache.org>.
hswlxc commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222387969
<img width="1133" alt="image" src="https://github.com/apache/superset/assets/11643933/16186181-42f0-4a13-8632-b0f4aa649a0a">
celery -A superset.tasks.celery_app inspect registered
Through the above command, reports.scheduler has registered Celery, but still has no celery sending task @dosu
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "hswlxc (via GitHub)" <gi...@apache.org>.
hswlxc commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222337798
<img width="534" alt="image" src="https://github.com/apache/superset/assets/11643933/baddb38c-4a6c-497e-8ab3-6f8bdd47c1ed">
Manually triggered, you can print out the task ID, indicating that the connection is fine, but this task ID is not available from flower
<img width="1325" alt="image" src="https://github.com/apache/superset/assets/11643933/75374c48-aa84-4580-a26c-2126b26af7df">
@dosu
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "hswlxc (via GitHub)" <gi...@apache.org>.
hswlxc commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2221819101
<img width="620" alt="image" src="https://github.com/apache/superset/assets/11643933/26d80635-f5a3-41a0-944d-50953bc91e3d">
"ALERT_REPORTS": True, "ALERT_REPORTS": True
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "hswlxc (via GitHub)" <gi...@apache.org>.
hswlxc commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222033475
<img width="1304" alt="image" src="https://github.com/apache/superset/assets/11643933/b2054842-6816-461a-8a71-d40067cc762e">
The celery_worker and beat logs are normal with no errors, the chrome driver is also normal and can take thumbnails normally, but the mail and alarms are not working and there are no execution logs ,Please look at this problem. Thank you @mistercrunch,@villebro,@michael-s-molina,@betodealmeida,@john-bodley
@rusackas @dosu
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222136964
<!-- Answer -->
Since the configuration checks are fine and no scheduled tasks are being started, let's ensure a few more things:
1. **Dry-Run Mode**: Ensure that the `ALERT_REPORTS_NOTIFICATION_DRY_RUN` setting is set to `False` to disable dry-run mode and start receiving notifications.
```python
ALERT_REPORTS_NOTIFICATION_DRY_RUN = False
```
2. **Manual Trigger**: Manually trigger the `reports.scheduler` task to verify if it is configured correctly and can run as expected. You can do this by calling the `scheduler` task directly using Celery's `send_task` method:
```python
from superset.extensions import celery_app
# Trigger the scheduler task manually
celery_app.send_task('reports.scheduler')
```
3. **Celery Configuration**: Ensure that the Celery configuration is correctly set up, including the `beat_schedule` for `reports.scheduler`:
```python
from celery.schedules import crontab
class CeleryConfig:
broker_url = "redis://localhost:6379/0"
imports = ("superset.sql_lab", "superset.tasks.scheduler")
result_backend = "redis://localhost:6379/0"
worker_prefetch_multiplier = 10
task_acks_late = True
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
```
4. **Celery Worker and Beat**: Ensure that both the Celery worker and beat are running. You can start them using the following commands:
```sh
celery --app=superset.tasks.celery_app:app worker --pool=prefork -O fair -c 4
celery --app=superset.tasks.celery_app:app beat
```
5. **Superset Logs**: Check the Superset logs for any additional information or errors that might indicate why the emails and alarms are not being triggered.
By following these steps, you should be able to identify and resolve the issue with the scheduled tasks not being started <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/superset/tasks/scheduler.py)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222039166
<!-- Answer -->
Since the `ALERT_REPORTS` flag is already set to `True` and there are no errors in the Celery worker and beat logs, let's check a few other configurations and steps to ensure everything is set up correctly:
1. **SMTP Configuration**: Ensure your SMTP settings in `superset_config.py` are correct and that `EMAIL_NOTIFICATIONS` is set to `True`. Here is an example configuration:
```python
EMAIL_NOTIFICATIONS = True
SMTP_HOST = "your_smtp_host"
SMTP_STARTTLS = True
SMTP_SSL = False
SMTP_USER = "your_smtp_user"
SMTP_PORT = 587 # or the port your SMTP server uses
SMTP_PASSWORD = "your_smtp_password"
SMTP_MAIL_FROM = "your_email@example.com"
```
2. **Celery Beat Schedule**: Ensure that the Celery beat schedule includes the `reports.scheduler` task. Here is an example configuration:
```python
from celery.schedules import crontab
beat_schedule = {
"reports.scheduler": {
"task": "reports.scheduler",
"schedule": crontab(minute="*", hour="*"),
},
"reports.prune_log": {
"task": "reports.prune_log",
"schedule": crontab(minute=0, hour=0),
},
}
```
3. **Check Celery Worker and Beat Logs**: Even though you mentioned there are no errors, ensure that the Celery worker and beat are running and processing tasks correctly. You can check the logs for any relevant information.
4. **Browser Installation for Screenshots**: Ensure that the headless browser (e.g., Chrome) is correctly installed and configured. Since you mentioned that the Chrome driver is working and can take thumbnails, this step might already be covered.
5. **Review Superset Logs**: Check the Superset logs for any additional information or errors that might indicate why the emails and alarms are not being triggered.
6. **Test SMTP Configuration**: Manually test the SMTP configuration to ensure that emails can be sent using the provided credentials and settings.
If all these configurations are correct and the issue persists, it might be helpful to provide more specific details about the current configuration and any additional logs or error messages that might be available.
For further reference, you can check similar issues and discussions:
- [Alerts and Reports not working after updating SMTP credentials](https://github.com/apache/superset/discussions/29228#discussioncomment-9752736) <sup>[[1]](https://github.com/apache/superset/discussions/29228)</sup>
- [Superset ALERT & REPORTS not working](https://github.com/apache/superset/issues/28381) <sup>[[2]](https://github.com/apache/superset/issues/28381)</sup>
@rusackas, this one's a bit out of my wheelhouse, could you step in and provide your guidance?
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222318847
<!-- Answer -->
The `ConnectionError: [Errno 111] Connection refused` indicates that Celery is unable to connect to the Redis broker. Here are some steps to troubleshoot and resolve this issue:
1. **Verify Redis Connection**:
Ensure that Redis is running and accessible. You can test the connection to Redis using the `redis-cli` tool:
```sh
redis-cli ping
```
You should receive a `PONG` response if Redis is running and accessible.
2. **Check Redis Configuration**:
Ensure that the Redis configuration in your `superset_config.py` or `celeryconfig.py` is correct. The `broker_url` should point to the correct Redis host and port:
```python
class CeleryConfig:
broker_url = "redis://localhost:6379/0" # Ensure this matches your Redis configuration
result_backend = "redis://localhost:6379/0"
# Other configurations...
CELERY_CONFIG = CeleryConfig
```
3. **Firewall and Network Issues**:
Ensure that there are no firewall or network issues preventing Celery from connecting to Redis. Check that the Redis port (default is 6379) is open and accessible.
4. **Redis Logs**:
Check the Redis logs for any errors or warnings that might indicate why the connection is being refused. The logs are usually located in `/var/log/redis/redis-server.log` or a similar location depending on your setup.
5. **Celery Worker and Beat**:
Ensure that both the Celery worker and beat are running and configured to use the correct Redis broker URL. Start them using the following commands:
```sh
celery --app=superset.tasks.celery_app:app worker --pool=prefork -O fair -c 4
celery --app=superset.tasks.celery_app:app beat
```
6. **Superset Configuration**:
Double-check the Superset configuration to ensure that all necessary settings are correctly applied. Here is an example configuration for reference:
```python
from celery.schedules import crontab
class CeleryConfig:
broker_url = "redis://localhost:6379/0"
result_backend = "redis://localhost:6379/0"
imports = ("superset.sql_lab", "superset.tasks.scheduler")
worker_prefetch_multiplier = 10
task_acks_late = True
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
```
By following these steps, you should be able to identify and resolve the connection issue between Celery and Redis <sup>[[1]](https://github.com/apache/superset/issues/29556)</sup><sup>[[2]](https://github.com/apache/superset/issues/19789)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222346798
<!-- Answer -->
Since the task ID is printed, indicating that the connection to Redis is fine, but the task is not visible in Flower, let's focus on a few additional checks and configurations:
1. **Celery Task Registration**:
Ensure that the `reports.scheduler` task is correctly registered with Celery. Verify that the task is imported and recognized by Celery.
```python
from superset.tasks.scheduler import scheduler
@celery_app.task(name="reports.scheduler")
def scheduler_task():
scheduler()
```
2. **Celery Worker Configuration**:
Ensure that the Celery worker is configured to recognize and execute the `reports.scheduler` task. Check the worker logs for any errors or warnings related to task registration.
3. **Celery Beat Configuration**:
Ensure that the Celery beat schedule includes the `reports.scheduler` task and that it is correctly configured to run at the desired intervals.
```python
from celery.schedules import crontab
class CeleryConfig:
broker_url = "redis://localhost:6379/0"
result_backend = "redis://localhost:6379/0"
imports = ("superset.sql_lab", "superset.tasks.scheduler")
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
```
4. **Check Celery Logs**:
Review the Celery worker and beat logs for any errors or warnings that might indicate why the task is not being executed. Look for messages related to task registration, scheduling, and execution.
5. **Flower Configuration**:
Ensure that Flower is correctly configured to monitor the Celery tasks. Sometimes, tasks might not appear in Flower due to configuration issues. Restart Flower and check if the tasks appear.
6. **Task Visibility in Flower**:
Verify that the task is not filtered out in Flower. Check the Flower interface for any filters or settings that might hide certain tasks.
By following these steps, you should be able to identify and resolve the issue with the `reports.scheduler` task not appearing in Flower and ensure it is correctly scheduled and executed by Celery <sup>[[1]](https://github.com/apache/superset/blob/master/superset/tasks/scheduler.py)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/tests/integration_tests/reports/scheduler_tests.py)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #29541: The alarm and email sending functions of superset are unavailable
URL: https://github.com/apache/superset/issues/29541
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222662557
<!-- Answer -->
Given that only the `cache_dashboard_thumbnail` task is being executed and other tasks like `reports.scheduler` are not, let's ensure a few more configurations and checks:
1. **Task Registration**:
Ensure that all tasks are correctly registered with Celery. Verify that the tasks are imported and recognized by Celery.
```python
from superset.tasks.scheduler import scheduler, prune_log
@celery_app.task(name="reports.scheduler")
def scheduler_task():
scheduler()
@celery_app.task(name="reports.prune_log")
def prune_log_task():
prune_log()
```
2. **Celery Worker Configuration**:
Ensure that the Celery worker is configured to recognize and execute all tasks. Check the worker logs for any errors or warnings related to task registration.
3. **Celery Beat Configuration**:
Ensure that the Celery beat schedule includes all tasks and that they are correctly configured to run at the desired intervals.
```python
from celery.schedules import crontab
class CeleryConfig:
broker_url = "redis://localhost:6379/0"
result_backend = "redis://localhost:6379/0"
imports = ("superset.sql_lab", "superset.tasks.scheduler")
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
```
4. **Check Celery Beat Logs**:
Review the Celery beat logs to ensure that all tasks are being scheduled. Look for log entries indicating that the tasks are being added to the schedule.
5. **Manual Trigger**:
Manually trigger the tasks to verify if they can run as expected. You can do this by calling the tasks directly using Celery's `send_task` method:
```python
from superset.extensions import celery_app
# Trigger the scheduler task manually
celery_app.send_task('reports.scheduler')
# Trigger the prune_log task manually
celery_app.send_task('reports.prune_log')
```
6. **Check Task Execution Logs**:
Check the Celery worker logs for any errors or warnings related to the execution of the tasks. Ensure that the tasks are being picked up and executed by the worker.
7. **Superset Logs**:
Review the Superset logs for any additional information or errors that might indicate why the tasks are not being executed. Look for log entries related to the tasks.
8. **Feature Flags**:
Ensure that the necessary feature flags are enabled in your `superset_config.py`:
```python
FEATURE_FLAGS = {
"ALERT_REPORTS": True,
"EMAIL_NOTIFICATIONS": True,
}
```
9. **Dry-Run Mode**:
Ensure that the `ALERT_REPORTS_NOTIFICATION_DRY_RUN` setting is set to `False` to disable dry-run mode and start receiving notifications:
```python
ALERT_REPORTS_NOTIFICATION_DRY_RUN = False
```
By following these steps, you should be able to identify and resolve the issue with the tasks not being executed and ensure they are correctly scheduled and executed by Celery <sup>[[1]](https://github.com/apache/superset/blob/master/superset/tasks/scheduler.py)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/docs/docs/configuration/alerts-reports.mdx)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "hswlxc (via GitHub)" <gi...@apache.org>.
hswlxc commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2220461812
The task to send the mail is not scheduled,No task error information is displayed in the log
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "hswlxc (via GitHub)" <gi...@apache.org>.
hswlxc commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2222095952
<img width="1422" alt="image" src="https://github.com/apache/superset/assets/11643933/8ef9f85b-5717-44a9-ba50-fe07e2636b83">
The configuration check above was fine, I checked the task list and found that no scheduled tasks were started @dosu
--
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
Re: [I] The alarm and email sending functions of superset are unavailable [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #29541:
URL: https://github.com/apache/superset/issues/29541#issuecomment-2767389897
Closing this since it's been silent for a couple hundred days. I'll assume you've either solved this or moved on, but it'd be more pertinent as a Discussion since it's a setup/config issue rather than a Superset bug (the feature definitely works).
--
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