dosubot[bot] commented on issue #33584:
URL: https://github.com/apache/superset/issues/33584#issuecomment-2910707123

   <!-- Answer -->
   Based on your description and the traceback, it appears that Superset's 
scheduled reports may fail to execute if the original creator of the report 
becomes inactive, even when there are other active owners. This is not the 
intended behaviorโ€”scheduled reports should continue as long as there is at 
least one active owner.
   
   Here's what I found regarding the implementation and possible cause:
   
   - The report schedule schema includes an `owners` field, which is meant to 
specify which users can manage the report. If this field is empty, the creator 
is automatically added as an owner. The `active` field controls whether the 
schedule itself is enabled or disabled 
[[source](https://github.com/apache/superset/blob/master/superset/reports/schemas.py)].
   - The execution logic for scheduled reports attempts to generate screenshots 
and send notifications as the "executor" user. The code retrieves the executor 
using the report schedule's configuration, and if the user is inactive or 
missing, this can cause failures in screenshot generation, resulting in errors 
like `ReportScheduleScreenshotFailedError` 
[[source](https://github.com/apache/superset/blob/master/superset/commands/report/execute.py)].
   - The code does attempt to validate and update ownership when a report 
schedule is updated, but there is logic that may inadvertently tie execution to 
the original creator if the `owners` field is not explicitly set or updated 
[[source](https://github.com/apache/superset/blob/master/superset/commands/report/update.py)].
   - There is no documentation or prior issue directly addressing this specific 
scenario, and the only workaround currently is to recreate the report schedule 
with an active user.
   
   **Potential workaround:**
   - Ensure that the `owners` field for your report schedule explicitly lists 
all intended active owners. You may need to update the report schedule via the 
UI or API to set the correct owners.
   - If the report was created without specifying owners, and the original 
creator is now inactive, Superset may still attempt to use the inactive user as 
the executor for scheduled tasks, causing failures.
   - If updating the owners does not resolve the issue, recreating the report 
schedule with an active user is currently the only reliable workaround.
   
   **Summary:**  
   This appears to be a gap in the current logic where the executor for 
scheduled reports defaults to the creator, regardless of current ownership. As 
a result, if the creator is inactive, the schedule fails even if there are 
active owners. Explicitly setting the owners may help, but if not, recreating 
the schedule is necessary until this logic is improved in Superset.
   
   If you need more technical details or want to explore a code-based 
workaround, let me know!
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/85ac3749-e046-4aa1-97ce-d3ef5034b600?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/85ac3749-e046-4aa1-97ce-d3ef5034b600?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/85ac3749-e046-4aa1-97ce-d3ef5034b600?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/85ac3749-e046-4aa1-97ce-d3ef5034b600?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/85ac3749-e046-4aa1-97ce-d3ef5034b600?feedback_type=hallucination)
 | [Report 
๐Ÿ›](https://app.dosu.dev/response-feedback/85ac3749-e046-4aa1-97ce-d3ef5034b600?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/85ac3749-e046-4aa1-97ce-d3ef5034b600?feedback_type=other)</sup>&nbsp;&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[!
 [Share on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/33584)


-- 
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-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to