Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Running Firefox on read-only file system

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)

Chosen solution

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

Read this answer in context 👍 0

All Replies (2)

more options

Chosen Solution

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!