fairgame icon indicating copy to clipboard operation
fairgame copied to clipboard

Timed out waiting for offers to render

Open infinia opened this issue 3 years ago • 43 comments

Hi, when the bot is checking stock for an item that is "available from other sellers" and attempts to open the flyout, I get this error:

2021-03-30 16:36:15|0.6.2|ERROR|Timed out waiting for offers to render. Skipping... 2021-03-30 16:36:15|0.6.2|ERROR|URL: https://www.amazon.ca/dp/B08L8LG4M3?aod=1 2021-03-30 16:36:15|0.6.2|ERROR|Message:

Traceback (most recent call last): File "C:\Users\Username\Documents\GitHub\fairgame\stores\amazon.py", line 585, in check_stock WebDriverWait(self.driver, timeout=DEFAULT_MAX_TIMEOUT).until( File "C:\Users\Username.virtualenvs\fairgame-oaMIVcmN\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message:

In the browser, I noticed that the flyout opens briefly but then disappears. If the item is in stock or is unavailable anywhere, then the bot seems to work fine.

Also, If i manually open a chrome window and goto the url of the product, the flyout works correctly.

infinia avatar Mar 30 '21 23:03 infinia

I am having the same issue on one of my computers. The flyout wont load when I'm running the bot. But works outside of it.

Edit- Uninstalling and reinstalling Chrome seems to have resolved this.

Mawnee01 avatar Mar 31 '21 01:03 Mawnee01

This was nuts. I didn't think uninstall/reinstall of Chrome would work, but it did. (Previously I tried other things, like ctrl-shift-del removing all items from all time; that didn't work)

