tldev-de / immopushr

Telegram Bot that finds offers on immobilienscout24.de, immowelt.de and ebay-kleinanzeigen.de.
GNU General Public License v3.0
30 stars 1 forks source link

Fatal error: Uncaught Facebook\WebDriver\Exception\WebDriverCurlException #12

Open liebecode opened 1 year ago

liebecode commented 1 year ago

I noticed a similar issue, but it is closed so I am reporting what I am experiencing. I'm running the bot as it exists in the repo, I have not modified it whatsoever, I have simply added my configuration in the docker-compose.yml.

Two things I noticed happening: 1.) The bot is actually never using the 2Captcha account, and fails to solve captchas, even though I have included it in the compose file. 2.) The bot runs successfully once, but then throws this error every attempt thereafter:

immopushr-selenium-1   | 20:06:05.370 INFO [LocalDistributor.newSession] - Session created by the Distributor. Id: 896bfab34b36e90a5a5fdcff34e0b107 
immopushr-selenium-1   |  Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 111.0.5563.110, chrome: {chromedriverVersion: 111.0.5563.64 (c710e93d5b63..., userDataDir: /tmp/.com.google.Chrome.cddD4S}, goog:chromeOptions: {debuggerAddress: localhost:39689}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: LINUX, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://172.18.0.2:4444/sessio..., se:cdpVersion: 111.0.5563.110, se:vnc: ws://172.18.0.2:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.18.0.2:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
immopushr-immopushr-1  | 
immopushr-immopushr-1  | Fatal error: Uncaught Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"capabilities":{"firstMatch":[{"browserName":"chrome","goog:chromeOptions":{"args":["--window-size=1920,1080","--lang=de-DE","--no-sandbox","--start-maximized","--disable-infobars","--disable-gpu","--disable-blink-features=AutomationControlled","--user-agent=Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/88.0.4324.150 Safari\/537.36"]}}]},"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"args":["--window-size=1920,1080","--lang=de-DE","--no-sandbox","--start-maximized","--disable-infobars","--disable-gpu","--disable-blink-features=AutomationControlled","--user-agent=Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/88.0.4324.150 Safari\/537.36"]}}}
immopushr-immopushr-1  | 
immopushr-immopushr-1  | Operation timed out after 30001 milliseconds with 0 bytes received in /app/vendor/php-webdriver/webdriver/lib/Remote/HttpCommandExecutor.php:332
immopushr-immopushr-1  | Stack trace:
immopushr-immopushr-1  | #0 /app/vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php(136): Facebook\WebDriver\Remote\HttpCommandExecutor->execute(Object(Facebook\WebDriver\Remote\WebDriverCommand))
immopushr-immopushr-1  | #1 /app/utils/BrowserFactory.php(30): Facebook\WebDriver\Remote\RemoteWebDriver::create('http://selenium...', Object(Facebook\WebDriver\Remote\DesiredCapabilities))
immopushr-immopushr-1  | #2 /app/cron.php(26): Utils\BrowserFactory::getBrowser()
immopushr-immopushr-1  | #3 {main}
immopushr-immopushr-1  |   thrown in /app/vendor/php-webdriver/webdriver/lib/Remote/HttpCommandExecutor.php on line 332

Here is my docker-compose.yml

version: '2'

services:
  selenium:
    image: selenium/standalone-chrome:4
    restart: unless-stopped
    mem_limit: 2g
    logging:
      driver: "json-file"
      options:
        max-size: "5m"
    volumes:
      - /dev/shm:/dev/shm
    environment:
      - SCREEN_WIDTH=1920
      - SCREEN_HEIGHT=1080
  immopushr:
    image: tldevde/immopushr
    restart: unless-stopped
    volumes:
      - immopushr_db:/app/db
      - immopushr_logs:/app/logs
    environment:
      - CAPTCHA_TOKEN=(redacted)
      - TELEGRAM_BOT_TOKEN=(redacted)
      - TELEGRAM_CHATS=(redacted)
      - CRON_PATTERN=*/5 0,6-23 * * *
      - SELENIUM_URL=http://selenium:4444
      - URLS=(redacted)
volumes:
  immopushr_db:
  immopushr_logs:

Any help would be appreciated!

JorgeOrozcoP commented 1 year ago

I had a somewhat different behavior because I got the same error but on the first run. I'm still doing tests, but I'm starting to see progress when I change the selenium image to latest. That is, modify line 5 to:

image: selenium/standalone-chrome:latest.

Let me know how this goes, I'm also trying to make this run.