whatsapp-api icon indicating copy to clipboard operation
whatsapp-api copied to clipboard

QR showing after connrected

Open cashmaal opened this issue 7 months ago • 5 comments

Hi team

I am using this service from 6 months, but from 5 days I got a issue, When I connect any business whatsapp using QR code and that connected from phone successfully but not connect to our server, and we can see a error on pm2 logs

this is error:

0|whatsapp-api | Initialize error: Waiting for selector [data-icon='search'] failed: Protocol error (Runtime.callFunctionOn): Target closed.

how can we solve this?

due to this we can't scan qr code again and it show qr already scanned but on status "{"success":false,"state":null,"message":"session_not_connected"}"

I think this issue is come because whatsapp show a popup of continue button, if we don't click on continue button web whatsapp not working on browsers also, like opera and chrome etc.. same this issue I think in our API

Image

cashmaal avatar May 16 '25 11:05 cashmaal

Do you have the WEB_VERSION_CACHE_TYPE env configured?

avoylenko avatar May 18 '25 13:05 avoylenko

Thanks for your reply, the blow are my .env file.

Application

PORT=3000 # OPTIONAL, DEFAULT 3000 API_KEY= # OPTIONAL, DEFAULT EMPTY BASE_WEBHOOK_URL=https://webhook.site/5f04a3b6-2359-4a6b-9512-caba6ef46e43 # MANDATORY ENABLE_LOCAL_CALLBACK_EXAMPLE=TRUE # OPTIONAL, DISABLE FOR PRODUCTION RATE_LIMIT_MAX=1000 # OPTIONAL, THE MAXIUM NUMBER OF CONNECTIONS TO ALLOW PER TIME FRAME RATE_LIMIT_WINDOW_MS=1000 # OPTIONAL, TIME FRAME FOR WHICH REQUESTS ARE CHECKED IN MS

Client

MAX_ATTACHMENT_SIZE=10000000 # IF REACHED, MEDIA ATTACHMENT BODY WILL BE NULL SET_MESSAGES_AS_SEEN=TRUE # WILL MARK THE MESSAGES AS READ AUTOMATICALLY

ALL CALLBACKS: auth_failure|authenticated|call|change_state|disconnected|group_join|group_leave|group_update|loading_screen|media_uploaded|message|message_ack|messa>

DISABLED_CALLBACKS=qr|message_ack|message_reaction|unread_count|message_edit|message_ciphertext # PREVENT SENDING CERTAIN TYPES OF CALLBACKS BACK TO THE WEBHOOK WEB_VERSION='2.2328.5' # OPTIONAL, THE VERSION OF WHATSAPP WEB TO USE WEB_VERSION_CACHE_TYPE=none # OPTIONAL, DETERMINTES WHERE TO GET THE WHATSAPP WEB VERSION(local, remote or none), DEFAULT 'none' RECOVER_SESSIONS=TRUE # OPTIONAL, SHOULD WE RECOVER THE SESSION IN CASE OF PAGE FAILURES

Session File Storage

SESSIONS_PATH=./sessions # OPTIONAL

ENABLE_SWAGGER_ENDPOINT=TRUE # OPTIONAL

cashmaal avatar May 18 '25 13:05 cashmaal

Your configuration seems fine. Would you mind to switch to a forked project and check if your issue is solved there? Here is the docker image: docker pull avoylenko/wwebjs-api:latest

avoylenko avatar May 18 '25 18:05 avoylenko

I had the same issue, and switching to the forked project avoylenko/wwebjs-api:latest fixed it for me.

Thanks!

de-foo avatar May 22 '25 08:05 de-foo

ALL CALLBACKS: auth_failure|authenticated|call|change_state|disconnected|group_join|group_leave|group_update|loading_screen|media_uploaded|message|message_ack|message_create|message_reaction|message_revoke_everyone|qr|ready|contact_changed|unread_count|message_edit|message_ciphertext

DISABLED_CALLBACKS=message_ack|message_reaction|unread_count|message_edit|message_ciphertext # PREVENT SENDING CERTAIN TYPES OF CALLBACKS BACK TO THE WEBHOOK WEB_VERSION='2.3000.1022606590-alpha' # OPTIONAL, THE VERSION OF WHATSAPP WEB TO USE WEB_VERSION_CACHE_TYPE=remote # OPTIONAL, DETERMINES WHERE TO GET THE WHATSAPP WEB VERSION(local, remote or none), DEFAULT 'none' RECOVER_SESSIONS=TRUE # OPTIONAL, SHOULD WE RECOVER THE SESSION IN CASE OF PAGE FAILURES CHROME_BIN= /usr/bin/google-chrome # OPTIONAL, PATH TO CHROME BINARY HEADLESS=TRUE # OPTIONAL, RUN CHROME IN HEADLESS MODE RELEASE_BROWSER_LOCK=TRUE # OPTIONAL, RELEASE THE BROWSER LOCK ON SESSION INITIALIZATION LOG_LEVEL=info # OPTIONAL, SET THE LOG LEVEL ENABLE_WEBHOOK=TRUE # OPTIONAL, ENABLE WEBHOOK FOR REALTIME UPDATES(TRUE BY DEFAULT) ENABLE_WEBSOCKET=FALSE # OPTIONAL, ENABLE WEBSOCKET FOR REALTIME UPDATES(FALSE BY DEFAULT)

mdestafadilah avatar Jun 04 '25 01:06 mdestafadilah