But yeah, this fixed the popout showing for a split-second and then disappearing. Now it appears as usual. (Though, I have a feeling it'll get back to disappearing eventually. It seems to take about a day-ish)

jdhorner avatar Mar 31 '21 02:03 jdhorner

So weird. That does seem to fix the issue. I wonder what causes it.

infinia avatar Mar 31 '21 03:03 infinia

Getting this same issue while running the bot on my Raspberry Pi. Uninstalling and re-installing chromium did not help.

denysy1 avatar Mar 31 '21 07:03 denysy1

I'm getting this, too. I tried removing the chrome profile and making a new one. Additionally, I tried switching from smile to www and it made no difference.

On Wed, Mar 31, 2021 at 3:13 AM denysy1 @.***> wrote:

Getting this same issue while running the bot on my Raspberry Pi. Uninstalling and re-installing chromium did not help.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Hari-Nagarajan/fairgame/issues/627#issuecomment-810832768, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGQFORYFYY3KDM4YDBXIXLTGLDQTANCNFSM42DHKABQ .

gtrak avatar Mar 31 '21 11:03 gtrak

updated my chrome, issue resolved Version 89.0.4389.114 (Official Build) (64-bit)

airy52 avatar Mar 31 '21 13:03 airy52

Interesting, I'm on chrome Version 89.0.4389.114 (Official Build) (64-bit) as well but still have the issue.

On Wed, Mar 31, 2021 at 9:54 AM airy52 @.***> wrote:

updated my chrome, issue resolved Version 89.0.4389.114 (Official Build) (64-bit)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Hari-Nagarajan/fairgame/issues/627#issuecomment-811087169, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGQFORHDCUTHHWM5F22XT3TGMSR3ANCNFSM42DHKABQ .

gtrak avatar Mar 31 '21 14:03 gtrak

If I clear cookies, it resolves it temporarily, but that means I'm no longer logged in. Once it logs in again, it comes back.

I'm now 99% sure at this point that there is some browser fingerprinting/bot-detection going on. On a different machine on the same network with the same versions of things, chrome has the issue running without fairgame, but firefox does not.

gtrak avatar Mar 31 '21 14:03 gtrak

gtrak avatar Mar 31 '21 14:03 gtrak

I think I've tracked it down to this second request causing a 503:

image

When it's working properly it returns 200: image

Here is some returned HTML from that response:

<!--
        To discuss automated access to Amazon data please contact [email protected].
        For information about migrating to our APIs refer to our Marketplace APIs at https://developer.amazonservices.com/ref=rm_5_sv, or our Product Advertising API at https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html/ref=rm_5_ac for advertising use cases.
-->
...
<div id="g">
  <div><a href="/ref=cs_503_link"><img src="https://images-na.ssl-images-amazon.com/images/G/01/error/500_503.png"
                                        alt="Sorry! Something went wrong on our end. Please go back and try again or go to Amazon's home page."></a>
  </div>
  <a href="/dogsofamazon/ref=cs_503_d" target="_blank" rel="noopener noreferrer"><img id="d" alt="Dogs of Amazon"></a>
  <script>document.getElementById("d").src = "https://images-na.ssl-images-amazon.com/images/G/01/error/" + (Math.floor(Math.random() * 43) + 1) + "._TTD_.jpg";</script>

gtrak avatar Mar 31 '21 14:03 gtrak

After turning off fairgame for a day, I'm able to get the flyout to load properly again.

gtrak avatar Apr 01 '21 11:04 gtrak

Brand new windows 10 PC, tried removing and reinstalling chrome. No dice. I will try waiting 24 hours with pc off and try again. Is that the only other fix I can try?

Prodeje avatar Apr 03 '21 14:04 Prodeje

was working until I hit a capcha. After that I get this error no matter what I try.

lr1100 avatar Apr 03 '21 16:04 lr1100

Another idea is to clear cache, cookies , etc while it is running. I in US using smile. My old pc and bot work fine. I can browse amazon fine on the PC with the issue.

Prodeje avatar Apr 03 '21 18:04 Prodeje

Uninstalled/Reinstalled Chrome and cleared everything with no luck. I am going to wait a day and see if it clears out.

lr1100 avatar Apr 03 '21 19:04 lr1100

Uninstalled/Reinstalled Chrome and cleared everything with no luck. I am going to wait a day and see if it clears out.

Did you clear cookies while it was running?

Prodeje avatar Apr 03 '21 19:04 Prodeje

Another idea is to clear cache, cookies , etc while it is running. I in US using smile. My old pc and bot work fine. I can browse amazon fine on the PC with the issue.

This worked for me

tbonanno avatar Apr 03 '21 19:04 tbonanno

Another idea is to clear cache, cookies , etc while it is running. I in US using smile. My old pc and bot work fine. I can browse amazon fine on the PC with the issue.

This worked for me

Did you open a fresh window and cleared? Or did you not use headless and took control of bot's chrome window to clear?

Prodeje avatar Apr 03 '21 20:04 Prodeje

Another idea is to clear cache, cookies , etc while it is running. I in US using smile. My old pc and bot work fine. I can browse amazon fine on the PC with the issue.

This worked for me

What is you kill it and open it up again? Looks like this works for me, but I have to do it every time I launch fair game.

Prodeje avatar Apr 03 '21 21:04 Prodeje

This does appear to be some sort of soft ban or anti bot measure. Pretty sure.mine was caused running 0 delay. There work around is to not run headless and clear the cache cookies when the chrome window pops up. This is a pain to do each time start a bot. Can fairgame clear cache cookies when it first starts or when that exact message/error happens?

I am going to shut down a full 24 hours and see what happens. I won't be altering delay again for now.

Prodeje avatar Apr 04 '21 23:04 Prodeje

After trying a couple of peoples tactics, I finally found one that works. @Prodeje is correct, however here is a little more specifics.

After you launch (with images and a successful captcha), go to settings in the Chrome window that FairGame opened. Type "clear" and then select "Clear Browsing Data". Click the Advance tab. Select "All Time" from combo box and check all options. Click "Clear Data".

This has consistently worked for me.

lr1100 avatar Apr 05 '21 02:04 lr1100

@lr1100 Have you tried adding the --clean-profile switch?

I hope to try tomorrow.

Prodeje avatar Apr 05 '21 04:04 Prodeje

I have not. Everything is looking good so far. When I have to reload, ill give that a shot. Thanks!

lr1100 avatar Apr 05 '21 17:04 lr1100

One downfall I see is that Clearing the Browsing Data logs you out. I am assuming if there is a hit, it will log me in during the Cart Process. However, this could waste a couple of seconds and lose out on the item.

lr1100 avatar Apr 05 '21 18:04 lr1100

I've now tried the --clean-profile option, as well as using Chrome's clear browsing data option, inside the window of Chrome spawned by fairgame. Here's what I have noticed:

As soon as Chrome clears the browsing data, the ?aod flyout works again. But, of course, now it's in a window where I'm not logged in thanks to clearing all the data. So in that same still-open window, I open a new tab, navigate to Amazon and authenticate, give my 2FA token, and then it captcha's me. The instant I fill in the captcha and land on the amazon home page, the other tab that's been working and cycling between items with the successful ?aod flyout stops loading the flyout. It slides in and then instantly disappears, with this error message:

2021-04-06 09:35:24|0.6.2|ERROR|Message:
Traceback (most recent call last):
  File "C:\projects\fairgame\stores\amazon.py", line 585, in check_stock
    WebDriverWait(self.driver, timeout=DEFAULT_MAX_TIMEOUT).until(
  File "C:\Users\jdhorner\.virtualenvs\fairgame-OcHMC8QJ\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:

Then it tries the next item, and gets the same message, etc...

jdhorner avatar Apr 06 '21 13:04 jdhorner

It's bot detection that's tied to the browser, IP, account, and probably user agent string. You could try working around it, but it's better to avoid it altogether.

gtrak avatar Apr 06 '21 13:04 gtrak

After a 12 hour cool down, back to stock delay, and using 4 bots, mine are working now again. Plan to add another and see how it does.

Prodeje avatar Apr 06 '21 14:04 Prodeje

I have noticed that restarting them all from scratch seems to clear things up for a bit, but about an hour later back to the same issues.

I suggested an autoreloggin in a separate issue but was met by a really rude Maintainer and he closed the issue.

lr1100 avatar Apr 06 '21 14:04 lr1100

I don't think he was being rude. He's spammed with people asking for free work constantly. Also, I think auto-relogin won't fix it since in my testing, a clean profile and manual login didn't fix it.

On Tue, Apr 6, 2021 at 10:04 AM thingsofleon @.***> wrote:

I have noticed that restarting them all from scratch seems to clear things up for a bit, but about an hour later back to the same issues.

I suggested an autoreloggin in a separate issue but was met by a really rude Maintainer and he closed the issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Hari-Nagarajan/fairgame/issues/627#issuecomment-814147271, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGQFOUFP5ZVP5OGI2MP2VDTHMIFNANCNFSM42DHKABQ .

gtrak avatar Apr 06 '21 14:04 gtrak

When your answer is “make the change and submit a PR” with an immediate close, that’s pretty rude. anyways I am not hear to debate that. I just thought I would try things (as I have documented here), and suggest things that might make it better. usually gitlab repos are communities driven by making things better and nicely debating issues.

lr1100 avatar Apr 06 '21 14:04 lr1100