superset icon indicating copy to clipboard operation
superset copied to clipboard

Trying to schedule a dashboard delivery via email throws an error

Open visakhmurukes opened this issue 6 years ago • 3 comments

When trying to schedule email delivery for a dashboard using Manage -> Dashboard Emails option creates a celery task on background which errors out due to timeout issues. Tried setting a higher timeout value but the error persists

Expected results

Expecting dashboard to get delivered to intended recipients as per set schedule what you expected to happen.

Actual results

Gets the below error from the celery worker task

ERROR/MainProcess] Task handler raised error: TimeLimitExceeded(1200,) Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/billiard/pool.py", line 658, in on_hard_timeout raise TimeLimitExceeded(job._timeout) billiard.exceptions.TimeLimitExceeded: TimeLimitExceeded(1200,) [2019-12-22 07:38:08,788: ERROR/MainProcess] Hard time limit (1200s) exceeded for email_reports.send[12494507-277d-4e31-9bd4-876b7f9525a3] [2019-12-22 07:38:08,899: ERROR/MainProcess] Process 'ForkPoolWorker-1' pid:61809 exited with 'signal 9 (SIGKILL)'

Screenshots

Dashboard schedule Celerywrk

How to reproduce the bug

  1. Start a celery worker and celery beat session as per superset article
  2. Create a sample dashboard
  3. Go to Manage -> Dashboard Emails option
  4. select the sample dashboard and set a cron tab schedule like say 10 * * *
  5. Save it
  6. In the celery worker terminal you can see a warning stating softtimeout exceeded followed by an error with above stated message

Environment

(please complete the following information):

  • superset version: 0.33.0rc1
  • python version: 3.6.9

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

  • [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [x] I have reproduced the issue with at least the latest released version of superset.
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar.

visakhmurukes avatar Dec 23 '19 06:12 visakhmurukes

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.97. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

issue-label-bot[bot] avatar Dec 23 '19 06:12 issue-label-bot[bot]

Confirmed, This issue happens because of setting celery task soft timeout hardcode in the tasks/schedule.py:

@celery_app.task(name="email_reports.send", bind=True, soft_time_limit=300)

I will create a PR for that.

blcksrx avatar Dec 23 '19 13:12 blcksrx

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Feb 21 '20 13:02 stale[bot]