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

[BUG] Searches 29/30 and 30/30 routinely fail, but actually work.... #172

Closed
3 tasks done
jdeath opened this issue Aug 10, 2024 · 8 comments
Closed
3 tasks done

[BUG] Searches 29/30 and 30/30 routinely fail, but actually work.... #172

jdeath opened this issue Aug 10, 2024 · 8 comments
Labels
bug Something isn't working stale

Comments

@jdeath
Copy link

jdeath commented Aug 10, 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.

Title

  • The title is no longer "[BUG] Title" and I edited it with the right error name.

Branch

master

Commit

0.1.0

Describe the bug

Just about every run for me, desktop searches 29/30 and 30/30 fail and it does the full set of retries. The system already counted the points, causing the failures. Could a few people check their logs for past few days to see if just me? Not a major issue, just adds 30 minutes of run time.

Copy and paste your error

2024-08-09 04:36:08,897 [DEBUG] rootTerm=nikki hiltz
2024-08-09 04:36:09,017 [DEBUG] term=nikki hiltz
2024-08-09 04:36:10,367 [DEBUG] [BING] Search attempt failed 1/7, sleeping 14 seconds...
2024-08-09 04:36:24,495 [DEBUG] term=nikki hiltz born girl or boy
2024-08-09 04:36:25,817 [DEBUG] [BING] Search attempt failed 2/7, sleeping 28 seconds...
2024-08-09 04:36:53,990 [DEBUG] term=nikki hiltz runner
2024-08-09 04:36:55,386 [DEBUG] [BING] Search attempt failed 3/7, sleeping 56 seconds...
2024-08-09 04:37:51,524 [DEBUG] term=nikki hiltz gender
2024-08-09 04:37:53,058 [DEBUG] [BING] Search attempt failed 4/7, sleeping 112 seconds...
2024-08-09 04:39:45,363 [DEBUG] term=nikki hiltz born male
2024-08-09 04:39:46,718 [DEBUG] [BING] Search attempt failed 5/7, sleeping 224 seconds...
2024-08-09 04:43:30,867 [DEBUG] term=nikki hiltz wikipedia
2024-08-09 04:43:32,134 [DEBUG] [BING] Search attempt failed 6/7, sleeping 448 seconds...
2024-08-09 04:51:00,321 [DEBUG] term=nikki hiltz olympics
2024-08-09 04:51:01,757 [DEBUG] [BING] Search attempt failed 7/7, sleeping 896 seconds...
2024-08-09 05:05:57,908 [DEBUG] term=nikki hiltz gender at birth
2024-08-09 05:05:59,290 [ERROR] [BING] Reached max search attempt retries
2024-08-09 05:05:59,294 [DEBUG] Moving passedInTerm to end of list
2024-08-09 05:06:09,297 [INFO] [BING] 30/30
2024-08-09 05:06:10,036 [DEBUG] terms=['usa vs serbia basketball score', 'usa vs serbia basketball', 'usa vs serbia basketball 2024', 'usa vs serbia basketball box score', 'usa vs serbia basketball 2014', 'usa vs serbia basketball olympics 2024', 'usa vs serbia basketball live', 'usa vs serbia basketball abu dhabi', 'usa vs serbia basketball stats', 'usa vs serbia basketball online', 'usa vs serbia basketball highlights', 'usa vs serbia basketball abu dhabi tickets', 'usa vs serbia basketball live score', 'usa vs serbia basketball 2024 score', 'usa vs serbia basketball 2024 box score', 'serbia vs usa basketball final score', 'team usa basketball vs serbia', 'women basketball usa vs serbia', "usa men's basketball vs serbia"]
2024-08-09 05:06:10,036 [DEBUG] rootTerm=usa vs serbia basketball
2024-08-09 05:06:10,343 [DEBUG] term=usa vs serbia basketball score
2024-08-09 05:06:11,841 [DEBUG] [BING] Search attempt failed 1/7, sleeping 14 seconds...
2024-08-09 05:06:25,980 [DEBUG] term=usa vs serbia basketball
2024-08-09 05:06:27,338 [DEBUG] [BING] Search attempt failed 2/7, sleeping 28 seconds...
2024-08-09 05:06:55,557 [DEBUG] term=usa vs serbia basketball 2024
2024-08-09 05:06:56,939 [DEBUG] [BING] Search attempt failed 3/7, sleeping 56 seconds...
2024-08-09 05:07:53,164 [DEBUG] term=usa vs serbia basketball box score
2024-08-09 05:07:54,590 [DEBUG] [BING] Search attempt failed 4/7, sleeping 112 seconds...
2024-08-09 05:09:46,721 [DEBUG] term=usa vs serbia basketball 2014
2024-08-09 05:09:48,264 [DEBUG] [BING] Search attempt failed 5/7, sleeping 224 seconds...
2024-08-09 05:13:32,440 [DEBUG] term=usa vs serbia basketball olympics 2024
2024-08-09 05:13:33,768 [DEBUG] [BING] Search attempt failed 6/7, sleeping 448 seconds...
2024-08-09 05:21:01,947 [DEBUG] term=usa vs serbia basketball live
2024-08-09 05:21:03,321 [DEBUG] [BING] Search attempt failed 7/7, sleeping 896 seconds...
2024-08-09 05:35:59,667 [DEBUG] term=usa vs serbia basketball abu dhabi
2024-08-09 05:36:01,111 [ERROR] [BING] Reached max search attempt retries
2024-08-09 05:36:01,111 [DEBUG] Moving passedInTerm to end of list
2024-08-09 05:36:16,116 [INFO] [BING] Finished Desktop Edge Bing searches !

