dosubot[bot] commented on issue #40047: URL: https://github.com/apache/superset/issues/40047#issuecomment-4429460493
<!-- Answer --> Hey @adayush, this is a known pattern in Superset's report state machine. Here's what's happening and some things to try: **Why reports get stuck:** When a report starts executing, it enters `WORKING` state. If the underlying process (screenshot capture, CSV generation, etc.) fails silently — e.g., due to a Celery worker crash, Selenium/browser failure, or database connectivity hiccup — the state never transitions to `SUCCESS` or `ERROR`. All subsequent runs then hit the `ReportSchedulePreviousWorkingError` because the system thinks the previous execution is still in progress [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/commands/report/execute.py#L770-L783). **The timeout mechanism:** Superset has a built-in timeout (`ALERT_REPORTS_DEFAULT_WORKING_TIMEOUT`, default **3600 seconds / 1 hour**) that should eventually force stuck reports into ERROR state [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py#L1488). If your reports have been stuck longer than that, the timeout mechanism itself may not be functioning — possibly because `ALERT_REPORTS_WORKING_TIME_OUT_KILL` is disabled or the Celery beat scheduler isn't triggering re-checks. **Things to try:** 1. **Ensure these config values are set:** ```python ALERT_REPORTS_WORKING_TIME_OUT_KILL = True # default is True ALERT_REPORTS_DEFAULT_WORKING_TIMEOUT = 3600 # seconds ``` [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py#L1460) 2. **Reset the execution log, not just the report state.** When you manually set report `last_state` to ERROR, you also need to ensure the *report execution log* (`report_execution_log` table) reflects a terminal state. The system checks for the last log entry with `state = 'working'` and `error_message IS NULL` to determine if a report is still running [[4]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/daos/report.py#L233-L248). Try updating those log entries too: ```sql UPDATE report_execution_log SET state = 'error', error_message = 'Manually reset' WHERE state = 'working' AND error_message IS NULL; ``` 3. **Check your screenshot/browser infrastructure.** The fact that you see no logs after "Running report schedule..." suggests the process is hanging during content generation (screenshot or data fetch). If you're using Selenium, verify ChromeDriver and Chrome versions match. Consider switching to Playwright which is more stable in Superset 5.0: ```python FEATURE_FLAGS = { "PLAYWRIGHT_REPORTS_AND_THUMBNAILS": True, } ``` [[5]](https://github.com/apache/superset/issues/37357#issuecomment-3783679235) 4. **Check Celery worker concurrency and timeouts.** You mentioned increasing timeout to 5 minutes — but the report itself may be hanging indefinitely on a subprocess (e.g., Selenium). Ensure Celery's `--task-time-limit` (hard kill) is set to something reasonable like `ALERT_REPORTS_DEFAULT_WORKING_TIMEOUT + 10` so workers forcibly kill hung tasks [[6]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/tasks/scheduler.py#L66-L77). The key insight is that setting `last_state` on the report schedule alone isn't sufficient — the execution log entries are what the state machine actually checks to decide if a report is "still working." <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=08e25b87-3291-40c8-9e97-9b72be97e5db) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
