WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.17k stars 1.1k forks source link

Phone Number loggout instantly after scanning #779

Closed rahulmehra1496 closed 2 months ago

rahulmehra1496 commented 2 months ago

Phone Number loggout instantly after scanning getting below error:-

Connection closed. You are logged out. 3|WaunofficialNode3007 | updateInstanceStatus 339 | Changing instance status to :: false 3|WaunofficialNode3007 | startsock :: connection update { 3|WaunofficialNode3007 | connection: 'close', 3|WaunofficialNode3007 | lastDisconnect: { 3|WaunofficialNode3007 | error: Error: Stream Errored (conflict) 3|WaunofficialNode3007 | at WebSocket. (/opt/NodeJs/WAMultiDevice3007/whatsappmultipledevice/Baileys-master/src/Socket/socket.ts:514:7) 3|WaunofficialNode3007 | at WebSocket.emit (events.js:400:28) 3|WaunofficialNode3007 | at WebSocket.emit (domain.js:475:12) 3|WaunofficialNode3007 | at /opt/NodeJs/WAMultiDevice3007/whatsappmultipledevice/Baileys-master/src/Socket/socket.ts:278:23 3|WaunofficialNode3007 | at Object.decodeFrame (/opt/NodeJs/WAMultiDevice3007/whatsappmultipledevice/Baileys-master/src/Utils/noise-handler.ts:164:5)

Old connections are working but new connections are not made.

meetshamee commented 2 months ago

Noticed : device very rarely connected, when I keep trying lot of time.

Noob0005 commented 2 months ago

Yes same issue with my number too😒 unable to generate a session

zebyoo commented 2 months ago

error in device finding because i see that qr again and again disply when connect qr only indian numbers but other numbers work

achalag1 commented 2 months ago

Did anyone manage to solve it?

Riders004 commented 2 months ago

error in device finding because i see that qr again and again disply when connect qr only indian numbers but other numbers work

Use local machine to connect don't use cloud servers For Indian number

achalag1 commented 2 months ago

Any Solution for Cloud Servers ?

manojsitapara commented 2 months ago

Looks like an issue with Ubuntu server and WhatsApp web. Is there any one who is facing issues in other OS except Ubuntu?

jmd-2000 commented 2 months ago

WhatsApp Web is allowing users to link device on Local PC but on Server (checked on Ubuntu, Windows Server 2019) link device not working

zebyoo commented 2 months ago

this is final issiue in this turkey work i tested and canda work i tested but not india i dont know why i think libery issue somewhere

here you see logs 2024-05-13T11:06:50: at SessionCipher.doDecryptWhisperMessage (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:236:19) 2024-05-13T11:06:50: at SessionCipher.decryptWithSessions (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:147:40) 2024-05-13T11:06:50: at 908508400184.57 [as awaitable] (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:171:39) 2024-05-13T11:06:50: at async _asyncQueueExecutor (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/queue_job.js:20:29) 2024-05-13T11:06:50: Session error:Error: Bad MAC Error: Bad MAC 2024-05-13T11:06:50: at Object.verifyMAC (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/crypto.js:87:15) 2024-05-13T11:06:50: at SessionCipher.doDecryptWhisperMessage (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:250:16) 2024-05-13T11:06:50: at async SessionCipher.decryptWithSessions (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:147:29) 2024-05-13T11:06:50: at async 908508400184.57 [as awaitable] (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:171:28) 2024-05-13T11:06:50: at async _asyncQueueExecutor (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/queue_job.js:20:29) 2024-05-13T11:06:50: Failed to decrypt message with any known session... 2024-05-13T11:06:50: Session error:MessageCounterError: Key used already or never filled MessageCounterError: Key used already or never filled 2024-05-13T11:06:50: at SessionCipher.doDecryptWhisperMessage (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:236:19) 2024-05-13T11:06:50: at SessionCipher.decryptWithSessions (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:147:40) 2024-05-13T11:06:50: at 908508400184.57 [as awaitable] (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:171:39) 2024-05-13T11:06:50: at async _asyncQueueExecutor (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/queue_job.js:20:29) 2024-05-13T11:06:50: Session error:Error: Bad MAC Error: Bad MAC 2024-05-13T11:06:50: at Object.verifyMAC (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/crypto.js:87:15) 2024-05-13T11:06:50: at SessionCipher.doDecryptWhisperMessage (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:250:16) 2024-05-13T11:06:50: at async SessionCipher.decryptWithSessions (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:147:29) 2024-05-13T11:06:50: at async 908508400184.57 [as awaitable] (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:171:28) 2024-05-13T11:06:50: at async _asyncQueueExecutor (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/queue_job.js:20:29) 2024-05-13T11:11:09: Failed to decrypt message with any known session... 2024-05-13T11:11:09: Session error:MessageCounterError: Key used already or never filled MessageCounterError: Key used already or never filled 2024-05-13T11:11:09: at SessionCipher.doDecryptWhisperMessage (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:236:19) 2024-05-13T11:11:09: at SessionCipher.decryptWithSessions (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:147:40) 2024-05-13T11:11:09: at 908508400184.57 [as awaitable] (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:171:39) 2024-05-13T11:11:09: at async _asyncQueueExecutor (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/queue_job.js:20:29) 2024-05-13T11:11:09: Session error:Error: Bad MAC Error: Bad MAC 2024-05-13T11:11:09: at Object.verifyMAC (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/crypto.js:87:15) 2024-05-13T11:11:09: at SessionCipher.doDecryptWhisperMessage (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:250:16) 2024-05-13T11:11:09: at async SessionCipher.decryptWithSessions (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:147:29) 2024-05-13T11:11:09: at async 908508400184.57 [as awaitable] (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:171:28) 2024-05-13T11:11:09: at async _asyncQueueExecutor (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/queue_job.js:20:29) 2024-05-13T11:11:09: Failed to decrypt message with any known session... 2024-05-13T11:11:09: Session error:MessageCounterError: Key used already or never filled MessageCounterError: Key used already or never filled 2024-05-13T11:11:09: at SessionCipher.doDecryptWhisperMessage (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:236:19) 2024-05-13T11:11:09: at SessionCipher.decryptWithSessions (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:147:40) 2024-05-13T11:11:09: at 908508400184.57 [as awaitable] (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:171:39) 2024-05-13T11:11:09: at async _asyncQueueExecutor (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/queue_job.js:20:29) 2024-05-13T11:11:09: Session error:Error: Bad MAC Error: Bad MAC 2024-05-13T11:11:09: at Object.verifyMAC (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/crypto.js:87:15) 2024-05-13T11:11:09: at SessionCipher.doDecryptWhisperMessage (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:250:16) 2024-05-13T11:11:09: at async SessionCipher.decryptWithSessions (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:147:29) 2024-05-13T11:11:09: at async 908508400184.57 [as awaitable] (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/session_cipher.js:171:28) 2024-05-13T11:11:09: at async _asyncQueueExecutor (/www/wwwroot/myocmwsworks/waziper/node_modules/libsignal/src/queue_job.js:20:29)

meetshamee commented 2 months ago

It's not entirely true that it won't work on Ubuntu. Today after much effort I managed to successfully connect five Indian numbers to Ubuntu cloud server with same IP.

manojsitapara commented 2 months ago

It's not entirely true that it won't work on Ubuntu. Today after much effort I managed to successfully connect five Indian numbers to Ubuntu cloud server with same IP.

Can you please share what steps did you follow?

meetshamee commented 2 months ago

It's not entirely true that it won't work on Ubuntu. Today after much effort I managed to successfully connect five Indian numbers to Ubuntu cloud server with same IP.

Can you please share what steps did you follow?

With the same library, rarely connected, don't know what

zebyoo commented 2 months ago

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

meetshamee commented 2 months ago

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

This Not IP Restriction. checked with Indian IP In GCP. Not Working

globaltechapi commented 2 months ago

Looks like an issue with Ubuntu server and WhatsApp web. Is there any one who is facing issues in other OS except Ubuntu?

Tested with centOS, no luck

Riders004 commented 2 months ago

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

Huh WhatsApp web is working or local machine or local pc not in cloud servers

Cosm1cBug commented 2 months ago

I'm using an Indian number and hosted on a local machine & I'm not getting this error. πŸ€”

meetshamee commented 2 months ago

I'm using an Indian number and hosted on a local machine & I'm not getting this error. πŸ€”

The problem is with the cloud machines.

Riders004 commented 2 months ago

I'm using an Indian number and hosted on a local machine & I'm not getting this error. πŸ€”

Any Solution for Cloud Servers ?

Use the proxy for the that specific country

rbkayz commented 2 months ago

which provider works well?

Riders004 commented 2 months ago

which provider works well?

Idk but try to get up of visitor and add in Baileys sockets config

achalag1 commented 2 months ago

I'm using an Indian number and hosted on a local machine & I'm not getting this error. πŸ€”

Any Solution for Cloud Servers ?

Use the proxy for the that specific country

It Does Not Work with Servers in India Data Centers.. Have you tested it with proxy..?

sairmali commented 2 months ago

no problem from proxy or I.P and anything just problem in Android version because it is perfect working in iPhone..

ujwalvj commented 2 months ago

I'm using an Indian number and hosted on a local machine & I'm not getting this error. πŸ€”

Any Solution for Cloud Servers ?

Use the proxy for the that specific country

which proxy service are you using?

ujwalvj commented 2 months ago

this error only happens with Indian mobile number I test same code same version from other country mobile number then its working fine

we are observing this for our Indian as well as non-indian phone numbers both.

ujwalvj commented 2 months ago

@SheIITear are you looking at this buddy? If any updates, please let us know.

Riders004 commented 2 months ago

no problem from proxy or I.P and anything just problem in Android version because it is perfect working in iPhone..

Bro tried it on WhatsApp beta not un normally WhatsApp it's working WhatsApp public version not in WhatsApp beta in version and in future you need to update your WhatsApp

anandsork commented 2 months ago

We tried to run WebWA in browser on Cloud (No library.. Plain Chrome & WebWA).. Login failed. Attached are the logs in dev tools->console

image

rodrigo-rads commented 2 months ago

I had the same problem, after searching found this https://github.com/WhiskeySockets/Baileys/issues/92#issuecomment-2022612517

I miss this line

image

anandsork commented 2 months ago

I had the same problem, after searching found this https://github.com/WhiskeySockets/Baileys/issues/92#issuecomment-2022612517

I miss this line

image

Does this resolve Indian number connection issue?

meetshamee commented 2 months ago

https://github.com/WhiskeySockets/Baileys/issues/92#issuecomment-2022612517

This Not Related to Indian Number Logout Issue.

SheIITear commented 2 months ago

@SheIITear are you looking at this buddy? If any updates, please let us know.

No I am not. At the moment I'm on holiday visiting relatives for summer, I don't have my computer with me. But if this is also happening with whatsapp web I don't think there is much we could do in that case.

They could have either rolled some broken patches or just trying to block cloud servers from accessing whatsapp web as a way to try prevent people from using libraries like Baileys. You can try proxying the connection thru a legit ip in same country as your number to see if anything changes.

badboybackagain commented 2 months ago

I am able to connect account in Web Whatsapp. However, it is failing with baileys.

mayankagar360 commented 2 months ago

@SheIITear these issue is not related mentioned points but i think when we are connecting it should give 515 status code and now it is giving the 516 status code that is making the difference. Could you please guide us little bit.

ujwalvj commented 2 months ago

Has anybody tried setting out the library locally and checking if it helps in the QR code scan issue? If so, what was the outcome?

mayankagar360 commented 2 months ago

No issue in the local in local everything is working fine @ujwalvj

ujwalvj commented 2 months ago

thanks @mayankagar360 ! Let me check.

mayankagar360 commented 2 months ago

yes @ujwalvj please post here if you found something

himanshuja commented 2 months ago

I have Tried, it is an IP address issue. My baileys instance are hosted on non-indian datacenters. As soon as i tried indian Datacenter. It started working. Try that, it should work.

himanshuja commented 2 months ago

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

This Not IP Restriction. checked with Indian IP In GCP. Not Working

As soon as i moved it to indian IP it worked like charm. logged in immediately.

sairmali commented 2 months ago

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

This Not IP Restriction. checked with Indian IP In GCP. Not Working

As soon as i moved it to indian IP it worked like charm. logged in immediately.

it's working on indian server or non indian server ?

achalag1 commented 2 months ago

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

This Not IP Restriction. checked with Indian IP In GCP. Not Working

As soon as i moved it to indian IP it worked like charm. logged in immediately.

Which Data Center in India ?

Riders004 commented 2 months ago

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

This Not IP Restriction. checked with Indian IP In GCP. Not Working

As soon as i moved it to indian IP it worked like charm. logged in immediately.

How ?

himanshuja commented 2 months ago

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

This Not IP Restriction. checked with Indian IP In GCP. Not Working

As soon as i moved it to indian IP it worked like charm. logged in immediately.

Which Data Center in India ?

I am using CtrlS

himanshuja commented 2 months ago

this is the IP CIDR 219.90.67.XXX

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

This Not IP Restriction. checked with Indian IP In GCP. Not Working

As soon as i moved it to indian IP it worked like charm. logged in immediately.

Which Data Center in India ?

I am using CtrlS

this is the IP CIDR 219.90.67.XXX

Riders004 commented 2 months ago

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

This Not IP Restriction. checked with Indian IP In GCP. Not Working

As soon as i moved it to indian IP it worked like charm. logged in immediately.

Which Data Center in India ?

I am using CtrlS

It's paid or free ?

himanshuja commented 2 months ago

same ip need in same country now i think error is detected indian ip only connect if you using proxy of indian or other then its not connect indian number this mean ip detected and host find by server ip location any one here that have indian server to use and connect i dont know stream issue detect its block ways to stream session

This Not IP Restriction. checked with Indian IP In GCP. Not Working

As soon as i moved it to indian IP it worked like charm. logged in immediately.

Which Data Center in India ?

I am using CtrlS

It's paid or free ?

Which Datacenter Offers for free. Please share me too.. hehe :)

sairmali commented 2 months ago

CtrlS

please i want to know what is actual problem please i want to know..

optimisticdesigns commented 2 months ago

I have Tried, it is an IP address issue. My baileys instance are hosted on non-indian datacenters. As soon as i tried indian Datacenter. It started working. Try that, it should work.

I am using digitaloceans indian data center yet i am facing the logout issue. Can you be a little more specific??? If whatsapp is blocking indian ip/phone number then how you're able to login on your server.

I think baileys api is now broken.... Nothing can be done if whatsapp is actually blocking our code.

Riders004 commented 2 months ago

I have Tried, it is an IP address issue. My baileys instance are hosted on non-indian datacenters. As soon as i tried indian Datacenter. It started working. Try that, it should work.

I am using digitaloceans indian data center yet i am facing the logout issue. Can you be a little more specific??? If whatsapp is blocking indian ip/phone number then how you're able to login on your server.

I think baileys api is now broken.... Nothing can be done if whatsapp is actually blocking our code.

WhatsApp isn't allowed to Use to WhatsApp Web in cloud servers you can your local machine or local pc