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

Google trends list index out of range error #163

Closed
HaveSomeRubicon opened this issue Aug 5, 2024 · 2 comments · Fixed by #164
Closed

Google trends list index out of range error #163

HaveSomeRubicon opened this issue Aug 5, 2024 · 2 comments · Fixed by #164
Assignees
Labels
bug Something isn't working

Comments

@HaveSomeRubicon
Copy link

I've run the bot on multiple devices and even my friend can confirm that this error just happens randomly. Usually the bot runs successfully but occasionally will error out. Here is the error:

2024-08-04 20:46:29,924 [INFO] [READ TO EARN] Completed the Read to Earn successfully !
2024-08-04 20:46:29,924 [DEBUG] googleTrendsShelf.__dict__ = {'dict': <dbm.dumb._Database object at 0x00000191F23D63D0>, '_protocol': 4, 'writeback': False, 'cache': {}, 'keyencoding': 'utf-8'}
2024-08-04 20:46:29,925 [DEBUG] google_trends = [('loadDate', datetime.date(2024, 8, 4))]
2024-08-04 20:46:29,925 [INFO] [BING] Starting Mobile Edge Bing searches...
2024-08-04 20:46:34,286 [INFO] [BING] 1/20
2024-08-04 20:46:34,615 [DEBUG] in __exit__ exc_type=<class 'IndexError'> exc_value=list index out of range traceback=<traceback object at 0x00000191F2848B00>
2024-08-04 20:46:34,715 [ERROR] 
Traceback (most recent call last):
  File "d:\MS-Rewards-Farmer\main.py", line 39, in main
    earned_points = executeBot(currentAccount, args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\MS-Rewards-Farmer\main.py", line 266, in executeBot
    searches.bingSearches()
  File "d:\MS-Rewards-Farmer\src\searches.py", line 136, in bingSearches
    self.bingSearch()
  File "d:\MS-Rewards-Farmer\src\searches.py", line 147, in bingSearch
    rootTerm = list(self.googleTrendsShelf.keys())[1]
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
2024-08-04 20:46:34,919 [INFO] [POINTS] Data saved for the next day.
@cal4
Copy link
Collaborator

cal4 commented Aug 5, 2024

To fix your immediate issue, delete the files starting with google_trends and rerun (there should be 3).

I think what happened is the database was created while the call to get google trends failed for some reason, leaving the database empty. Gonna work on a fix.

@cal4 cal4 self-assigned this Aug 5, 2024
@cal4 cal4 added the bug Something isn't working label Aug 5, 2024
@HaveSomeRubicon
Copy link
Author

I tried what you suggested but I ended up just switching to the hotfix branch which has been working for me so far. Thank you👍

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

Successfully merging a pull request may close this issue.

2 participants