Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

Running Firefox on read-only file system

  • 2 trả lời
  • 2 gặp vấn đề này
  • 1 lượt xem
  • Trả lời mới nhất được viết bởi 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)

Giải pháp được chọn

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

Đọc câu trả lời này trong ngữ cảnh 👍 0

Tất cả các câu trả lời (2)

more options

Giải pháp được chọn

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!