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 2023/01/17 15:18:53 UTC

[GitHub] [superset] Rohit-pawar902 opened a new issue, #22755: Alert is not working as expected and got unregistered-task error for alert

Rohit-pawar902 opened a new issue, #22755:
URL: https://github.com/apache/superset/issues/22755

   **I am Getting problem to schedule alert ,** 
   
   ```The full contents of the message body was:
   superset_worker         | b'[[], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]' (77b)
   superset_worker         | Traceback (most recent call last):
   superset_worker         |   File "/usr/local/lib/python3.8/site-packages/celery/worker/consumer/consumer.py", line 581, in on_task_received
   superset_worker         |     strategy = strategies[type_]
   superset_worker         | KeyError: 'alerts.schedule_check'
   superset_worker_beat    | [2023-01-17 15:01:00,029: INFO/MainProcess] Scheduler: Sending due task reports.scheduler (reports.scheduler)
   superset_worker         | [2023-01-17 15:01:00,037: ERROR/MainProcess] Received unregistered task of type 'email_reports.schedule_hourly'.
   superset_worker         | The message has been ignored and discarded.
   ```
   ```
   The full contents of the message body was:
   superset_worker         | b'[[], {}, {"callbacks": null, "errbacks": null, "chain": null, "chord": null}]' (77b)
   superset_worker         | Traceback (most recent call last):
   superset_worker         |   File "/usr/local/lib/python3.8/site-packages/celery/worker/consumer/consumer.py", line 581, in on_task_received
   superset_worker         |     strategy = strategies[type_]
   superset_worker         | KeyError: 'email_reports.schedule_hourly'
   superset_worker         | [2023-01-17 15:01:00,044: INFO/MainProcess] Task reports.scheduler[8ad8ef7f-f15b-42bb-bb93-8b5e3e5ab2ab] received
   superset_worker         | Scheduling alert rohit eta: 2023-01-17 15:01:00
   superset_worker         | [2023-01-17 15:01:00,080: INFO/ForkPoolWorker-3] Scheduling alert rohit eta: 2023-01-17 15:01:00
   superset_worker         | [2023-01-17 15:01:00,099: INFO/MainProcess] Task reports.execute[c7d43150-cbe4-4b6b-8bdd-8d8bfeac7741] received
   superset_worker         | [2023-01-17 15:01:00,099: INFO/ForkPoolWorker-3] Task reports.scheduler[8ad8ef7f-f15b-42bb-bb93-8b5e3e5ab2ab] succeeded in 0.054125094786286354s: None
   
   ```
   I am Getting problem to schedule alert , 
   **Problem:**
   Initially on first time It will be succesfully run and in response email sent , 
   but after that in next schedule on trigger it run but not able to send email-notification 
   but status would be success.
   
   **Expected** : Each time on sucessfull trigger it will send the email in response 
   
   
   Myconfig
   ```
        class CeleryConfig(object):
       BROKER_URL = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}"
       CELERY_IMPORTS = ("superset.sql_lab",)
       CELERY_RESULT_BACKEND = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}"
       CELERYD_LOG_LEVEL = "DEBUG"
       # CELERYD_PREFETCH_MULTIPLIER = 1
       # CELERY_ACKS_LATE = False
       CELERYD_PREFETCH_MULTIPLIER = 10
       CELERY_ACKS_LATE = True
       CELERY_ANNOTATIONS = {
           'sql_lab.get_sql_results': {
               'rate_limit': '100/s',
           },
           'email_reports.send': {
               'rate_limit': '1/s',
               'time_limit': 1800,
               'soft_time_limit': 1800,
               'ignore_result': True,
           },
       },                            
       CELERYBEAT_SCHEDULE = {
           "email_reports.schedule_hourly": {
               "task": "email_reports.schedule_hourly",
               "schedule": crontab(minute=1, hour="*"),
           },
           "reports.scheduler": {
               "task": "reports.scheduler",
               "schedule": crontab(minute="*", hour="*"),
           },
           "reports.prune_log": {
               "task": "reports.prune_log",
               "schedule": crontab(minute=10, hour=0),
           },
           "alerts.schedule_check": {
               "task": "alerts.schedule_check",
               "schedule": crontab(minute="1", hour="*")
           },
   
   ```
   
   


-- 
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


[GitHub] [superset] Rohit-pawar902 commented on issue #22755: Alert is not working as expected and got unregistered-task error for alert

