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
585 stars 286 forks source link

Sometimes session_not_connected although QR Code was generated and scanned from Whatsapp #237

Open teguhwin8 opened 2 weeks ago

teguhwin8 commented 2 weeks ago

Issue

Sometimes session_not_connected although QR Code was generated and scanned from Whatsapp

Environtment I used

PORT=3000 
API_KEY= 
BASE_WEBHOOK_URL=http://localhost:3000/localCallbackExample 
ENABLE_LOCAL_CALLBACK_EXAMPLE=TRUE 
RATE_LIMIT_MAX=1000 
RATE_LIMIT_WINDOW_MS=1000 
MAX_ATTACHMENT_SIZE=10000000 
SET_MESSAGES_AS_SEEN=TRUE 
DISABLED_CALLBACKS=message_ack|message_reaction  
WEB_VERSION='2.2410.1' 
WEB_VERSION_CACHE_TYPE=remote 
RECOVER_SESSIONS=TRUE 
SESSIONS_PATH=./sessions 
ENABLE_SWAGGER_ENDPOINT=TRUE 

Am I setting up something wrongly within the .env?

Expected flow

The flow i'm trying to initiate session

The result from API:

{
    "success": true,
    "state": "CONNECTED",
    "message": "session_connected"
}

Actual flow

However the Actual result, turns out to be...

{
    "success": false,
    "state": null,
    "message": "session_not_connected"
}
wauputr4 commented 2 weeks ago

Please, me too

tirzasrwn commented 2 weeks ago

i have the same problem here

mdestafadilah commented 1 week ago

it's about library whatsapp webjs

jaycoper commented 1 week ago

I had the same issue , I had to totally remove docker and clean everything, then did the installation again. It worked.

mdestafadilah commented 1 week ago

I had the same issue , I had to totally remove docker and clean everything, then did the installation again. It worked

with docker is success fuly?

mdestafadilah commented 1 week ago

27-06-2024 10-03-31

its' about whatsapp-webjs

jaycoper commented 1 week ago

I got the same error running locally on a Ubuntu, When I installed it on a Windows machine ( my own ), it worked locally sometimes, but on a Ubuntu I never got it to work.

Then i Switched over to Docker on Ubuntu and it worked.

fichaepi commented 1 week ago

i was getting all sorts of weird errors, but yesterday it completely stopped working. I proceeded to fix it:

WEB_VERSION='2.2328.5' WEB_VERSION_CACHE_TYPE=none

I actually reverted the web_version to a older one, not sure about the side effects or how this will play out in the near future. it seems that the important thing is web_version_cache=NONE

I terminated the previous session, reopened it. It showed the QR code and it finally worked again.

patricknasc commented 1 week ago

Getting the same error. I cannot open multiple sessions. Whilst I invoke the endpoint to start a new session, it says it is connected. If I call again, it confirms that the session already exists, but when I call the endpoint to check the session status it says that the session is not connected.