SergeyPirogov / webdriver_manager

Apache License 2.0
2.07k stars 461 forks source link

AWS Lambda "[Errno 30] Read-only file system: '/var/task/.wdm'", #651

Open DEENUU1 opened 11 months ago

DEENUU1 commented 11 months ago

Is there a way to change installation path because i got this error on AWS Lambda (also without using os.environ['WDM_LOCAL'] = '1')

from abc import abstractmethod, ABC
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options
import os

os.environ['WDM_LOCAL'] = '1'
SERVICE = ChromeService(ChromeDriverManager(driver_version="2.26").install())
{
  "errorMessage": "[Errno 30] Read-only file system: '/var/task/.wdm'",
  "errorType": "OSError",
  "requestId": "",
  "stackTrace": [
    "  File \"/var/lang/lib/python3.12/importlib/__init__.py\", line 90, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n",
    "  File \"<frozen importlib._bootstrap>\", line 1381, in _gcd_import\n",
    "  File \"<frozen importlib._bootstrap>\", line 1354, in _find_and_load\n",
    "  File \"<frozen importlib._bootstrap>\", line 1325, in _find_and_load_unlocked\n",
    "  File \"<frozen importlib._bootstrap>\", line 929, in _load_unlocked\n",
    "  File \"<frozen importlib._bootstrap_external>\", line 994, in exec_module\n",
    "  File \"<frozen importlib._bootstrap>\", line 488, in _call_with_frames_removed\n",
    "  File \"/var/task/main.py\", line 1, in <module>\n    from tasks import run_jjit\n",
    "  File \"/var/task/tasks.py\", line 5, in <module>\n    from scrapers.justjoinit.get_content import CATEGORIES\n",
    "  File \"/var/task/scrapers/justjoinit/get_content.py\", line 1, in <module>\n    from ..strategy_abstract.get_content import GetContentStrategy\n",
    "  File \"/var/task/scrapers/strategy_abstract/get_content.py\", line 8, in <module>\n    SERVICE = ChromeService(ChromeDriverManager(driver_version=\"2.26\").install())\n",
    "  File \"/var/task/webdriver_manager/chrome.py\", line 40, in install\n    driver_path = self._get_driver_binary_path(self.driver)\n",
    "  File \"/var/task/webdriver_manager/core/manager.py\", line 41, in _get_driver_binary_path\n    binary_path = self._cache_manager.save_file_to_cache(driver, file)\n",
    "  File \"/var/task/webdriver_manager/core/driver_cache.py\", line 53, in save_file_to_cache\n    archive = self.save_archive_file(file, path)\n",
    "  File \"/var/task/webdriver_manager/core/driver_cache.py\", line 46, in save_archive_file\n    return self._file_manager.save_archive_file(file, path)\n",
    "  File \"/var/task/webdriver_manager/core/file_manager.py\", line 45, in save_archive_file\n    os.makedirs(directory, exist_ok=True)\n",
    "  File \"<frozen os>\", line 215, in makedirs\n",
    "  File \"<frozen os>\", line 215, in makedirs\n",
    "  File \"<frozen os>\", line 215, in makedirs\n",
    "  [Previous line repeated 1 more time]\n",
    "  File \"<frozen os>\", line 225, in makedirs\n"
  ]
}
NikhilTank35 commented 3 months ago

I am also getting same error