Repository: charlesbel/Microsoft-Rewards-Farmer

Issue #266: [BUG]  WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1 from chrome not reachable
Created: 2023-08-13T15:16:41Z
Before submitting a bug report...

 This bug wasn't already reported.
(I have checked every bug report on GitHub)

Describe the bug
Only happens for certain accounts. The chrome window does not open and the program moves on to the next account.
Copy and paste your error

Screenshots
chrome does not open
Value of dashboard variable
chrome does not open

Duplicate issue #278: Linux issues with undetected chromedriver
Created: 2023-08-15T12:50:38Z
Before submitting a bug report...

 This bug wasn't already reported.
(I have checked every bug report on GitHub)

Title

 The title is no longer "[BUG] Title" and I edited it with the right error name.

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

Value of dashboard variable

Closing comment (2023-08-16T17:16:44Z): 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.