oscep opened a new issue, #34576:
URL: https://github.com/apache/superset/issues/34576

   ### Bug description
   
   There seems to be an issue with the Selenium setup. The `~/.cache` directory 
in the Docker image does not belong to the `superset` user but instead belongs 
to the `root` user. When starting trying to start a headless browser, a 
`permission denied` error seems to cause the webdriver to fail:
   
   
   ### Screenshots/recordings
   
   <img width="434" height="154" alt="Image" 
src="https://github.com/user-attachments/assets/57333720-7ff2-457b-a1d0-6bcfb6065ae5";
 />
   
   <img width="1481" height="127" alt="Image" 
src="https://github.com/user-attachments/assets/4c899d88-2af4-411d-b729-c8d75b795054";
 />
   <img width="1490" height="163" alt="Image" 
src="https://github.com/user-attachments/assets/e629ac95-e7e3-44bd-adc7-b7e194963e52";
 />
   
   ### Superset version
   
   5.0.0
   
   ### Python version
   
   3.11
   
   ### Node version
   
   I don't know
   
   ### Browser
   
   Not applicable
   
   ### Additional context
   
   ```
   [2025-08-05 13:26:00,605: WARNING/ForkPoolWorker-4] Cache folder 
(/app/superset_home/.cache/selenium) cannot be created: Permission denied (os 
error 13)
   [2025-08-05 13:26:00,606: WARNING/ForkPoolWorker-4] Cache folder 
(/app/superset_home/.cache/selenium) cannot be created: Permission denied (os 
error 13)
   [2025-08-05 13:26:00,606: WARNING/ForkPoolWorker-4] The geckodriver version 
(0.34.0) detected in PATH at /usr/bin/geckodriver might not be compatible with 
the detected firefox version (128.13.0); currently, geckodriver 0.36.0 is 
recommended for firefox 128.*, so it
   is advised to delete the driver in PATH and retry
   [2025-08-05 13:28:10,828: WARNING/ForkPoolWorker-4] 
SupersetError(message='[Errno 111] Connection refused', 
error_type=<SupersetErrorType.REPORT_NOTIFICATION_ERROR: 
'REPORT_NOTIFICATION_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra=None)
   [2025-08-05 13:28:10,835: ERROR/ForkPoolWorker-4] A downstream exception 
occurred while generating a report: fcd05b88-6472-4e9d-91ec-375af5882fdb. 
Failed taking a screenshot HTTPConnectionPool(host='localhost', port=34831): 
Read timed out. (read timeout=120)
   Traceback (most recent call last):
     File "/app/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", 
line 467, in _make_request
       six.raise_from(e, None)
     File "<string>", line 3, in raise_from
     File "/app/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", 
line 462, in _make_request
       httplib_response = conn.getresponse()
     File "/usr/local/lib/python3.10/http/client.py", line 1375, in getresponse
       response.begin()
     File "/usr/local/lib/python3.10/http/client.py", line 318, in begin
       version, status, reason = self._read_status()
     File "/usr/local/lib/python3.10/http/client.py", line 279, in _read_status
       line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
     File "/usr/local/lib/python3.10/socket.py", line 717, in readinto
       return self._sock.recv_into(b)
   TimeoutError: timed out
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "/app/superset/commands/report/execute.py", line 357, in 
_get_screenshots
       if imge := screenshot.get_screenshot(user=user):
     File "/app/superset/utils/screenshots.py", line 176, in get_screenshot
       self.screenshot = driver.get_screenshot(self.url, self.element, user)
     File "/app/superset/utils/webdriver.py", line 387, in get_screenshot
       driver = self.auth(user)
     File "/app/superset/utils/webdriver.py", line 311, in auth
       driver = self.create()
     File "/app/superset/utils/webdriver.py", line 308, in create
       return driver_class(**kwargs)
     File 
"/app/.venv/lib/python3.10/site-packages/selenium/webdriver/firefox/webdriver.py",
 line 71, in __init__
       super().__init__(command_executor=executor, options=options)
     File 
"/app/.venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py",
 line 241, in __init__
       self.start_session(capabilities)
     File 
"/app/.venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py",
 line 329, in start_session
       response = self.execute(Command.NEW_SESSION, caps)["value"]
     File 
"/app/.venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py",
 line 382, in execute
       response = self.command_executor.execute(driver_command, params)
     File 
"/app/.venv/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py",
 line 404, in execute
       return self._request(command_info[0], url, body=data)
     File 
"/app/.venv/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py",
 line 428, in _request
       response = self._conn.request(method, url, body=body, headers=headers, 
timeout=self._client_config.timeout)
     File "/app/.venv/lib/python3.10/site-packages/urllib3/request.py", line 
81, in request
       return self.request_encode_body(
     File "/app/.venv/lib/python3.10/site-packages/urllib3/request.py", line 
173, in request_encode_body
       return self.urlopen(method, url, **extra_kw)
     File "/app/.venv/lib/python3.10/site-packages/urllib3/poolmanager.py", 
line 376, in urlopen
       response = conn.urlopen(method, u.request_uri, **kw)
     File "/app/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", 
line 799, in urlopen
       retries = retries.increment(
     File "/app/.venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 
550, in increment
       raise six.reraise(type(error), error, _stacktrace)
     File "/app/.venv/lib/python3.10/site-packages/urllib3/packages/six.py", 
line 770, in reraise
       raise value
     File "/app/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", 
line 715, in urlopen
       httplib_response = self._make_request(
     File "/app/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", 
line 469, in _make_request
       self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
     File "/app/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", 
line 358, in _raise_timeout
       raise ReadTimeoutError(
   urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', 
port=34831): Read timed out. (read timeout=120)
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File "/app/superset/tasks/scheduler.py", line 99, in execute
       ).run()
     File "/app/superset/utils/decorators.py", line 266, in wrapped
       return on_error(ex)
     File "/app/superset/utils/decorators.py", line 236, in on_error
       raise ex
     File "/app/superset/utils/decorators.py", line 259, in wrapped
       result = func(*args, **kwargs)
     File "/app/superset/commands/report/execute.py", line 896, in run
       ).run()
     File "/app/superset/utils/decorators.py", line 266, in wrapped
       return on_error(ex)
     File "/app/superset/utils/decorators.py", line 236, in on_error
       raise ex
     File "/app/superset/utils/decorators.py", line 259, in wrapped
       result = func(*args, **kwargs)
     File "/app/superset/commands/report/execute.py", line 858, in run
       ).next()
     File "/app/superset/commands/report/execute.py", line 726, in next
       self.send()
     File "/app/superset/commands/report/execute.py", line 624, in send
       notification_content = self._get_notification_content()
     File "/app/superset/commands/report/execute.py", line 509, in 
_get_notification_content
       pdf_data = self._get_pdf()
     File "/app/superset/commands/report/execute.py", line 375, in _get_pdf
       screenshots = self._get_screenshots()
     File "/app/superset/commands/report/execute.py", line 363, in 
_get_screenshots
       raise ReportScheduleScreenshotFailedError(
   superset.commands.report.exceptions.ReportScheduleScreenshotFailedError: 
Failed taking a screenshot HTTPConnectionPool(host='localhost', port=34831): 
Read timed out. (read timeout=120)
   ```
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to