klept0/MS-Rewards-Farmer

[BUG] Error out during Punch Cards

suihuamo opened this issue · 0 comments

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

using the most current git files, and it errors out while doing Punch Cards.

Copy and paste your error

2024-05-22 16:57:07,043 [INFO] [DAILY SET] Trying to complete the Daily Set...
2024-05-22 16:57:20,225 [INFO] [DAILY SET] Completing search of card 1
2024-05-22 16:58:15,711 [INFO] [DAILY SET] Completed the Daily Set successfully !
2024-05-22 16:58:15,711 [INFO] [PUNCH CARDS] Trying to complete the Punch Cards...
Traceback (most recent call last):
File "/home/temp/Downloads/MS-Rewards-Farmer/src/punchCards.py", line 71, in completePunchCards
self.completePunchCard(
File "/home/temp/Downloads/MS-Rewards-Farmer/src/punchCards.py", line 28, in completePunchCard
self.browser.utils.visitNewTab(random.randint(13, 17))
File "/home/temp/Downloads/MS-Rewards-Farmer/src/utils.py", line 246, in visitNewTab
self.closeCurrentTab()
File "/home/temp/Downloads/MS-Rewards-Farmer/src/utils.py", line 239, in closeCurrentTab
self.webdriver.close()
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 458, in close
self.execute(Command.CLOSE)
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: failed to close window in 20 seconds
(Session info: chrome=125.0.6422.60)
Stacktrace:
#0 0x5ff45a502e9a
#1 0x5ff45a1ec45c
#2 0x5ff45a1c5a89
#3 0x5ff45a1c5b9b
#4 0x5ff45a26ae5d
#5 0x5ff45a25b478
#6 0x5ff45a22b1c7
#7 0x5ff45a22bb3e
#8 0x5ff45a4c92db
#9 0x5ff45a4cd387
#10 0x5ff45a4b5e0e
#11 0x5ff45a4cde52
#12 0x5ff45a49a7af
#13 0x5ff45a4f2188
#14 0x5ff45a4f235b
#15 0x5ff45a501fcc
#16 0x7e0405694ac3

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/switch_to.py", line 141, in _w3c_window
send_handle(window_name)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/switch_to.py", line 137, in send_handle
self._driver.execute(Command.SWITCH_TO_WINDOW, {"handle": h})
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.NoSuchWindowException: Message: no such window
(Session info: chrome=125.0.6422.60)
Stacktrace:
#0 0x5ff45a502e9a
#1 0x5ff45a1ec2a1
#2 0x5ff45a26bd6e
#3 0x5ff45a25b478
#4 0x5ff45a22b1c7
#5 0x5ff45a22bb3e
#6 0x5ff45a4c92db
#7 0x5ff45a4cd387
#8 0x5ff45a4b5e0e
#9 0x5ff45a4cde52
#10 0x5ff45a49a7af
#11 0x5ff45a4f2188
#12 0x5ff45a4f235b
#13 0x5ff45a501fcc
#14 0x7e0405694ac3

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/temp/Downloads/MS-Rewards-Farmer/src/utils.py", line 118, in resetTabs
self.webdriver.switch_to.window(curr)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/switch_to.py", line 133, in window
self._w3c_window(window_name)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/switch_to.py", line 144, in _w3c_window
original_handle = self._driver.current_window_handle
File "/usr/local/lib/python3.10/dist-packages/undetected_chromedriver/init.py", line 806, in getattribute
return super().getattribute(item)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 483, in current_window_handle
return self.execute(Command.W3C_GET_CURRENT_WINDOW_HANDLE)["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.NoSuchWindowException: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: chrome=125.0.6422.60)
Stacktrace:
#0 0x5ff45a502e9a
#1 0x5ff45a1ec45c
#2 0x5ff45a1c1a84
#3 0x5ff45a26395d
#4 0x5ff45a26a428
#5 0x5ff45a25b478
#6 0x5ff45a22b1c7
#7 0x5ff45a22bb3e
#8 0x5ff45a4c92db
#9 0x5ff45a4cd387
#10 0x5ff45a4b5e0e
#11 0x5ff45a4cde52
#12 0x5ff45a49a7af
#13 0x5ff45a4f2188
#14 0x5ff45a4f235b
#15 0x5ff45a501fcc
#16 0x7e0405694ac3

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/temp/Downloads/MS-Rewards-Farmer/main.py", line 43, in main
earned_points = executeBot(currentAccount, args)
File "/home/temp/Downloads/MS-Rewards-Farmer/main.py", line 212, in executeBot
PunchCards(desktopBrowser).completePunchCards()
File "/home/temp/Downloads/MS-Rewards-Farmer/src/punchCards.py", line 76, in completePunchCards
self.browser.utils.resetTabs()
File "/home/temp/Downloads/MS-Rewards-Farmer/src/utils.py", line 122, in resetTabs
self.goHome()
File "/home/temp/Downloads/MS-Rewards-Farmer/src/utils.py", line 128, in goHome
self.webdriver.get(BASE_URL)
File "/usr/local/lib/python3.10/dist-packages/undetected_chromedriver/init.py", line 496, in get_wrapped
if self.execute_script("return navigator.webdriver"):
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 407, in execute_script
return self.execute(command, {"script": script, "args": converted_args})["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.NoSuchWindowException: Message: no such window: target window already closed
from unknown error: web view not found
(Session info: chrome=125.0.6422.60)
Stacktrace:
#0 0x5ff45a502e9a
#1 0x5ff45a1ec45c
#2 0x5ff45a1c1a84
#3 0x5ff45a26395d
#4 0x5ff45a279c76
#5 0x5ff45a25b253
#6 0x5ff45a22b1c7
#7 0x5ff45a22bb3e
#8 0x5ff45a4c92db
#9 0x5ff45a4cd387
#10 0x5ff45a4b5e0e
#11 0x5ff45a4cde52
#12 0x5ff45a49a7af
#13 0x5ff45a4f2188
#14 0x5ff45a4f235b
#15 0x5ff45a501fcc
#16 0x7e0405694ac3

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/temp/Downloads/MS-Rewards-Farmer/main.py", line 314, in
main()
File "/home/temp/Downloads/MS-Rewards-Farmer/main.py", line 58, in main
Utils.send_notification("⚠️ Error occurred, please check the log", str(e))
TypeError: Utils.send_notification() missing 1 required positional argument: 'body'

Screenshots

N/A

Value of dashboard variable

N/A