pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.54k stars 3.7k forks source link

Timeout when resuming session in multi-device beta #921

Closed sistemas-y-redes closed 3 years ago

sistemas-y-redes commented 3 years ago

Bug description

When resuming a stored session from the WWebJS folder, it times out with the AUTHENTICATION_FAILURE event. By checking my server logs, I can see it started happening today 13/10/2021 from 6AM UTC. I can only make the bot authenticate correctly the first time, when I scan the QR code, but after a restart, it can't authenticate with the local files in the WWebJS folder

Reproduction steps

Steps to reproduce the behavior:

  1. Initialize bot without any session
  2. Scan QR code
  3. Restart node

Expected behavior

Authentication success and being able to use the bot

Relevant code

I have checked my filepath by adding logs in your code and I can confirm it is correct, I also checked it's firing the event I indicated

const dirPath = path.join(process.cwd(), this.options.dataPath, this.id ? 'session-' + this.id : 'session'); 
console.log("DIRPATH", dirPath)
this.options.puppeteer.userDataDir = dirPath;
this.emit(Events.AUTHENTICATION_FAILURE, 'Unable to log in. Are the files corrupt?');
browser.close();
console.log("TIMEOUTERROR")

image

Environment (please complete the following information):

WhatsApp

Library

Other

caioagiani commented 3 years ago

https://github.com/pedroslopez/whatsapp-web.js/pull/889

rodsv commented 3 years ago

seems its about this message, about version of chrome

image

sistemas-y-redes commented 3 years ago

I turned the server on today and it worked again. with nothing changed, both in my Windows PC and the Linux server. I can't know for certain why this happened, cold be the Chrome version but I didn't touch any of it. Closing this issue

sistemas-y-redes commented 3 years ago

After 1 week of use I am having the same error again, haven't touched anything regarding the Chrome installation so I don't believe it has anything to do with that. Is it possible that these sessions expire in some way? When i fixed it a week ago I just created a new session like 5 times until one worked.

sistemas-y-redes commented 3 years ago

This issue was addressed in the multi device branch discussion and fixed, closing issue