charlesbel / Microsoft-Rewards-Farmer

A simple bot that uses selenium to farm Microsoft Rewards written in Python
MIT License
975 stars 261 forks source link

[BUG] error with 2FA and -v option #434

Open GaetanPTX opened 7 months ago

GaetanPTX commented 7 months ago

Before submitting a bug report...

Title

Describe the bug

When I validate the 2FA number on the application and press enter then it does not continue.

So I looked to see if there had already been this problem and I saw that adding the -v in the command could help, except that it doesn't work for me

Copy and paste your error

Error for -v command:

root@vmi1556726:~/Microsoft-Rewards-Farmer# python3 main.py -v
2024-02-02 22:22:39,739 [INFO] ********************MY@EMAIL********************
2024-02-02 22:22:40,877 [INFO] Using default request storage
2024-02-02 22:22:40,885 [INFO] Created proxy listening on 127.0.0.1:38891
2024-02-02 22:22:40,885 [INFO] Using undetected_chromedriver
2024-02-02 22:22:41,481 [INFO] patching driver executable /root/.local/share/undetected_chromedriver/undetected_chromedriver
2024-02-02 22:23:41,570 [ERROR] WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:37241
from chrome not reachable
Stacktrace:
#0 0x55de31732d93 <unknown>
#1 0x55de31416177 <unknown>
#2 0x55de3140102a <unknown>
#3 0x55de3144fcf8 <unknown>
#4 0x55de314461cb <unknown>
#5 0x55de31490b7c <unknown>
#6 0x55de314841e3 <unknown>
#7 0x55de31454135 <unknown>
#8 0x55de3145513e <unknown>
#9 0x55de316f6e4b <unknown>
#10 0x55de316fadfa <unknown>
#11 0x55de316e36d5 <unknown>
#12 0x55de316fba6f <unknown>
#13 0x55de316c769f <unknown>
#14 0x55de31720098 <unknown>
#15 0x55de31720262 <unknown>
#16 0x55de31731f34 <unknown>
#17 0x7fed0dc50ac3 <unknown>

Traceback (most recent call last):
  File "/root/Microsoft-Rewards-Farmer/main.py", line 24, in main
    executeBot(currentAccount, notifier, args)
  File "/root/Microsoft-Rewards-Farmer/main.py", line 127, in executeBot
    with Browser(mobile=False, account=currentAccount, args=args) as desktopBrowser:
  File "/root/Microsoft-Rewards-Farmer/src/browser.py", line 41, in __init__
    self.webdriver = self.browserSetup()
  File "/root/Microsoft-Rewards-Farmer/src/browser.py", line 77, in browserSetup
    driver = webdriver.Chrome(
  File "/usr/local/lib/python3.10/dist-packages/seleniumwire/undetected_chromedriver/webdriver.py", line 61, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/undetected_chromedriver/__init__.py", line 466, in __init__
    super(Chrome, self).__init__(
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/webdriver.py", line 61, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 208, in __init__
    self.start_session(capabilities)
  File "/usr/local/lib/python3.10/dist-packages/undetected_chromedriver/__init__.py", line 724, in start_session
    super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 292, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.10/dist-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:37241
from chrome not reachable
Stacktrace:
#0 0x55de31732d93 <unknown>
#1 0x55de31416177 <unknown>
#2 0x55de3140102a <unknown>
#3 0x55de3144fcf8 <unknown>
#4 0x55de314461cb <unknown>
#5 0x55de31490b7c <unknown>
#6 0x55de314841e3 <unknown>
#7 0x55de31454135 <unknown>
#8 0x55de3145513e <unknown>
#9 0x55de316f6e4b <unknown>
#10 0x55de316fadfa <unknown>
#11 0x55de316e36d5 <unknown>
#12 0x55de316fba6f <unknown>
#13 0x55de316c769f <unknown>
#14 0x55de31720098 <unknown>
#15 0x55de31720262 <unknown>
#16 0x55de31731f34 <unknown>
#17 0x7fed0dc50ac3 <unknown>

Error for normal command:

root@vmi1556726:~/Microsoft-Rewards-Farmer# sudo python3 main.py --geo FR
2024-02-02 22:28:36,610 [INFO] ********************MY@EMAIL********************
2024-02-02 22:28:37,069 [INFO] Using default request storage
2024-02-02 22:28:37,075 [INFO] Created proxy listening on 127.0.0.1:40843
2024-02-02 22:28:37,076 [INFO] Using undetected_chromedriver
2024-02-02 22:28:37,723 [INFO] patching driver executable /root/.local/share/undetected_chromedriver/undetected_chromedriver
2024-02-02 22:28:38,279 [INFO] Screen size: 2382x1238
2024-02-02 22:28:38,281 [INFO] Device size: 2327x1087
2024-02-02 22:28:38,505 [INFO] [LOGIN] Logging-in...
2024-02-02 22:28:40,620 [INFO] [LOGIN] Writing email...
2024-02-02 22:28:51,223 [ERROR] [LOGIN] 2FA required !
2024-02-02 22:28:51,253 [ERROR] [LOGIN] 2FA code: 32
2024-02-02 22:28:51,254 [INFO] [LOGIN] Press enter when confirmed...

Screenshots

image image

Value of dashboard variable

https://gist.github.com/GaetanPTX/930422c8ca74327a6a0fdfe7956b48cf

deswong commented 7 months ago

Is this because of it reaching a screen asking if you want to reduce the number of sign ins?