You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "joaopamaral (via GitHub)" <gi...@apache.org> on 2025/05/26 22:22:53 UTC

[I] πŸ› Report Schedule execution failed when user who created is not active (but current owner is active) [superset]

joaopamaral opened a new issue, #33584:
URL: https://github.com/apache/superset/issues/33584

   ### Bug description
   
   Scheduled reports are failing silently when the original creator of the report becomes inactive, even if the report has a different, currently active owner. This behavior is unexpected as the only solution is to recreate the same report schedule with an active user.
   
   If a report is assigned to a group of people or transferred to a different owner, the scheduling should continue as long as there is an active owner. The report should not stop being sent simply because the original creator is inactive.
   
   
   ### Screenshots/recordings
   
   ![Image](https://github.com/user-attachments/assets/3d3e4307-a699-4513-b6fe-605ee08e521c)
   
   ### Superset version
   
   4.1.2
   
   ### Python version
   
   3.11
   
   ### Node version
   
   I don't know
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   ```
   Traceback (most recent call last):
   
   raise ReportScheduleCsvFailedError()
   File "/opt/superset/lib/python3.11/site-packages/superset/commands/report/execute.py", line 436, in _get_notification_content
   File "/opt/superset/lib/python3.11/site-packages/superset/commands/report/execute.py", line 527, in send
   result = func(*args, **kwargs)
   File "/opt/superset/lib/python3.11/site-packages/superset/utils/decorators.py", line 236, in on_error
   return on_error(ex)
   File "/opt/superset/lib/python3.11/site-packages/superset/commands/report/execute.py", line 527, in send
   self.send()
   File "/opt/superset/lib/python3.11/site-packages/superset/commands/report/execute.py", line 761, in run
   File "/opt/superset/lib/python3.11/site-packages/superset/commands/report/execute.py", line 799, in run
   File "/opt/superset/lib/python3.11/site-packages/superset/utils/decorators.py", line 236, in on_error
   
   Traceback (most recent call last):
   [2025-05-23 06:05:16,121: ERROR/MainProcess] A downstream exception occurred while generating a report: 5e4400a9-68ae-4bcd-a901-b89843fc1f80. Report Schedule execution failed when generating a screenshot.
   File "/opt/superset/lib/python3.11/site-packages/superset/commands/report/execute.py", line 272, in _get_screenshots
   File "/opt/superset/lib/python3.11/site-packages/superset/commands/report/execute.py", line 629, in next
   File "/opt/superset/lib/python3.11/site-packages/superset/utils/decorators.py", line 236, in on_error
   
   result = func(*args, **kwargs)
   File "/opt/superset/lib/python3.11/site-packages/superset/utils/decorators.py", line 259, in wrapped
   raise ex
   File "/opt/superset/lib/python3.11/site-packages/superset/utils/decorators.py", line 266, in wrapped
   return on_error(ex)
   File "/opt/superset/lib/python3.11/site-packages/superset/tasks/scheduler.py", line 95, in execute
   superset.commands.report.exceptions.ReportScheduleScreenshotFailedError: Report Schedule execution failed when generating a screenshot.
   raise ReportScheduleScreenshotFailedError()
   File "/opt/superset/lib/python3.11/site-packages/superset/commands/report/execute.py", line 410, in _get_notification_content
   
   notification_content = self._get_notification_content()
   ^^^^^^^^
   .next()
   ^^^^^^^^^^^^^^^^^^^^^
   result = func(*args, **kwargs)
   File "/opt/superset/lib/python3.11/site-packages/superset/utils/decorators.py", line 259, in wrapped
   raise ex
   File "/opt/superset/lib/python3.11/site-packages/superset/utils/decorators.py", line 266, in wrapped
   return on_error(ex)
   ].run()
   ^^^^^^^^
   screenshot_data = self._get_screenshots()
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   return on_error(ex)
   ].run()
   ^^^^^^
   ```
   
   ### Checklist
   
   - [x] 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] πŸ› Report Schedule execution failed when user who created is not active (but current owner is active) [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
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-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] πŸ› Report Schedule execution failed when user who created is not active (but current owner is active) [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #33584:
URL: https://github.com/apache/superset/issues/33584#issuecomment-5127295333

   I think I've confirmed on `master`: `get_executor` picks a username without checking `is_active`, and `login_user()` in `MachineAuthProviderUser.get_auth_cookies` isn't called with `force=True`, so an inactive executor silently fails to authenticate instead of raising anything useful, and that's what surfaces as this screenshot failure. `get_executor` needs to skip inactive owners/creator/modifier and only raise `ExecutorNotFoundError` if none are active. 


-- 
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] πŸ› Report Schedule execution failed when user who created is not active (but current owner is active) [superset]

Posted by "Abdulrehman-PIAIC80387 (via GitHub)" <gi...@apache.org>.
Abdulrehman-PIAIC80387 commented on issue #33584:
URL: https://github.com/apache/superset/issues/33584#issuecomment-5128320980

   Thanks for the pointer @rusackas β€” traced it exactly as you described. `get_executor` returns the first CREATOR/MODIFIER/EDITOR without checking `user.active`, so an inactive username lands in `login_user()` which silently returns `False` and the schedule runs with no auth cookie β†’ `ReportScheduleCsvFailedError`.
   
   Fix adds a small `_is_active(user)` predicate at every direct-user return site so the priority chain falls through to the next active candidate (or raises the existing `ExecutorNotFoundError` if none). Kept `login_user(force=True)` off the table β€” that would let deactivated users execute schedules, which is the opposite of what deactivation is for. PR incoming.


-- 
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] πŸ› Report Schedule execution failed when user who created is not active (but current owner is active) [superset]

Posted by "Shannus (via GitHub)" <gi...@apache.org>.
Shannus commented on issue #33584:
URL: https://github.com/apache/superset/issues/33584#issuecomment-3257515324

   It is happening to me also
   


-- 
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] πŸ› Report Schedule execution failed when user who created is not active (but current owner is active) [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #33584:
URL: https://github.com/apache/superset/issues/33584#issuecomment-2913354620

   @eschutho 


-- 
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] πŸ› Report Schedule execution failed when user who created is not active (but current owner is active) [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #33584: πŸ› Report Schedule execution failed when user who created is not active (but current owner is active)
URL: https://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-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