matias-magallanes opened a new issue, #25130:
URL: https://github.com/apache/superset/issues/25130

   When "Domain Sharding" and ALERTS_REPORTS are configured together, the 
reports sent by email arrive with the error message: "Unexpected error"
   
   
![image](https://github.com/apache/superset/assets/108285118/59abf4ff-b674-4c62-9edf-9628ebe9c8a7)
   
   
   #### How to reproduce the bug
   
   1. Configure Domain Sharding as follows:
   ```
   superset_config.py: |
     ENABLE_CORS = True
     CORS_OPTIONS = {
       'supports_credentials': True,
       'allow_headers': '*',
       'resources': '*',
       'origins': 
['https://superset.example.com','https://superset-1.example.com','https://superset-2.example.com','https://superset-3.example.com','https://superset-4.example.com']
     }
     SUPERSET_WEBSERVER_DOMAINS = 
['superset.example.com','superset-1.example.com','superset-2.example.com','superset-3.example.com','superset-4.example.com']
     SESSION_COOKIE_DOMAIN = 'example.com'
   ```
   2. Then configure Alerts and Reports as Docs here 
(https://superset.apache.org/docs/installation/alerts-reports/). Note that this 
must be configured with your own domain.
   ```
   reports: |
     WEBDRIVER_BASEURL = "http://superset.superset.svc.cluster.local:8088/";
     WEBDRIVER_BASEURL_USER_FRIENDLY = "https://superset.example.com/";
   ```
   3. Next you must configure a report in the Superset UI
   
![image](https://github.com/apache/superset/assets/108285118/59abf4ff-b674-4c62-9edf-9628ebe9c8a7)
   
   4. Then when the report arrives to email this show a error message. 
"Unexpected Error"
   
   5. In the logs of worker pod we don't see any error, we only view the 
process ends successfully
   ```
   Init selenium driver
   [2023-08-30 18:46:00,563: INFO/ForkPoolWorker-1] Init selenium driver
   Taking a PNG screenshot of url 
http://superset.superset.svc.cluster.local:8088/superset/dashboard/9/?force=true&standalone=3
 as user admin
   [2023-08-30 18:46:24,730: INFO/ForkPoolWorker-1] Taking a PNG screenshot of 
url 
http://superset.superset.svc.cluster.local:8088/superset/dashboard/9/?force=true&standalone=3
 as user admin
   Report sent to email, notification content is {'notification_type': 
'Report', 'notification_source': <ReportSourceFormat.DASHBOARD: 'dashboard'>, 
'notification_format': 'PNG', 'chart_id': None, 'dashboard_id': 9, 'owners': 
[Superset Admin]}
   [2023-08-30 18:46:26,781: INFO/ForkPoolWorker-1] Report sent to email, 
notification content is {'notification_type': 'Report', 'notification_source': 
<ReportSourceFormat.DASHBOARD: 'dashboard'>, 'notification_format': 'PNG', 
'chart_id': None, 'dashboard_id': 9, 'owners': [Superset Admin]}
   ```
   ### Expected results
   View the report with the dashboards correctly in the email
   
   ### Actual results
   The report shows an "Unexpected Error" error
   
   #### Screenshots
   
![image](https://github.com/apache/superset/assets/108285118/fb902a25-0e7d-4e31-9d3d-1ed2b2c64bbe)
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: `Chrome 116 / Firefox 116.0.3`
   - superset version: `2.1.0`
   - python version: `Python 3.8.16`
   - node.js version: `node -v`
   - any feature flags active:
   ```
     FEATURE_FLAGS = {
       "DASHBOARD_RBAC": True,
       "ALERT_REPORTS": True,
       "DYNAMIC_PLUGINS": True,
       "DASHBOARD_FILTERS_EXPERIMENTAL": True,
       "DASHBOARD_NATIVE_FILTERS_SET": True,
       "DASHBOARD_NATIVE_FILTERS": True,
       "DRILL_TO_DETAIL": True,
       "DASHBOARD_CROSS_FILTERS": True,
       "ENABLE_TEMPLATE_PROCESSING": True,
       "EMBEDDABLE_CHARTS": True,
       "EMBEDDED_SUPERSET": True,
       "ENABLE_JAVASCRIPT_CONTROLS": True,
       "ENABLE_FILTER_BOX_MIGRATION": True,
       "CONFIRM_DASHBOARD_DIFF": True,
       "UX_BETA": True,
       "VERSIONED_EXPORT": True,
       "GLOBAL_ASYNC_QUERIES": True,
       "GENERIC_CHART_AXES": True,
       "ENABLE_SCHEDULED_EMAIL_REPORTS": True,
       "ALERTS_ATTACH_REPORTS": True,
       "THUMBNAILS": False,
       "THUMBNAILS_SQLA_LISTENERS": False,
       "TAGGING_SYSTEM": True,
     }
   ```
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] 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.
   
   ### Additional context
   The same problem occurs whether we use the firefox driver or the chrome 
driver (for selenium)
   
   It is important to note that if I disable domain sharding (removing the 
configuration indicated at point #1) the reports are generated correctly
   


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

Reply via email to