danielcardeenas / sulla

👩🏻‍🔬 Javascript Whatsapp api library for chatbots
MIT License
1.26k stars 274 forks source link

error when restarting the instance (Authenticate to continue) infinite #299

Open ev4ndropc opened 4 years ago

ev4ndropc commented 4 years ago

Then create the instance and read the qr work normally, but when I close the server and open it again it is in "Authenticate to continue" and does not start.

best-tech commented 4 years ago

i need help too

thiagoamarante commented 4 years ago

https://github.com/danielcardeenas/sulla#closing-saving-sessions

Close the session properly to ensure the session is saved for the next time you log in (So it wont ask for QR scan again). So instead of CTRL+C,

// Catch ctrl+C process.on('SIGINT', function() { client.close(); });

// Try-catch close try { ... } catch (error) { client.close(); }

best-tech commented 4 years ago

I think it's something else. It stopped working a few hours ago. Previously, close() was saved correctly and started again

ev4ndropc commented 4 years ago

client.close();

not work

ocracy commented 4 years ago

Yes i have this problem too

pselibas commented 4 years ago

I too can confirm I am having this issue.

best-tech commented 4 years ago

Limpe o diretório "session\Default\Cache" antes de executar o Create.

it dosnt help

image

arthur2weber commented 4 years ago

Sugestão: Consegui sucesso removendo o arquivo "\session\Default\Service Worker\Database\MANIFEST-000001" antes do create.

image

thiagoamarante commented 4 years ago

that's true! deleting the "\session\Default\Service Worker\Database\MANIFEST-000001" file is working again!

thiagoamarante commented 4 years ago

for now, deleting the "\session\Default\Service Worker\Database\MANIFEST-000001" file is working again!

ocracy commented 4 years ago

Use headless:false

On 26 Apr 2020 Sun at 19:34 Thiago Amarante notifications@github.com wrote:

for now, deleting the "\session\Default\Service Worker\Database\MANIFEST-000001" file is working again!

You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/danielcardeenas/sulla/issues/299#issuecomment-619581155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIDQGSTE6LDYPNVXAFXKB3RORPCDANCNFSM4MQMSKMA .

AlexanderXIV commented 4 years ago

If I use headless:false, it works, otherwise not. Does anyone have an explanation for this? Or better a workaround?

EDIT: Thanks, with iAnton's code it's working now.

iAnton commented 4 years ago

Works to me

  const fse = require("fs-extra");

  fse
    .remove("./session/Default/Service Worker/Database/MANIFEST-000001")
    .then(() => {
      sulla.create().then((client) => start(client));
    });
willianmaria commented 4 years ago

Still working @iAnton ? I'm using Sulla wiht Express in Kubernetes, but everytime when I restart the container I lost the session with WhatsApp.

kaykyr commented 4 years ago

Same here... Looks like WhatsApp is asking to update Google Chrome. :P

roelandp commented 4 years ago

Above suggested solution still working fine for me. Note that in the solution by @iAnton you should replace ./session/ in the path with the actual name of your session.

kaykyr commented 4 years ago

Above suggested solution still working fine for me. Note that in the solution by @iAnton you should replace ./session/ in the path with the actual name of your session.

Mais conhecido como gambiarra.

roelandp commented 4 years ago

I think it has to do with whether you already have Chrome (the regular browser) running on your machine actually. If you don't have it running and you start fresh, I think it just works, restart after restart. However there is some conflict when you already have regular browsers running, as far as I can tell.

kaykyr commented 4 years ago

I think it has to do with whether you already have Chrome (the regular browser) running on your machine actually. If you don't have it running and you start fresh, I think it just works, restart after restart. However there is some conflict when you already have regular browsers running, as far as I can tell.

I don't know... Because wa-automate lib is working fine here... It's a bug, for sure.

andresilvagomez commented 4 years ago

I used this parameters to create a session and is working

const options = {
    headless: true, // Headless chrome
    useChrome: false, // If false will use Chromium instance
    debug: false, // Opens a debug session
    logQR: true, // Logs QR automatically in terminal
};
3cubos commented 4 years ago

I used this parameters to create a session and is working

const options = {
    headless: true, // Headless chrome
    useChrome: false, // If false will use Chromium instance
    debug: false, // Opens a debug session
    logQR: true, // Logs QR automatically in terminal
};

how to do???

roelandp commented 4 years ago

I used this parameters to create a session and is working

const options = {
    headless: true, // Headless chrome
    useChrome: false, // If false will use Chromium instance
    debug: false, // Opens a debug session
    logQR: true, // Logs QR automatically in terminal
};

how to do???

Their is an issue with the current state of Sulla available on NPM: Here are fixes:

375