GitHub user dosubot[bot] added a comment to the discussion: 
selenium.common.exceptions.InvalidCookieDomainException: Message: invalid 
cookie domain

<!-- Answer -->
The InvalidCookieDomainException happens when the domain used for 
authentication (from WEBDRIVER_BASEURL) does not exactly match the domain of 
the URL being screenshotted. This includes differences like localhost vs. 
127.0.0.1, different ports, or subdomains. Superset does not normalize or 
validate these domains before setting cookies, so any mismatch will cause this 
Selenium error and block screenshot generation 
([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/utils/machine_auth.py)).
 When screenshot generation fails, the report email is not sent, since the 
screenshot is a required part of the report workflow 
([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/commands/report/execute.py)).

To fix this, make sure that:
- WEBDRIVER_BASEURL in your superset_config.py matches exactly the domain, 
port, and protocol of the URLs being used for reports and dashboards.
- If you access Superset at http://localhost:8088, set WEBDRIVER_BASEURL = 
"http://localhost:8088/";. If you use a hostname or a different port, match that 
exactly.
- Avoid mixing localhost, 127.0.0.1, or different hostnames/ports between your 
Superset config, browser access, and any reverse proxy setup.

Also, double-check your SMTP settings (SMTP_HOST, SMTP_PORT, SMTP_USER, 
SMTP_PASSWORD, SMTP_MAIL_FROM) in superset_config.py to ensure email delivery 
works if screenshots succeed 
([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py)).

If you still have issues after aligning the domains, check for any errors in 
your Superset logs related to SMTP or email sending. Let me know if you need 
help with the exact config or want to share your current WEBDRIVER_BASEURL and 
dashboard/report URLs for review.


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/0ceb308b-6e66-46bf-a2ab-b3fe1ab83633?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/0ceb308b-6e66-46bf-a2ab-b3fe1ab83633?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/0ceb308b-6e66-46bf-a2ab-b3fe1ab83633?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/0ceb308b-6e66-46bf-a2ab-b3fe1ab83633?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/0ceb308b-6e66-46bf-a2ab-b3fe1ab83633?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/0ceb308b-6e66-46bf-a2ab-b3fe1ab83633?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/0ceb308b-6e66-46bf-a2ab-b3fe1ab83633?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;[![Sh
 are 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/discussions/34122)

GitHub link: 
https://github.com/apache/superset/discussions/34122#discussioncomment-13720691

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to