Претражи подршку

Избегните преваре подршке. Никада од вас нећемо тражити да зовете или шаљете поруке на број или да делите личне податке. Пријавите сумњиве радње преко „Пријавите злоупотребу” опције.

Сазнај више

Running Firefox on read-only file system

  • 2 одговорa
  • 2 имају овај проблем
  • 1 преглед
  • Последњи одговор послао rashmi.sunshinegrl

more options

I'm trying to run Firefox on headless mode through Selenium in AWS Lambda. Since Lambda marks the root file system as read-only except /tmp/. I pointed the geckodriver to write the logs to /tmp but still Firefox is not starting up and it's failing with the following error.

Any guidance on how to get it working?

firefox_driver = webdriver.Firefox(firefox_profile=ff_profile, firefox_binary='/opt/firefox/firefox', options=firefox_options, service_log_path='/tmp/geckodriver.log')

 File "/var/lang/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 170, in __init__
   RemoteWebDriver.__init__(
 File "/var/lang/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
   self.start_session(capabilities, browser_profile)
 File "/var/lang/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
   response = self.execute(Command.NEW_SESSION, parameters)
 File "/var/lang/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
   self.error_handler.check_response(response)
 File "/var/lang/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
   raise exception_class(message, screen, stacktrace)
I'm trying to run Firefox on ''headless'' mode through Selenium in AWS Lambda. Since Lambda marks the root file system as read-only except ''/tmp/''. I pointed the geckodriver to write the logs to ''/tmp'' but still Firefox is not starting up and it's failing with the following error. Any guidance on how to get it working? firefox_driver = webdriver.Firefox(firefox_profile=ff_profile, firefox_binary='/opt/firefox/firefox', options=firefox_options, service_log_path='/tmp/geckodriver.log') File "/var/lang/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 170, in __init__ RemoteWebDriver.__init__( File "/var/lang/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__ self.start_session(capabilities, browser_profile) File "/var/lang/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/var/lang/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/var/lang/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace)

Изабрано решење

By setting HOME=/tmp I'm able to circumvent this problem.

Прочитајте овај одговор са објашњењем 👍 0

Сви одговори (2)

more options

Одабрано решење

By setting HOME=/tmp I'm able to circumvent this problem.

more options

Hi Prakash, What were the other firefox options you used? I tried setting the HOME variable and the error still reoccured!