dosubot[bot] commented on issue #35172:
URL: https://github.com/apache/superset/issues/35172#issuecomment-3302464117

   <!-- Greeting -->
   Hi @cvrdev! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.
   
   <!-- Answer -->
   Your error is likely caused by a mismatch or missing configuration for the 
headless browser inside your Docker worker container. Superset relies on 
Selenium WebDriver (with Firefox/Chrome) for generating report screenshots, and 
the default Docker image does not include a browser or driver by default. The 
AttributeError about 'capabilities' usually means the WebDriver configuration 
is not matching what Selenium expects, or the browser/driver is missing or 
misconfigured 
[[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/config.py)].
   
   **How to fix:**
   
   1. **Install a headless browser and driver in your worker container.**  
      The latest docs recommend using Playwright with Chrome, or you can use 
Firefox with geckodriver, or Chrome with chromedriver. Only the worker 
container needs the browser. Example Dockerfile snippets are available in the 
updated docs [[source](https://github.com/apache/superset/pull/34908)].
   
   2. **Check your `superset_config.py` for the correct WebDriver 
configuration.**  
      For Firefox, the default config is:
      ```python
      WEBDRIVER_TYPE = "firefox"
      WEBDRIVER_CONFIGURATION = {
          "options": {"capabilities": {}, "preferences": {}, "binary_location": 
""},
          "service": {"log_output": "/dev/null", "service_args": [], "port": 0, 
"env": {}},
      }
      WEBDRIVER_OPTION_ARGS = ["--headless"]
      ```
      For Chrome, set:
      ```python
      WEBDRIVER_TYPE = "chrome"
      WEBDRIVER_OPTION_ARGS = [
          "--force-device-scale-factor=2.0",
          "--high-dpi-support=2.0",
          "--headless",
          "--disable-gpu",
          "--disable-dev-shm-usage",
          "--no-sandbox",
          "--disable-setuid-sandbox",
          "--disable-extensions",
      ]
      ```
   
   3. **Verify the browser and driver are installed and accessible.**  
      Enter your worker container and run `firefox --headless` and 
`geckodriver` (or `chromedriver` for Chrome) to confirm they start without 
errors [[source](https://github.com/apache/superset/pull/34908)].
   
   4. **If using the Docker dev environment, set 
`ALERT_REPORTS_NOTIFICATION_DRY_RUN = False`** in your config to actually send 
emails, not just simulate them 
[[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/docker/pythonpath_dev/superset_config.py)].
   
   5. **Restart your worker container** after making these changes.
   
   If you still see the AttributeError, double-check that your 
`WEBDRIVER_CONFIGURATION` matches the expected structure and that the 
browser/driver versions are compatible with your Selenium version 
[[source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/utils/webdriver.py)].
   
   More details and example Dockerfiles are in the updated documentation:  
   https://github.com/apache/superset/pull/34908
   
   Let me know if you need a specific example for your Dockerfile or config!
   
   
   <!-- 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/0e25f250-1fe7-465e-92cf-a65e6c4de26b?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/0e25f250-1fe7-465e-92cf-a65e6c4de26b?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/0e25f250-1fe7-465e-92cf-a65e6c4de26b?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/0e25f250-1fe7-465e-92cf-a65e6c4de26b?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/0e25f250-1fe7-465e-92cf-a65e6c4de26b?feedback_type=hallucination)
 | [Report 
šŸ›](https://app.dosu.dev/response-feedback/0e25f250-1fe7-465e-92cf-a65e6c4de26b?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/0e25f250-1fe7-465e-92cf-a65e6c4de26b?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 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/issues/35172)


-- 
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-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to