Posted by GitBox <gi...@apache.org>.
Rohit-pawar902 commented on issue #22755:
URL: https://github.com/apache/superset/issues/22755#issuecomment-1386573174

   
   Here on First time when alert scheduled and trigger 
   It will run and sent email and query picked.
   
   ```
   [2023-01-18 06:40:00,049: INFO/MainProcess] Scheduler: Sending due task reports.scheduler (reports.scheduler)
   superset_worker         | [2023-01-18 06:40:00,056: INFO/MainProcess] Task reports.scheduler[dd0248f4-f49a-4ab0-9a77-9fbabe4adadf] received
   superset_worker         | Scheduling alert rohit2 eta: 2023-01-18 06:40:00
   superset_worker         | [2023-01-18 06:40:00,090: INFO/ForkPoolWorker-3] Scheduling alert rohit2 eta: 2023-01-18 06:40:00
   superset_worker         | [2023-01-18 06:40:00,109: INFO/MainProcess] Task reports.execute[469516fc-550d-4f1e-af61-5bc08dcb9d70] received
   superset_worker         | [2023-01-18 06:40:00,111: INFO/ForkPoolWorker-3] Task reports.scheduler[dd0248f4-f49a-4ab0-9a77-9fbabe4adadf] succeeded in 0.0535676684230566s: None
   superset_worker         | Query for rohit2 took 12.03 ms
   superset_worker         | [2023-01-18 06:40:00,244: INFO/ForkPoolWorker-3] Query for rohit2 took 12.03 ms
   superset_worker         | Getting chart from http://superset-dev.hotwax.io/api/v1/chart/2440/data/?format=csv&type=post_processed&force=true
   superset_worker         | [2023-01-18 06:40:00,262: INFO/ForkPoolWorker-3] Getting chart from http://superset-dev.hotwax.io/api/v1/chart/2440/data/?format=csv&type=post_processed&force=true
    Report sent to email
   superset_worker         | [2023-01-18 06:40:00,950: INFO/ForkPoolWorker-3] Report sent to email
   superset_worker         | [2023-01-18 06:40:00,966: INFO/ForkPoolWorker-3] Task reports.execute[469516fc-550d-4f1e-af61-5bc08dcb9d70] succeeded in 0.853576734662056s: None
   
   ```
   
   And on next schedule it just schedule but nor pick query neither sent email-report
   ```
   [2023-01-18 06:44:00,000: INFO/MainProcess] Scheduler: Sending due task reports.scheduler (reports.scheduler)
   superset_worker         | [2023-01-18 06:44:00,001: INFO/MainProcess] Task reports.scheduler[469a428f-7b46-4263-a7ee-7bd960aeb7f6] received
   superset_worker         | Scheduling alert rohit2 eta: 2023-01-18 06:44:00
   superset_worker         | [2023-01-18 06:44:00,010: INFO/ForkPoolWorker-3] Scheduling alert rohit2 eta: 2023-01-18 06:44:00
   superset_worker         | [2023-01-18 06:44:00,012: INFO/MainProcess] Task reports.execute[7b5e1aac-188f-4750-bb6c-bc1f155439dc] received
   superset_worker         | [2023-01-18 06:44:00,013: INFO/ForkPoolWorker-3] Task reports.scheduler[469a428f-7b46-4263-a7ee-7bd960aeb7f6] succeeded in 0.01111413724720478s: None
   superset_worker         | [2023-01-18 06:44:00,043: INFO/ForkPoolWorker-3] Task reports.execute[7b5e1aac-188f-4750-bb6c-bc1f155439dc] succeeded in 0.029230665415525436s: None
   ```
   
   Why not Picking Query is I have to add any other task annotations or someting for alert ?


-- 
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


[GitHub] [superset] Rohit-pawar902 commented on issue #22755: Alert is not working as expected and got unregistered-task error for alert

Posted by GitBox <gi...@apache.org>.
Rohit-pawar902 commented on issue #22755:
URL: https://github.com/apache/superset/issues/22755#issuecomment-1396529335

   Sorry Its My bad , I Ignored the grace period setting , and we know that when report triggered in grace period It just scheduled but  not send any report or responce .
   
   All things are good to go


-- 
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


[GitHub] [superset] Abhijrathod commented on issue #22755: Alert is not working as expected and got unregistered-task error for alert

Posted by GitBox <gi...@apache.org>.
Abhijrathod commented on issue #22755:
URL: https://github.com/apache/superset/issues/22755#issuecomment-1386049167

   The problem you're experiencing is likely caused by the way Celery is configured to handle the results of the task. Based on your configuration, it seems that the task alerts.schedule_check is set to ignore the results and only care about the task's successful completion.
   
   You can change this behavior by modifying the configuration for the task in CELERY_ANNOTATIONS so that the ignore_result key is set to False. This will allow Celery to store the result of the task and make it available for other parts of the application to access, such as the email sending functionality.
   
   Another possible issue might be with your mail server configuration, in which case you should check your mail server configurations and ensure that the mail server can send emails.
   
   It's also important to make sure that the task alerts.schedule_check is able to successfully send the email, and that there are no errors in the email sending code. You can check the logs of the Superset application and the mail server to see if there are any error messages related to the sending of the email.
   
   Try to check the celery task logs if there is any error message or not.


-- 
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


[GitHub] [superset] Rohit-pawar902 closed issue #22755: Alert is not working as expected and got unregistered-task error for alert

Posted by GitBox <gi...@apache.org>.
Rohit-pawar902 closed issue #22755: Alert is not working as expected and got unregistered-task error for alert
URL: https://github.com/apache/superset/issues/22755


-- 
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


[GitHub] [superset] Rohit-pawar902 commented on issue #22755: Alert is not working as expected and got unregistered-task error for alert

Posted by GitBox <gi...@apache.org>.
Rohit-pawar902 commented on issue #22755:
URL: https://github.com/apache/superset/issues/22755#issuecomment-1386534745

   There is no Error in **mail-server** because Report Scheduling is Working Perfectly.
   
   I think Problem is this
   ```The problem you're experiencing is likely caused by the way Celery is configured to handle the results of the task. Based on your configuration, it seems that the task alerts.schedule_check is set to ignore the results and only care about the task's successful completion.
   
   You can change this behavior by modifying the configuration for the task in CELERY_ANNOTATIONS so that the ignore_result key is set to False. This will allow Celery to store the result of the task and make it available for other parts of the application to access, such as the email sending functionality.
   ```
   because logs show it was an unregistered task alerts.schedule_check 
   
   
   
   
   
   
   
   
   
   


-- 
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