Screenshots

Can't do, as in docker

Value of dashboard variable

having trouble withthis

@jdeath jdeath added the bug Something isn't working label Aug 10, 2024
@cal4
Copy link
Collaborator

cal4 commented Aug 11, 2024

Yeah this has consistently happened/been exposed with the refactor in #137. The underlying cause appears to be a lag between the searches being done on the bot end, and the searches counting on the Microsoft server-side.

My initial thought was it had something to do with the way we get the current account points, but when I tried an alternate way it was the same result which makes me think it's server-side and out of our control.

Since the searches generally complete for me (even if logging indicates otherwise), and apprise.summary=ON_ERROR notifies me via email if not all are done, I haven't really bothered to dig into it further.

@Ices-Eyes
Copy link

Ices-Eyes commented Aug 12, 2024

Actually I'm facing a similar issue, but not just on searches 29 and 30,also on middle ones, and many time I'm seeing the bot is still waiting maybe for search 25 while looking to the ms page it already have finished all the searches. Actually I'm trying this code, do you see any possible problem with it? It seems to work....

remainingSearches = self.browser.getRemainingSearches()
searchCount = 1
while searchCount < remainingSearches:
#for searchCount in range(1, remainingSearches + 1):
	# todo Disable cooldown for first 3 searches (Earning starts with your third search)
	logging.info(f"[BING] {searchCount}/{remainingSearches}")
	self.bingSearch()
	time.sleep(random.randint(10, 15))
	if searchCount % 3:
		searchCount = remaining Searches - self.browser.getRemainingSearches() - 1
	searchCount += 1

@jdeath
Copy link
Author

jdeath commented Aug 12, 2024

I suggested something like that a while back, but it was rejected due to possibly going for ever if getRemainingSearches() did not update . Perhaps if add
while searchCount < remainingSearches and searchCount < 30 : to ensure it will never go on forever

@cal4
Copy link
Collaborator

cal4 commented Aug 12, 2024

Good suggestions, but getRemainingSearches relies on src.utils.Utils.getDashboardData which for me had the same disconnect that src.utils.Utils.getAccountPoints had.

That being said, I could be conflating what I saw earlier when I tried using dashboard data versus bing info for figuring how many remaining points.

I'll give it a try at some point to see if it's more reliable.

@Rippenkneifer
Copy link

Hey, i have encountered the same problem, how ever i smoked a good joint, and found a simple solution.. for myself atleast, maybe it can help someone out there too..

searches.py ; at Line: 135 , I have added some sneaky time.sleep(3) and maybe some more too randomly in the code... right after searchbar.click and searchbar.send keys are some time.sleep(random.randint(3, 7)) now... near Line 174 or so.

Now i dont have any problem with the bing searches anymore, iam happy now.
maybe someone out there is helped with this.

Good luck

@cal4
Copy link
Collaborator

cal4 commented Aug 17, 2024

As a follow up to #172 (comment), what I think's happening is that the re-attempts during the disconnected phase register as further searches, which then leads to the 1 search per call to bingSearch not holding true. So by the time the last search comes, we've already done all of them and it delays because account points will never increment.

Gonna give some thought to a workaround.

@cal4
Copy link
Collaborator

cal4 commented Aug 18, 2024

Should be fixed in #184

Copy link

github-actions bot commented Sep 2, 2024

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Sep 2, 2024
@jdeath jdeath closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

4 participants