chrishubert / whatsapp-api

This project is a REST API wrapper for the whatsapp-web.js library, providing an easy-to-use interface to interact with the WhatsApp Web platform.
https://www.christophehubert.com
Other
686 stars 333 forks source link

Session dissonects after docker restart #174

Open t0mer opened 5 months ago

t0mer commented 5 months ago

Hi, I'm using the docker version of your amazing work. It's been a while since i used it and now, after the first run everything works but when I restart the container is stops working and the following error appears in the logs:

Server running on port 3000
existing session detected tklein
/usr/src/app/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34
        const version = indexHtml.match(/manifest-([\d\\.]+)\.json/)[1];
                                                                    ^

TypeError: Cannot read properties of null (reading '1')
    at LocalWebCache.persist (/usr/src/app/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34:69)
    at /usr/src/app/node_modules/whatsapp-web.js/src/Client.js:771:36
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.11.1

I have permissions to the sessions folder and it seems that all files are there and have write permissions.

Thanks

gamingflexer commented 5 months ago

Ya same issues here ! @t0mer did you find any sol?

This is the same issue without docker, if i restart the server

Initialize error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
    at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
    at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
    at __puppeteer_evaluation_script__:4:17
t0mer commented 5 months ago

Ya same issues here ! @t0mer did you find any sol?

This is the same issue without docker, if i restart the server

Initialize error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'push')
    at fillModuleArray (eval at <anonymous> (:2:5), <anonymous>:6:74)
    at moduleRaid (eval at <anonymous> (:2:5), <anonymous>:15:3)
    at __puppeteer_evaluation_script__:4:17

Not yet. What I did find, and it's strange, is that it happens for specific accounts. I have 3 different WhatsApp accounts; two are working without any issues, and one is not (with the same deployment of the container).

gamingflexer commented 5 months ago

Yeah, i will ping back if i get any updates.

arktnld commented 4 months ago

This is related to this issue whatsapp-web.js #2789

rohankm commented 4 months ago

facing the same issue.. any solution?

arktnld commented 4 months ago

facing the same issue.. any solution?

Try this #190