WhiskeySockets / Baileys

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

Native mobile: 405 after successful registration #353

Open Arctic-beaver opened 1 year ago

Arctic-beaver commented 1 year ago

I'm getting error 405: Methos not allowed when using native mobile api. After successful registration, when trying to get messages using handlers. I'm using latest version of both wa and baileys.

Steps to reproduce the behavior:

  1. Registered mobile account with captcha using v6.4.1
  2. Got error 405 when trying to receive messages for this connection
  3. Reconnecting, restoring sessions from the database does not help

    • Do you have multiple clients on the same IP? NO
    • Are you using a proxy? NO

I'm using Baileys version 6.4.1. Changing mobile version to '2.23.18.8' does not help.

Full error could be seen above:

{"err": { "type": "Error", "message": "Connection Failure", "stack": "Error: Connection Failure\n at WebSocketClient.<anonymous> (\node_modules\\@whiskeysockets\\baileys\\lib\\Socket\\socket.js:506:13)\n at WebSocketClient.emit (node:events:526:28)\n at \node_modules\\@whiskeysockets\\baileys\\lib\\Socket\\socket.js:236:35\n at Object.decodeFrame (\node_modules\\@whiskeysockets\\baileys\\lib\\Utils\\noise-handler.js:136:17)\n at WebSocketClient.onMessageRecieved (\node_modules\\@whiskeysockets\\baileys\\lib\\Socket\\socket.js:212:15)\n at WebSocketClient.emit (node:events:526:28)\n at WebSocket.<anonymous> (\node_modules\\@whiskeysockets\\baileys\\lib\\Socket\\Client\\web-socket-client.js:46:100)\n at WebSocket.emit (node:events:526:28)\n at Receiver.receiverOnMessage node_modules\\ws\\lib\\websocket.js:1184:20)\n at Receiver.emit (node:events:526:28)", "data": { "reason": "405", "location": "frc" }, "isBoom": true, "isServer": false, "output": { "statusCode": 405, "payload": { "statusCode": 405, "error": "Method Not Allowed", "message": "Connection Failure" }, "headers": {} } }, "msg": "Connection Failure"}

Arphimed commented 1 year ago

Same problem...

ORMiK0 commented 1 year ago

error 405 - old version

Arphimed commented 1 year ago

error 405 - old version

Which version is current? Thanks for the answer.

xianm-sudo commented 1 year ago

I encountered the same problem. How did you deal with this problem in the end? @Arphimed @Arctic-beaver

spacesoft321 commented 1 year ago

i use this module in FastWSapi.com , but many time its show this error. any solution there

node:events:491 throw er; // Unhandled 'error' event ^

Error: WebSocket was closed before the connection was established at WebSocket.close (/root/fastws_server/node_modules/ws/lib/websocket.js:285:7) at WebSocketClient.close (/root/fastws_server/node_modules/@whiskeysockets/baileys/lib/Socket/Client/web-socket-client.js:53:21) at Object.end (/root/fastws_server/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:258:20) at Object.relogin (/root/fastws_server/waziper/waziper.js:399:35) at async /root/fastws_server/waziper/waziper.js:1187:6 at async Object.live_back (/root/fastws_server/waziper/waziper.js:1185:4) Emitted 'error' event on WebSocketClient instance at: at WebSocket. (/root/fastws_server/node_modules/@whiskeysockets/baileys/lib/Socket/Client/web-socket-client.js:46:100) at WebSocket.emit (node:events:513:28) at emitErrorAndClose (/root/fastws_server/node_modules/ws/lib/websocket.js:1008:13) at processTicksAndRejections (node:internal/process/task_queues:83:21)

Riders004 commented 1 year ago

I encountered the same problem. How did you deal with this problem in the end? @Arphimed @Arctic-beaver

Publicly Available Pairing Code Version

lauriolasw commented 12 months ago

Same here: {"level":10,"time":"2023-11-19T20:14:20.730Z","pid":73572,"hostname":"H79","msg":"\<failure reason='405' location='cln'/>"} connection: 'close', lastDisconnect: { error: Error: Connection Failure at WebSocketClient. (/home/ubuntu/Baileys650/src/Socket/socket.ts:646:7) at WebSocketClient.emit (node:events:514:28) at WebSocketClient.emit (node:domain:489:12) at /home/ubuntu/Baileys650/src/Socket/socket.ts:338:23 at Object.decodeFrame (/home/ubuntu/Baileys650/src/Utils/noise-handler.ts:176:5) at WebSocketClient.onMessageRecieved (/home/ubuntu/Baileys650/src/Socket/socket.ts:310:9) at WebSocketClient.emit (node:events:514:28) at WebSocketClient.emit (node:domain:489:12) at WebSocket. (/home/ubuntu/Baileys650/src/Socket/Client/web-socket-client.ts:40:52) at WebSocket.emit (node:events:514:28) { data: [Object], isBoom: true, isServer: false, output: [Object] }, date: 2023-11-19T20:14:20.731Z }

sg957 commented 10 months ago

Has anyone been able to solve this problem?

Riders004 commented 10 months ago

Has anyone been able to solve this problem?

Its wants a lastest wa web version

lauriolasw commented 10 months ago

WA now has strict control over numbers, with almost every VOIP number being declined with 'no_routes,' 'format_wrong,' and other 'fail' statuses. I'm using the Native mobile, and out of 100 VOIP attempts, only 2 are successful

bobslavtriev commented 9 months ago

https://github.com/WhiskeySockets/Baileys/pull/626

wandrey7 commented 6 months ago

It's working thanks