GitHub user dosubot[bot] added a comment to the discussion: Superset get 
screenshot occurred error

<!-- Answer -->
The error "'dict' object has no attribute 'path'" happens because the 
WEBDRIVER_CONFIGURATION in your superset_config.py is being passed directly to 
Selenium, which expects certain values (like executable_path) to be a string, 
not a dict. If any of these values are accidentally set as a dict, Selenium 
tries to access a .path attribute on them, causing this error. This is a common 
pitfall when merging or editing config files for Selenium in Superset 
[[source](https://github.com/apache/superset/blob/b9052fa46173b0172c7f4349ed0194e441a97ed8/superset/utils/webdriver.py)].

To fix this, make sure your WEBDRIVER_CONFIGURATION looks like this:

```python
WEBDRIVER_CONFIGURATION = {
    "service": {
        "executable_path": "/usr/local/bin/chromedriver",  # must be a string 
path
        "log_output": "/dev/null",  # or your preferred log location
        "service_args": [],
        "port": 0,
        "env": {},
    },
    "options": {
        "capabilities": {},
        "preferences": {},
        "binary_location": "",
    },
}
```
Double-check that executable_path is a string and not a dict or any other type. 
Also, avoid using WEBDRIVER_EXECUTABLE_PATH, as Superset ignores it 
[[source](https://github.com/apache/superset/discussions/34053)].

For stability, you can add these recommended options:
```python
WEBDRIVER_OPTION_ARGS = [
    "--headless",
    "--no-sandbox",
    "--disable-gpu",
    "--disable-dev-shm-usage",
    "--disable-setuid-sandbox",
    "--start-maximized",
]
```
If you still see issues, try increasing the screenshot wait times:
```python
SCREENSHOT_LOCATE_WAIT = 30
SCREENSHOT_LOAD_WAIT = 60
```
[[source](https://github.com/apache/superset/issues/33602)]

After updating your config, restart your Superset services and try again. This 
should resolve the error.


<!-- 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/65613620-f83d-423b-92e0-8f5d875c86fd?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/65613620-f83d-423b-92e0-8f5d875c86fd?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/65613620-f83d-423b-92e0-8f5d875c86fd?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/65613620-f83d-423b-92e0-8f5d875c86fd?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/65613620-f83d-423b-92e0-8f5d875c86fd?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/65613620-f83d-423b-92e0-8f5d875c86fd?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/65613620-f83d-423b-92e0-8f5d875c86fd?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/34060)

GitHub link: 
https://github.com/apache/superset/discussions/34060#discussioncomment-13658026

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