Microsoft-Rewards-Farmer
Microsoft-Rewards-Farmer copied to clipboard
Linux issues with undetected chromedriver
Before submitting a bug report...
- [X] This bug wasn't already reported. (I have checked every bug report on GitHub)
Title
- [X] 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] [email protected]
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
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
Screenshots
Value of dashboard variable
Does deleting /Default/Preferences file in each sessions folder fix the issue ?
I'm getting this same error in Windows.
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.
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.
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