delivery-slot-bot icon indicating copy to clipboard operation
delivery-slot-bot copied to clipboard

yarn start worked first time for Tesco , but fails with " error: Auth failed." on subsequent tries

Open IanB999 opened this issue 4 years ago • 29 comments

Continues to work for asda. Please kindly confirm this still works for Tesco

IanB999 avatar Apr 22 '20 15:04 IanB999

Another user has reported seeing same issue

IanB999 avatar Apr 22 '20 15:04 IanB999

Tesco worked for me at 1:30 this morning :O)

CharlesButcher avatar Apr 22 '20 15:04 CharlesButcher

It worked for me midday and then stopped. What happens if you run

node delivery-slots.js now?

IanB999 avatar Apr 22 '20 15:04 IanB999

It was broken for me briefly yesterday on one device, but not another. It's currently working:

Screenshot 2020-04-22 at 16 43 14

I'm not sure why we are seeing these intermittent errors...

paulmaunders avatar Apr 22 '20 15:04 paulmaunders

[ delivery-slot-bot]$ node delivery-slots.js 1587570271262 Wed, 22 Apr 2020 15:44:31 GMT Logging in with new user session error: Auth failed. Please check details are correct in config.ini 1587570273341 Wed, 22 Apr 2020 15:44:33 GMT Logging in with new user session Opening https://groceries.asda.com/checkout/book-slot?tab=deliver No slots

This is a redhat box

IanB999 avatar Apr 22 '20 15:04 IanB999

OK, Tesco auth is now failing for me too.

CharlesButcher avatar Apr 22 '20 15:04 CharlesButcher

I am getting this error too. Leaving it for 1 hour 9 mins, and running it again, worked. Subsequent runs fail auth again as above. It would seem that Tesco are detecting the logins and rate-limiting them (perhaps 1 an hour if my case is anything to go by?), whereas normal browser logins work OK anytime.

Any thoughts on how to fix?

flyfoxuk avatar Apr 22 '20 17:04 flyfoxuk

This is the reason - by capturing the screenshot at the start of the assertLoginSuccess function, it indicates Tesco consider the browser to have failed some security checks. See attached screenshot. image

flyfoxuk avatar Apr 22 '20 18:04 flyfoxuk

Just got round to seeing this all up and getting the same error too.

aaronwardle avatar Apr 22 '20 18:04 aaronwardle

Tweaking the user agent in config seemed to do the trick for me :)

aaronwardle avatar Apr 22 '20 18:04 aaronwardle

What did you set the agent to? I tried that earlier with no effect. Possible solution: edit src/puppeteer-utils.js to amend the getBrowser function with a delay option of a few milliseconds, or set headless to false as well:

return puppeteer.launch({//headless: false, slowMo: 50 // slow down a bit });

flyfoxuk avatar Apr 22 '20 18:04 flyfoxuk

Just popped this into config.ini

useragent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36"

aaronwardle avatar Apr 22 '20 18:04 aaronwardle

Amazing Thanks @paulmaunders for creating this within 15 mins of the cron setup I got alerted twice and now have a delivery slot confirmed 😀

aaronwardle avatar Apr 22 '20 19:04 aaronwardle

fixed many thanks , and thanks for creating this

IanB999 avatar Apr 22 '20 19:04 IanB999

Running the browser headless fixed this for me (as suggested by @flyfoxuk 👍)

delsen-ssc avatar Apr 22 '20 20:04 delsen-ssc

INFO only : Seeing quite a few timeouts this morning

Logging in with new user session Opening https://www.tesco.com/groceries/en-GB/slots/delivery/2020-04-23?slotGroup=1 [Apr 23 - 29] Navigation Timeout Exceeded: 30000ms exceeded delivery-slots.js

IanB999 avatar Apr 23 '20 09:04 IanB999

Restarted my cron this morning after I turned it off for a few days Tesco: working fine. Asda waiting for selector ".login-container .form-error" failed: timeout 30000ms exceeded

IanB999 avatar Apr 26 '20 07:04 IanB999

Like @IanB999, Asda has been failing for me for the last 36 hours:

Logging in with new user session
Navigation Timeout Exceeded: 30000ms exceeded

Tesco is working fine with the Mac useragent string that @aaronwardle quoted above.

CharlesButcher avatar Apr 27 '20 10:04 CharlesButcher

Tesco never broke for me, but I'm not running 24/7, with my cron */5 5-20 * * *. I'll look at the ASDA issue later

andytson avatar Apr 27 '20 10:04 andytson

I found the issue with asda, recaptcha preventing bot login, but it went away as soon as I logged in. I've updated the code to check for this and suggest that as an action

andytson avatar Apr 28 '20 20:04 andytson

Thanks for that, but Asda is still failing even though I'm logged in with Firefox. @andytson, did you see a captcha the first time you signed in with your browser? I didn't.

CharlesButcher avatar Apr 28 '20 22:04 CharlesButcher

This is the reason - by capturing the screenshot at the start of the assertLoginSuccess function, it indicates Tesco consider the browser to have failed some security checks. See attached screenshot. image

Still seeing this after applied suggested fixes, any ideas? Thanks.

don-tpanic avatar Apr 29 '20 00:04 don-tpanic

@don-tpanic I'm having the same issue, Tesco hasn't worked for a few days for me. Auth failed. I used to get this error when it was working (albeit infrequently) however 90% of the time it would work fine. Logging in via the browser used to seem to make it work, perhaps coincidentally. I can't get this working at all for Tesco now though, even with the above suggested fixes. Even tried deleting the project folder and reinstalling. Asda seems to be working well.

woodsie6 avatar Apr 29 '20 08:04 woodsie6

I get issue with Asda though even after logging in.

1588100733159 - ASDA - Tue, 28 Apr 2020 19:05:33 GMT Logging in with new user session error: Auth failed. The website is thinks this could be a bot, and is showing a Recaptch check. Try logging in yourself, and this might go away [ian@centos8 delivery-slot-bot]$

IanB999 avatar Apr 29 '20 08:04 IanB999

Asda has just started working again after the bot has been running for many hours, with no changes to my setup. This is really very strange.

The addition of Morrison's is very welcome; is it supposed to be working yet? I keep getting Navigation Timeout Exceeded: 30000ms exceeded.

CharlesButcher avatar Apr 29 '20 17:04 CharlesButcher

If you go to Morrisons website in a browser you sit in a queue for while before you get onto the site. Might work in the early hours.

On Wed, 29 Apr 2020, 18:35 CharlesButcher, [email protected] wrote:

Asda has just started working again after the bot has been running for many hours, with no changes to my setup. This is really very strange.

The addition of Morrison's is very welcome; is it supposed to be working yet? I keep getting Navigation Timeout Exceeded: 30000ms exceeded.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/paulmaunders/delivery-slot-bot/issues/56#issuecomment-621357616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK2FCVMUGY4ZTH7I2PPTNI3RPBQOTANCNFSM4MOI2OBQ .

IanB999 avatar Apr 29 '20 18:04 IanB999

Thanks @IanB999. Morrisons loads instantly for me, but I did get a reCAPTCHA which I guess explains it.

CharlesButcher avatar Apr 29 '20 18:04 CharlesButcher

I made a start on Morrisons but got a bit stuck - so I'm hoping @andytson can take a look when he gets a mo!

paulmaunders avatar Apr 29 '20 19:04 paulmaunders

@don-tpanic I'm having the same issue, Tesco hasn't worked for a few days for me. Auth failed. I used to get this error when it was working (albeit infrequently) however 90% of the time it would work fine. Logging in via the browser used to seem to make it work, perhaps coincidentally. I can't get this working at all for Tesco now though, even with the above suggested fixes. Even tried deleting the project folder and reinstalling. Asda seems to be working well.

Tesco back working again today, haven’t changed anything. Must be their end.

woodsie6 avatar Apr 30 '20 10:04 woodsie6