You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My scraping app is working great locally, but when deploying it I consistently get this;
INFO -- : Spider: started: duvall
DEBUG -- : BrowserBuilder (selenium_firefox): created browser instance
DEBUG -- : BrowserBuilder (selenium_firefox): enabled before_request.delay
DEBUG -- : Browser: sleep 1 second before request...
DEBUG -- : BrowserBuilder (selenium_firefox): enabled custom user_agent
DEBUG -- : BrowserBuilder (selenium_firefox): enabled native headless_mode
INFO -- : Browser: started get request to: (url)
INFO -- : Browser: finished get request to: (url)
INFO -- : Info: visits: requests: 1, responses: 1
INFO -- : Browser: driver selenium_firefox has been destroyed
FATAL -- : Spider: stopped: {spider_name: "duvall", status: :failed, error: "#<Errno::ENOENT: No such file or directory - lsof>", environment: "development", start_time: 2025-01-12 00:24:48.900533401 +0000, stop_time: 2025-01-12 00:24:54.745870904 +0000, running_time: "5s", visits: {requests: 1, responses: 1}, items: {sent: 0, processed: 0}, events: {requests_errors: {}, drop_items_errors: {}, custom: {}}}
Completed 500 Internal Server Error in 5854ms (ActiveRecord: 0.0ms | Allocations: 148808)
I tried putting the app in a Docker container thinking perhaps that my app wasn't able to access the drivers on my hosting service, but am still getting the same error with it running from the Docker container as well, and this time locally. I have the same installation in my Dockerfile as listed in the installation steps with the exceptions that I was prompted to use Geckdriver 0.35.0, and Firefox installation was reporting "'firefox' has no installation candidate", so I used firefox-esr.
# Install basic tools
RUN apt install -q -y unzip wget tar openssl
# Install xvfb (for virtual_display headless mode, in additional to native)
RUN apt install -q -y xvfb
# Install chromium-browser and firefox
RUN apt install -q -y chromium firefox-esr
# Instal chromedriver (2.44 version)
# All versions are located here: https://sites.google.com/a/chromium.org/chromedriver/downloads
RUN wget https://chromedriver.storage.googleapis.com/2.44/chromedriver_linux64.zip
RUN unzip chromedriver_linux64.zip -d /usr/local/bin
RUN rm -f chromedriver_linux64.zip
# Install geckodriver (0.23.0 version)
# All versions are located here: https://github.com/mozilla/geckodriver/releases/
RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.35.0/geckodriver-v0.35.0-linux64.tar.gz
RUN tar -xvzf geckodriver-v0.35.0-linux64.tar.gz -C /usr/local/bin
RUN rm -f geckodriver-v0.35.0-linux64.tar.gz
# Install PhantomJS (2.1.1)
# All versions are located here: http://phantomjs.org/download.html
RUN apt install -q -y chrpath libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
RUN wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
RUN tar -xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2
RUN mv phantomjs-2.1.1-linux-x86_64 /usr/local/lib
RUN ln -s /usr/local/lib/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin
RUN rm -f phantomjs-2.1.1-linux-x86_64.tar.bz2
When run locally, the next log line that comes up where the deployed/Docker don't get to is;
I tried using selenium_chrome instead of selenium_firefox, that fails with the error;
#<Selenium::WebDriver::Error::WebDriverError: no sessionId in returned payload>
The text was updated successfully, but these errors were encountered:
est1213
changed the title
Errno::ENOENT (No such file or directory - lsof) on Prod Deploy or Docker Locally
Errno::ENOENT (No such file or directory - lsof) on Production Deploy or Docker Locally
Jan 12, 2025
My scraping app is working great locally, but when deploying it I consistently get this;
I tried putting the app in a Docker container thinking perhaps that my app wasn't able to access the drivers on my hosting service, but am still getting the same error with it running from the Docker container as well, and this time locally. I have the same installation in my Dockerfile as listed in the installation steps with the exceptions that I was prompted to use Geckdriver 0.35.0, and Firefox installation was reporting "'firefox' has no installation candidate", so I used firefox-esr.
When run locally, the next log line that comes up where the deployed/Docker don't get to is;
I tried using selenium_chrome instead of selenium_firefox, that fails with the error;
The text was updated successfully, but these errors were encountered: