klept0 / MS-Rewards-Farmer

A simple bot that uses Selenium to farm M$ Rewards in Python
MIT License
240 stars 50 forks source link

[BUG] Issue after Chrome update - unknown error: cannot connect to Chrome at 127.0.0.1 from chrome not reachable #51

Closed vicrg33 closed 11 months ago

vicrg33 commented 11 months ago

Bot crashes when doing the mobile search

Description

The bot crashes when starting the mobiel browser. I think it is related with Chrome updates, as it has happened me twice, both after a Chrome update. The last time I solved it by removing the sessions folders, but after doing that I have to log in again manually (I have 2FA). Thus, I'm wondering whether it is possible to solve it without removing the full sessions folder (and thus losing my login cookies)

Expected Behavior

Doing the mobile search

Actual Behavior

2023-12-12 17:12:15,359 [ERROR] WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1
from chrome not reachable
Stacktrace:
        GetHandleVerifier [0x00616E73+174291]
        (No symbol) [0x00540AC1]
        (No symbol) [0x00256E8A]
        (No symbol) [0x0024C8A3]
        (No symbol) [0x0027DE94]
        (No symbol) [0x00277B12]
        (No symbol) [0x00277927]
        (No symbol) [0x002AE259]
        (No symbol) [0x002ADBBA]
        (No symbol) [0x002A6DA6]
        (No symbol) [0x00281034]
        (No symbol) [0x00281F8D]
        GetHandleVerifier [0x006B49CC+820268]
        sqlite3_dbdata_init [0x00774EBE+652494]
        sqlite3_dbdata_init [0x007748D9+650985]
        sqlite3_dbdata_init [0x0076962C+605244]
        sqlite3_dbdata_init [0x0077586B+654971]
        (No symbol) [0x0054FEBC]
        (No symbol) [0x00548428]
        (No symbol) [0x0054854D]
        (No symbol) [0x00535858]
        BaseThreadInitThunk [0x770700F9+25]
        RtlGetAppContainerNamedObjectPath [0x772C7BBE+286]
        RtlGetAppContainerNamedObjectPath [0x772C7B8E+238]

Traceback (most recent call last):
  File "Path\Microsoft-Rewards-Farmer-master\main.py", line 24, in main
    executeBot(currentAccount, notifier, args)
  File "Path\Microsoft-Rewards-Farmer-master\main.py", line 147, in executeBot
    with Browser(
  File "Path\Microsoft-Rewards-Farmer-master\src\browser.py", line 41, in __init__
    self.webdriver = self.browserSetup()
  File "Path\Microsoft-Rewards-Farmer-master\src\browser.py", line 77, in browserSetup
    driver = webdriver.Chrome(
  File "Environments\RewardsFarmer\lib\site-packages\seleniumwire\undetected_chromedriver\webdriver.py", line 61, in __init__
    super().__init__(*args, **kwargs)
  File "Environments\RewardsFarmer\lib\site-packages\undetected_chromedriver\__init__.py", line 466, in __init__
    super(Chrome, self).__init__(
  File "Environments\RewardsFarmer\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in __init__
    super().__init__(
  File "Environments\RewardsFarmer\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 56, in __init__
    super().__init__(
  File "Environments\RewardsFarmer\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 208, in __init__
    self.start_session(capabilities)
  File "Environments\RewardsFarmer\lib\site-packages\undetected_chromedriver\__init__.py", line 724, in start_session
    super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
  File "Environments\RewardsFarmer\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 292, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "Environments\RewardsFarmer\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "Environments\RewardsFarmer\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1
from chrome not reachable
Stacktrace:
    GetHandleVerifier [0x00616E73+174291]
    (No symbol) [0x00540AC1]
    (No symbol) [0x00256E8A]
    (No symbol) [0x0024C8A3]
    (No symbol) [0x0027DE94]
    (No symbol) [0x00277B12]
    (No symbol) [0x00277927]
    (No symbol) [0x002AE259]
    (No symbol) [0x002ADBBA]
    (No symbol) [0x002A6DA6]
    (No symbol) [0x00281034]
    (No symbol) [0x00281F8D]
    GetHandleVerifier [0x006B49CC+820268]
    sqlite3_dbdata_init [0x00774EBE+652494]
    sqlite3_dbdata_init [0x007748D9+650985]
    sqlite3_dbdata_init [0x0076962C+605244]
    sqlite3_dbdata_init [0x0077586B+654971]
    (No symbol) [0x0054FEBC]
    (No symbol) [0x00548428]
    (No symbol) [0x0054854D]
    (No symbol) [0x00535858]
    BaseThreadInitThunk [0x770700F9+25]
    RtlGetAppContainerNamedObjectPath [0x772C7BBE+286]
    RtlGetAppContainerNamedObjectPath [0x772C7B8E+238]

Possible Fix

Removing the sessions folder

Steps to Reproduce

After a Chrome update

Your Environment

EDIT

Previously, it only happened with the mobile search, now it also occurs for the desktop search (it is the same error)

klept0 commented 11 months ago

Dupe of Issue #10 - working on it there