Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domain Sharding and ALERT_REPORTS don't work at together #25130

Closed
3 tasks done
matias-magallanes opened this issue Aug 30, 2023 · 9 comments
Closed
3 tasks done

Domain Sharding and ALERT_REPORTS don't work at together #25130

matias-magallanes opened this issue Aug 30, 2023 · 9 comments

Comments

@matias-magallanes
Copy link

matias-magallanes commented Aug 30, 2023

When "Domain Sharding" and ALERTS_REPORTS are configured together, the reports sent by email arrive with the error message: "Unexpected error"

image

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'
  1. 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/"
  1. Next you must configure a report in the Superset UI
    image

  2. Then when the report arrives to email this show a error message. Unexpected Error

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

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!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • 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

@nytai
Copy link
Member

nytai commented Sep 5, 2023

This is because the domains aren’t reachable from wherever you have superset workers deployed

@matias-magallanes
Copy link
Author

Hi, @nytai, thank you for your reply,
All my workers run as a pods in a K8s cluster and I tested on all of then and I reached all domains configured in SUPERSET_WEBSERVER_DOMAINS.

  • Domain resolution with dig ok, and
  • HTTPs access with curl ok
    But the issue persist.

@nytai
Copy link
Member

nytai commented Sep 5, 2023

Ah, then it's likely a mix of http/https protocols. Does it work if you use the public facing url for WEBDRIVER_BASEURL?

@primmayora
Copy link

Ah, then it's likely a mix of http/https protocols. Does it work if you use the public facing url for WEBDRIVER_BASEURL?

It not worked even the email is not being send.

@rusackas
Copy link
Member

@michael-s-molina are you guys using these flags together?

@michael-s-molina
Copy link
Member

@michael-s-molina are you guys using these flags together?

We're not using domain sharding anymore.

@rusackas
Copy link
Member

rusackas commented Jul 9, 2024

I wonder who, if anyone, is using domain sharding anymore. If nobody wants to support it, perhaps it should be on the 5.0/6.0 chopping block.

Closing this issue as stale (and, effectively, unreproducible to anyone I know of), but happy to reopen if anyone is still facing this.

@rusackas rusackas closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
@EmmanuelCbd
Copy link
Contributor

Hi @rusackas ,
We're using domain sharding, don't chop it from the project, please :)
I saw the card 74 in projects.

@rusackas
Copy link
Member

It might not be removed in 5.0, but it is being deprecated, and will be gone in 6.0. The need domain sharding was designed to address is largely addressed by enabling HTTP2. It's no longer used by the author (airbnb) and is thus largely unmaintained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants