paulmaunders / delivery-slot-bot

A puppeteer based bot to monitor supermarket online delivery slots.
MIT License
54 stars 27 forks source link

ASDA login generating error - cookies.30.expires: double value expected #71

Open southscanner opened 4 years ago

southscanner commented 4 years ago

Not much more to say at the moment, all i have is that the ASDA login appears to fail with the following error:

Protocol error (Network.setCookies): Invalid parameters cookies.30.expires: double value expected

southscanner commented 4 years ago

As a test I can log on using chromium fine. Also this is running on a raspberry pi, in case that is of relevance.

git-creat commented 4 years ago

I can't get Asda to work at all, it just keeps coming up saying:

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

southscanner commented 4 years ago

I solved that on the pi by setting up rdp (it’s remote) and a desktop interface. Then started up chromium on the pi desktop and authenticated to their website. From then on the bot would no longer generate the captcha error, it however moved on to this one.

CharlesButcher commented 4 years ago

Without wanting to hijack @southscanner's original issue, like @git-creat I'm still stuck on the reCAPTCHA issue with Asda. I've had a couple of successful logins, seemingly at random, in among 1500 failures in the current session. This is on a Mac, previously logged in with Firefox and a Firefox useragent string. I've now logged in with Chrome and disabled the useragent string, but no change.

andytson commented 4 years ago

I can't recreate the cookie issue. is there a longer stack trace after the error?

The recaptcha thing is a big pain and I can only get around it by logging into the account manually from the same browser for it to stop asking

Please discuss it in another ticket though

CharlesButcher commented 4 years ago

@andytson Does that mean desktop Chrome, or somehow via the puppeteer browser? If the former, that's not working for me.

andytson commented 4 years ago

https://github.com/paulmaunders/delivery-slot-bot/issues/72 - for the recaptcha issue

southscanner commented 4 years ago

I can't recreate the cookie issue. is there a longer stack trace after the error?

The recaptcha thing is a big pain and I can only get around it by logging into the account manually from the same browser for it to stop asking

Please discuss it in another ticket though

Hi. If someone can guide how I’m might get a more verbose log on the cookie issue I’m happy to give it a go.

andytson commented 4 years ago

I've just merged #73 which should give more verbose information I can use to understand where this is coming from. If you update the code, you'll get that information

southscanner commented 4 years ago

Error eventually occurred after a great mamy recaptcha messages. Seems to be when either it has, or thinks it has, authenticated:

1589207516715 - ASDA - Mon, 11 May 2020 14:31:56 GMT Logging in with new user session Opening https://groceries.asda.com/checkout/book-slot?tab=deliver No slots unexpected error: { Error: Protocol error (Network.setCookies): Invalid parameters cookies.32.expires: double value expected at Promise (/home/pi/delivery-slot-bot/node_modules/puppeteer/lib/Connection.js:154:63) at new Promise () at CDPSession.send (/home/pi/delivery-slot-bot/node_modules/puppeteer/lib/Connection.js:153:16) at Page.setCookie (/home/pi/delivery-slot-bot/node_modules/puppeteer/lib/Page.js:385:32) at process._tickCallback (internal/process/next_tick.js:68:7) -- ASYNC -- at Page. (/home/pi/delivery-slot-bot/node_modules/puppeteer/lib/helper.js:82:19) at AsdaStore.start (/home/pi/delivery-slot-bot/src/stores/asda.js:107:18) at AsdaStore.checkCollections (/home/pi/delivery-slot-bot/src/stores/asda.js:144:16) at runStore (/home/pi/delivery-slot-bot/src/index.js:40:21) at process._tickCallback (internal/process/next_tick.js:68:7) message: 'Protocol error (Network.setCookies): Invalid parameters cookies.32.expires: double value expected' }

And then the next attempt:

1589208034527 - ASDA - Mon, 11 May 2020 14:40:34 GMT unexpected error: { Error: Protocol error (Network.setCookies): Invalid parameters cookies.32.expires: double value expected at Promise (/home/pi/delivery-slot-bot/node_modules/puppeteer/lib/Connection.js:154:63) at new Promise () at CDPSession.send (/home/pi/delivery-slot-bot/node_modules/puppeteer/lib/Connection.js:153:16) at Page.setCookie (/home/pi/delivery-slot-bot/node_modules/puppeteer/lib/Page.js:385:32) at process._tickCallback (internal/process/next_tick.js:68:7) -- ASYNC -- at Page. (/home/pi/delivery-slot-bot/node_modules/puppeteer/lib/helper.js:82:19) at AsdaStore.start (/home/pi/delivery-slot-bot/src/stores/asda.js:107:18) at AsdaStore.checkDeliveries (/home/pi/delivery-slot-bot/src/stores/asda.js:135:16) at runStore (/home/pi/delivery-slot-bot/src/index.js:33:56) at process._tickCallback (internal/process/next_tick.js:68:7) message: 'Protocol error (Network.setCookies): Invalid parameters cookies.32.expires: double value expected' }

andytson commented 4 years ago

I'm wondering if it's a bug in your chrome/ium version. It looks as though the cookies being saved have one with a expires of some other type than the Network.getCookies is supposed to be produced (probably a string format of the expiry time, when it's supposed to be the number of seconds since 1st Jan 1970)