Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

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)

被選擇的解決方法

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!