charlesbel / Microsoft-Rewards-Farmer

A simple bot that uses selenium to farm Microsoft Rewards written in Python
MIT License
1.01k stars 266 forks source link

Linux issues with undetected chromedriver #278

Open J0hnnyRisk opened 1 year ago

J0hnnyRisk commented 1 year ago

Before submitting a bug report...

Title

Describe the bug

All of a sudden it won't start due to some unknown error when it tries to update undetected chromedriver. Chrome does not have any issues what so ever. I tried the no sandbox option as well. Headless works for some reason.

Copy and paste your error

johnny@johnny-VirtualBox:~/Schreibtisch/Microsoft-Rewards-Farmer-master$ python3 main.py 2023-08-15 14:40:14,313 [INFO] ****Diptrip@outlook.de**** 2023-08-15 14:40:14,959 [INFO] Using default request storage 2023-08-15 14:40:14,964 [INFO] Created proxy listening on 127.0.0.1:46521 2023-08-15 14:40:14,964 [INFO] Using undetected_chromedriver 2023-08-15 14:40:15,834 [INFO] patching driver executable /home/johnny/.local/share/undetected_chromedriver/undetected_chromedriver 2023-08-15 14:41:16,396 [ERROR] WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:41575 from chrome not reachable Stacktrace:

0 0x555c5ca2f4e3

1 0x555c5c75eb00

2 0x555c5c74c436

3 0x555c5c78b9be

4 0x555c5c783884

5 0x555c5c7c2ccc

6 0x555c5c7c247f

7 0x555c5c7b9de3

8 0x555c5c78f2dd

9 0x555c5c79034e

10 0x555c5c9ef3e4

11 0x555c5c9f33d7

12 0x555c5c9fdb20

13 0x555c5c9f4023

14 0x555c5c9c21aa

15 0x555c5ca186b8

16 0x555c5ca18847

17 0x555c5ca28243

18 0x7f210a894b43

Traceback (most recent call last): File "/home/johnny/Schreibtisch/Microsoft-Rewards-Farmer-master/main.py", line 24, in main executeBot(currentAccount, notifier, args) File "/home/johnny/Schreibtisch/Microsoft-Rewards-Farmer-master/main.py", line 127, in executeBot with Browser(mobile=False, account=currentAccount, args=args) as desktopBrowser: File "/home/johnny/Schreibtisch/Microsoft-Rewards-Farmer-master/src/browser.py", line 41, in init self.webdriver = self.browserSetup() File "/home/johnny/Schreibtisch/Microsoft-Rewards-Farmer-master/src/browser.py", line 78, in browserSetup driver = webdriver.Chrome( File "/home/johnny/.local/lib/python3.10/site-packages/seleniumwire/undetected_chromedriver/webdriver.py", line 61, in init super().init(*args, **kwargs) File "/home/johnny/.local/lib/python3.10/site-packages/undetected_chromedriver/init.py", line 466, in init super(Chrome, self).init( File "/home/johnny/.local/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in init super().init( File "/home/johnny/.local/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 56, in init super().init( File "/home/johnny/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 206, in init self.start_session(capabilities) File "/home/johnny/.local/lib/python3.10/site-packages/undetected_chromedriver/init.py", line 724, in start_session super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session( File "/home/johnny/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 290, in start_session response = self.execute(Command.NEW_SESSION, caps)["value"] File "/home/johnny/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 345, in execute self.error_handler.check_response(response) File "/home/johnny/.local/lib/python3.10/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:41575 from chrome not reachable Stacktrace:

0 0x555c5ca2f4e3

1 0x555c5c75eb00

2 0x555c5c74c436

3 0x555c5c78b9be

4 0x555c5c783884

5 0x555c5c7c2ccc

6 0x555c5c7c247f

7 0x555c5c7b9de3

8 0x555c5c78f2dd

9 0x555c5c79034e

10 0x555c5c9ef3e4

11 0x555c5c9f33d7

12 0x555c5c9fdb20

13 0x555c5c9f4023

14 0x555c5c9c21aa

15 0x555c5ca186b8

16 0x555c5ca18847

17 0x555c5ca28243

18 0x7f210a894b43

Screenshots

Screenshot 2023-08-15 144800

Value of dashboard variable

Screenshot 2023-08-15 145019

charlesbel commented 1 year ago

Does deleting /Default/Preferences file in each sessions folder fix the issue ?

Lectoid commented 1 year ago

I'm getting this same error in Windows.

SvenQ32 commented 1 year ago

I'm also getting the error on ubuntu but i tried deleting /Default/Preferences file in each sessions folder and it didn't work either.

xBounceIT commented 1 year ago

This is related to #266 and #269

deleting every file and folder into sessions/ should solve the issue:

rm -rf sessions/*

If on Linux and using crontab, i recommend doing something like this:

0 8 * * * cd /path/to/Microsoft-Rewards-Farmer-master && rm -rf sessions/* && python3 autoupdate_main.py
0 14 * * * cd /path/to/Microsoft-Rewards-Farmer-master && rm -rf sessions/* && python3 autoupdate_main.py
0 19 * * * cd /path/to/Microsoft-Rewards-Farmer-master && rm -rf sessions/* && python3 autoupdate_main.py

NOTE: check path to the farmer.

This configuration ensures that on each execution the sessions folder is cleared and the script is always upgraded to the latest version.

As a sidenote, i have set multiple execution attempts to make sure every point available gets earned.

EastArctica commented 1 year ago

This will be fixed with undetected-chromedriver#1505. Better workaround than deleting the entire sessions folder is to delete sessions/*/desktop/SingletonLock

Edit: Actually use sessions/*/*/SingletonLock to delete both the desktop and mobile locks