Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.1.0] Error: Can't get google trends; 'AssertionError' #206

Open
2 tasks done
28Black opened this issue Sep 9, 2024 · 7 comments
Open
2 tasks done

[v1.1.0] Error: Can't get google trends; 'AssertionError' #206

28Black opened this issue Sep 9, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@28Black
Copy link

28Black commented Sep 9, 2024

Before submitting a bug report...

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

  • I've cleared the sessions folder.

Branch

master

Commit

0f0052c

Describe the bug

When the script comes to the point where the searches should be done, it shows an error and force-closes.

Copy and paste your error

2024-09-09 15:11:00,419 [INFO] [BING] Remaining searches=26
2024-09-09 15:11:04,751 [DEBUG] google_trends before load = []
2024-09-09 15:11:05,001 [DEBUG] in exit exc_type=<class 'AssertionError'> exc_value= traceback=<traceback object at 0x0000026109608D80>
2024-09-09 15:11:06,472 [ERROR]
Traceback (most recent call last):
File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-1.1.0\main.py", line 40, in main
earned_points = executeBot(currentAccount, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-1.1.0\main.py", line 249, in executeBot
searches.bingSearches()
File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-1.1.0\src\searches.py", line 129, in bingSearches
trends = self.getGoogleTrends(desktopAndMobileRemaining.getTotal())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-1.1.0\src\searches.py", line 82, in getGoogleTrends
r.status_code == requests.codes.ok
AssertionError
2024-09-09 15:11:06,477 [WARNING] config-private.yaml doesn't exist
2024-09-09 15:11:06,480 [DEBUG] No urls found, not sending notification
2024-09-09 15:11:06,482 [INFO] [POINTS] Data saved for the next day.

Screenshots

none

Value of dashboard variable

none

@28Black 28Black added the bug Something isn't working label Sep 9, 2024
@cal4
Copy link
Collaborator

cal4 commented Sep 9, 2024

Adjust retry config in src.utils.Utils.makeRequestsSession

@28Black
Copy link
Author

28Black commented Sep 10, 2024

Adjust retry config in src.utils.Utils.makeRequestsSession

I played around with values of total=x, backoff_factor=y (in case that was what you mean with your comment)

No luck so far the error persists.

@cal4
Copy link
Collaborator

cal4 commented Sep 10, 2024 via email

@ShinyJustyZ
Copy link

Can confirm the error. Changing the count to 200 didn't fix it. I don't know what backoff factor does, so I kept it at 1

@cal4
Copy link
Collaborator

cal4 commented Sep 11, 2024

Works for me, I'd suggest trying the develop branch.

You can also look at the code and try getting Google trends via a browser to see if the problem's isolated.

@28Black
Copy link
Author

28Black commented Sep 11, 2024

What'd you adjust the values to?

I tried the values of the previous releases and then
total= from 1 to 50
backoff_factor= from 0.1 to 2.5

I'll try the dev branch next as you suggested.

Edit:

Dev branch doesn't work at all:

ERROR:root:
Traceback (most recent call last):
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 40, in main
    earned_points = executeBot(currentAccount, args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 242, in executeBot
    MorePromotions(desktopBrowser).completeMorePromotions()
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\src\morePromotions.py", line 101, in completeMorePromotions
    if CONFIG.get("apprise").get("notify").get("incomplete-promotions"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
ERROR:root:
Traceback (most recent call last):
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 40, in main
    earned_points = executeBot(currentAccount, args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 242, in executeBot
    MorePromotions(desktopBrowser).completeMorePromotions()
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\src\morePromotions.py", line 101, in completeMorePromotions
    if CONFIG.get("apprise").get("notify").get("incomplete-promotions"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 353, in <module>
    main()
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 43, in main
    Utils.sendNotification(f"⚠️ Error executing {currentAccount.username}, please check the log",
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\src\utils.py", line 90, in sendNotification
    if Utils.args.disable_apprise or (e and not CONFIG.get("apprise").get("notify").get("uncaught-exceptions")):
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 40, in main
    earned_points = executeBot(currentAccount, args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 242, in executeBot
    MorePromotions(desktopBrowser).completeMorePromotions()
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\src\morePromotions.py", line 101, in completeMorePromotions
    if CONFIG.get("apprise").get("notify").get("incomplete-promotions"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 353, in <module>
    main()
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 43, in main
    Utils.sendNotification(f"⚠️ Error executing {currentAccount.username}, please check the log",
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\src\utils.py", line 90, in sendNotification
    if Utils.args.disable_apprise or (e and not CONFIG.get("apprise").get("notify").get("uncaught-exceptions")):
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\main.py", line 356, in <module>
    Utils.sendNotification(
  File "C:\Users\LKA-Berlin0472\Desktop\MS-Rewards-Farmer-develop\src\utils.py", line 90, in sendNotification
    if Utils.args.disable_apprise or (e and not CONFIG.get("apprise").get("notify").get("uncaught-exceptions")):
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

@SteveTryndamere
Copy link

SteveTryndamere commented Dec 15, 2024

Works for me, I'd suggest trying the develop branch.

You can also look at the code and try getting Google trends via a browser to see if the problem's isolated.
please refer to #246
I encountered the same issue on dev. didn't work it out by tweaking retry config.
i checked the code: status_code=400, requests.codes.ok=200
"400 Bad Request: This HTTP status code indicates that the server could not understand the request due to invalid syntax. The client should not repeat the request without modifications."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants