diff --git a/docker/pythonpath_dev/superset_config.py b/docker/pythonpath_dev/superset_config.py index bb76329eb91..fe78670a9cc 100644 --- a/docker/pythonpath_dev/superset_config.py +++ b/docker/pythonpath_dev/superset_config.py @@ -122,7 +122,13 @@ FEATURE_FLAGS = { } EXTENSIONS_PATH = "/app/docker/extensions" ALERT_REPORTS_NOTIFICATION_DRY_RUN = True -WEBDRIVER_BASEURL = f"http://superset_app{os.environ.get('SUPERSET_APP_ROOT', '/')}/" # When using docker compose baseurl should be http://superset_nginx{ENV{BASEPATH}}/ # noqa: E501 +# The Docker Compose app service is named "superset" and listens on 8088. Report +# paths are root-relative, so urljoin drops the base path; only the scheme, host, +# and port must be correct here. SUPERSET_APP_ROOT is kept for consumers that +# concatenate paths directly (e.g. cache warm-up). For screenshots in the dev +# stack (unbuilt static assets) point this at the nginx service instead: +# http://nginx{SUPERSET_APP_ROOT}/ +WEBDRIVER_BASEURL = f"http://superset:8088{os.environ.get('SUPERSET_APP_ROOT', '/')}/" # The base URL for the email report hyperlinks. WEBDRIVER_BASEURL_USER_FRIENDLY = ( f"http://localhost:8888/{os.environ.get('SUPERSET_APP_ROOT', '/')}/" diff --git a/docs/admin_docs/configuration/alerts-reports.mdx b/docs/admin_docs/configuration/alerts-reports.mdx index fbc0d11aa5e..adff1abb573 100644 --- a/docs/admin_docs/configuration/alerts-reports.mdx +++ b/docs/admin_docs/configuration/alerts-reports.mdx @@ -132,7 +132,7 @@ Superset sends an HTTP POST with `Content-Type: application/json`: }, "text": "Alert condition met: value exceeded threshold", "description": "Monthly revenue dropped below target", - "url": "https://your-superset-host/superset/dashboard/1/" + "url": "https://your-superset-host/dashboard/1/" } ``` @@ -278,7 +278,7 @@ WEBDRIVER_OPTION_ARGS = [ ] # This is for internal use, you can keep http -WEBDRIVER_BASEURL = "http://superset:8088" # When running using docker compose use "http://superset_app:8088' +WEBDRIVER_BASEURL = "http://superset:8088" # This is also the default for Docker Compose, where the app service is named "superset" # This is the link sent to the recipient. Change to your domain, e.g. https://superset.mydomain.com WEBDRIVER_BASEURL_USER_FRIENDLY = "http://localhost:8088" ``` @@ -403,9 +403,9 @@ Possible fixes: The worker may be unable to reach the report. It will use the value of `WEBDRIVER_BASEURL` to browse to the report. If that route is invalid, or presents an authentication challenge that the worker can't pass, the report screenshot will fail. -Check this by attempting to `curl` the URL of a report that you see in the error logs of your worker. For instance, from the worker environment, run `curl http://superset_app:8088/superset/dashboard/1/`. You may get different responses depending on whether the dashboard exists - for example, you may need to change the `1` in that URL. If there's a URL in your logs from a failed report screenshot, that's a good place to start. The goal is to determine a valid value for `WEBDRIVER_BASEURL` and determine if an issue like HTTPS or authentication is redirecting your worker. +Check this by attempting to `curl` the URL of a report that you see in the error logs of your worker. For instance, from the worker environment, run `curl http://superset:8088/dashboard/1/`. You may get different responses depending on whether the dashboard exists - for example, you may need to change the `1` in that URL. If there's a URL in your logs from a failed report screenshot, that's a good place to start. The goal is to determine a valid value for `WEBDRIVER_BASEURL` and determine if an issue like HTTPS or authentication is redirecting your worker. -In a deployment with authentication measures enabled like HTTPS and Single Sign-On, it may make sense to have the worker navigate directly to the Superset application running in the same location, avoiding the need to sign in. For instance, you could use `WEBDRIVER_BASEURL="http://superset_app:8088"` for a docker compose deployment, and set `"force_https": False,` in your `TALISMAN_CONFIG`. +In a deployment with authentication measures enabled like HTTPS and Single Sign-On, it may make sense to have the worker navigate directly to the Superset application running in the same location, avoiding the need to sign in. For instance, you could use `WEBDRIVER_BASEURL="http://superset:8088"` for a docker compose deployment, and set `"force_https": False,` in your `TALISMAN_CONFIG` — appropriate only for an isolated development stack or when HTTPS is enforced by a trusted proxy in front of Superset. ### Duplicate report deliveries