You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "oscep (via GitHub)" <gi...@apache.org> on 2024/07/18 08:05:31 UTC

[I] Report fails to generate if dashboard doesn't contain a chart [superset]

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

   ### Bug description
   
   Superset cannot create a report for a dashboard without a chart element because the Selenium code involved waits for at least one chart element to render. A timeout occurs without a chart element present (see stack trace below).
   
   
   This leads to an error message in the execution log which doesn't provide any meaningful information:
   <img width="1469" alt="Screenshot 2024-07-18 at 10 00 03" src="https://github.com/user-attachments/assets/5bb053d9-8a8d-4330-88ab-e839cf185001">
   
   We would suggest to either take a screenshot without chart elements present or to include a meaningful hint in the error message. Feel free to propose different solutions :-) 
   
   
   ### How to reproduce the bug
   
   1. Create a Superset dashboard with a text layout element but no chart
   2. Enable and configure Alerts & Reports for your Superset instance
   3. Schedule a report for the dashboard created above
   4. Access the execution log of the report.
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   4.0.2
   
   ### Python version
   
   3.10
   
   ### Node version
   
   18 or greater
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   ```
   Selenium timed out waiting for chart containers to draw at url http://superset.data:30080/superset/dashboard/914cb113-ac4a-4ba4-a46e-8f05e517691b/?force=false&standalone=3
   Traceback (most recent call last):
     File "/app/superset/utils/webdriver.py", line 378, in get_screenshot
       WebDriverWait(driver, self._screenshot_locate_wait).until(
     File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/support/wait.py", line 80, in until
       raise TimeoutException(message, screen, stacktrace)
   selenium.common.exceptions.TimeoutException: Message: 
   ```
   
   ### 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 fails to generate if dashboard doesn't contain a chart [superset]

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

   Might be resolved with #33107?


-- 
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 fails to generate if dashboard doesn't contain a chart [superset]

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

   This issue has been resolved by two separate fixes:
   
   1. **For Selenium-based screenshots**: PR #30767 (merged Nov 2024) - Checks if a dashboard contains charts first and skips the wait if empty
   2. **For Playwright-based screenshots**: PR #33107 (merged Apr 2025) - Allows screenshotting empty dashboards without timeout
   
   Both fixes are now available in recent Superset releases. Empty dashboards containing only text or other non-chart elements can now be successfully screenshot for reports.
   
   Thank you for the detailed bug report with reproduction steps and stack trace - this helped identify and fix the issue for both screenshot implementations.
   
   Closing as fixed.


-- 
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 fails to generate if dashboard doesn't contain a chart [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #29629:
URL: https://github.com/apache/superset/issues/29629#issuecomment-2236155946

   <!-- Greeting -->
   Hello @oscep! I'm here to help you with any bugs, questions, or contributions you have for the repository. Let's work together to solve any issues you're facing.
   
   <!-- Answer -->
   To address the issue of generating reports for dashboards without chart elements, you can use the `force_screenshot` option. This option ensures that a screenshot is taken even if the dashboard does not contain any chart elements. Here is the relevant code snippet:
   
   ```tsx
   const shouldEnableForceScreenshot = contentType === 'chart' && !isReport;
   const data: any = {
     ...currentAlert,
     type: isReport ? 'Report' : 'Alert',
     force_screenshot: shouldEnableForceScreenshot || forceScreenshot,
     validator_type: conditionNotNull ? 'not null' : 'operator',
     validator_config_json: conditionNotNull
       ? {}
       : currentAlert?.validator_config_json,
     chart: contentType === 'chart' ? currentAlert?.chart?.value : null,
     dashboard:
       contentType === 'dashboard' ? currentAlert?.dashboard?.value : null,
     custom_width: isScreenshot ? currentAlert?.custom_width : undefined,
     database: currentAlert?.database?.value,
     owners: (currentAlert?.owners || []).map(
       owner => (owner as MetaObject).value || owner.id,
     ),
     recipients,
     report_format: reportFormat || DEFAULT_NOTIFICATION_FORMAT,
   };
   ```
   
   This approach ensures that the alert or report will still function correctly even if the dashboard lacks chart elements by forcing a screenshot <sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/features/alerts/AlertReportModal.tsx)</sup>.
   
   Additionally, to provide more meaningful error messages, you can customize the error handling in the report scheduling system. For example, you can modify the string passed to the custom exceptions to include more context, such as the report name:
   
   ```python
   raise ReportScheduleScreenshotFailedError(
       f"Failed taking a screenshot for report {self._report_schedule.name}: {str(ex)}"
   ) from ex
   ```
   
   This would make the error messages more informative and helpful for debugging <sup>[[2]](https://github.com/apache/superset/blob/master/superset/commands/report/execute.py)</sup><sup>[[3]](https://github.com/apache/superset/blob/master/superset/commands/report/exceptions.py)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
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 fails to generate if dashboard doesn't contain a chart [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #29629: Report fails to generate if dashboard doesn't contain a chart
URL: https://github.com/apache/superset/issues/29629


-- 
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 fails to generate if dashboard doesn't contain a chart [superset]

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

   I'm not sure if the bot is correct here or not, but this has been silent for 250+ days. Can you confirm this is still an issue in newer (4.1.2 or better yet 5.0.0) versions? If you're willing to open a PR with a better error message, that'd be appreciated. Also curious if the Playwright version works better.


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