WhiskeySockets / Baileys

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

Request failed with status code 400 at settle #695

Open roysG opened 8 months ago

roysG commented 8 months ago

Describe the bug Suddenly on receive msgs i get the following error:

To Reproduce Steps to reproduce the behavior:

  1. Wait to receive new msgs
  2. Suddenly the error happens

Expected behavior No error should happen

Environment (please complete the following information):

Additional context

file:///Users/roysabah/www/likeu.ai/server/whatsapp/node_modules/axios/lib/core/settle.js:19 reject(new AxiosError( ^ source-map-support.js:726AxiosError: Request failed with status code 400 at settle (file:///Users/roysabah/www/likeu.ai/server/whatsapp/node_modules/axios/lib/core/settle.js:19:12) at RedirectableRequest.handleResponse (file:///Users/roysabah/www/likeu.ai/server/whatsapp/node_modules/axios/lib/adapters/http.js:520:9) at RedirectableRequest.emit (node:events:519:28) at RedirectableRequest.emit (node:domain:488:12) at RedirectableRequest._processResponse (/Users/roysabah/www/likeu.ai/server/whatsapp/node_modules/follow-redirects/index.js:356:10) at ClientRequest.RedirectableRequest._onNativeResponse (/Users/roysabah/www/likeu.ai/server/whatsapp/node_modules/follow-redirects/index.js:62:10) at Object.onceWrapper (node:events:634:26) at ClientRequest.emit (node:events:519:28) at ClientRequest.emit (node:domain:488:12) at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:690:27) { code: 'ERR_BAD_REQUEST', config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: 'http', transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: Infinity, maxBodyLength: Infinity, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: Object [AxiosHeaders] { Accept: 'application/json, text/plain, /', 'Content-Type': undefined, Origin: 'https://web.whatsapp.com', 'User-Agent': 'axios/1.5.0', 'Accept-Encoding': 'gzip, compress, deflate, br' }, responseType: 'stream', method: 'get', url: 'https://mmg.whatsapp.net', data: undefined }, request: <ref 1> ClientRequest { _events: [Object: null prototype] { abort: [Function (anonymous)], aborted: [Function (anonymous)], connect: [Function (anonymous)], error: [Function (anonymous)], socket: [Function (anonymous)], timeout: [Function (anonymous)], finish: [Function: requestOnFinish] }, _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, _header: 'GET / HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Origin: https://web.whatsapp.com\r\n' + 'User-Agent: axios/1.5.0\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: mmg.whatsapp.net\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype], freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: true, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 1, maxCachedSessions: 100, _sessionCache: [Object], [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false }, socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/', _ended: false, res: IncomingMessage { _events: [Object], _readableState: [ReadableState], _maxListeners: undefined, socket: [TLSSocket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: false, rawHeaders: [Array], rawTrailers: [], joinDuplicateHeaders: undefined, aborted: false, upgrade: false, url: '', method: null, statusCode: 400, statusMessage: 'Bad Request', client: [TLSSocket], _consuming: false, _dumped: false, req: [Circular 1], _eventsCount: 4, responseUrl: 'https://mmg.whatsapp.net/', redirects: [], [Symbol(shapeMode)]: true, [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 12, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0 }, aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: HTTPParser { '0': null, '1': [Function: parserOnHeaders], '2': [Function: parserOnHeadersComplete], '3': [Function: parserOnBody], '4': [Function: parserOnMessageComplete], '5': null, '6': null, _headers: [], _url: '', socket: [TLSSocket], incoming: [IncomingMessage], outgoing: [Circular 1], maxHeaderPairs: 2000, _consumed: false, onIncoming: [Function: parserOnIncomingClient], joinDuplicateHeaders: undefined, [Symbol(resource_symbol)]: [HTTPClientAsyncResource] }, maxHeadersCount: null, reusedSocket: false, host: 'mmg.whatsapp.net', protocol: 'https:', _redirectable: Writable { _events: [Object], _writableState: [WritableState], _maxListeners: undefined, _options: [Object], _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _eventsCount: 3, _onNativeResponse: [Function (anonymous)], _currentRequest: [Circular 1], _currentUrl: 'https://mmg.whatsapp.net/', [Symbol(shapeMode)]: true, [Symbol(kCapture)]: false }, [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kChunkedBuffer)]: [], [Symbol(kChunkedLength)]: 0, [Symbol(kSocket)]: TLSSocket { _tlsOptions: [Object], _secureEstablished: true, _securePending: false, _newSessionPending: false, _controlReleased: true, secureConnecting: false, _SNICallback: null, servername: 'mmg.whatsapp.net', alpnProtocol: false, authorized: true, authorizationError: null, encrypted: true, _events: [Object: null prototype], _eventsCount: 11, connecting: false, _hadError: false, _parent: null, _host: 'mmg.whatsapp.net', _closeAfterHandlingError: false, _readableState: [ReadableState], _writableState: [WritableState], allowHalfOpen: false, _maxListeners: undefined, _sockname: null, _pendingData: null, _pendingEncoding: '', server: undefined, _server: null, ssl: [TLSWrap], _requestCert: true, _rejectUnauthorized: true, timeout: 5000, parser: [HTTPParser], _httpMessage: [Circular 1], [Symbol(alpncallback)]: null, [Symbol(res)]: [TLSWrap], [Symbol(verified)]: true, [Symbol(pendingSession)]: null, [Symbol(async_id_symbol)]: 120786, [Symbol(kHandle)]: [TLSWrap], [Symbol(lastWriteQueueSize)]: 0, [Symbol(timeout)]: [Timeout], [Symbol(kBuffer)]: null, [Symbol(kBufferCb)]: null, [Symbol(kBufferGen)]: null, [Symbol(shapeMode)]: true, [Symbol(kCapture)]: false, [Symbol(kSetNoDelay)]: false, [Symbol(kSetKeepAlive)]: true, [Symbol(kSetKeepAliveInitialDelay)]: 60, [Symbol(kBytesRead)]: 0, [Symbol(kBytesWritten)]: 0, [Symbol(connect-options)]: [Object] }, [Symbol(kOutHeaders)]: [Object: null prototype] { accept: [Array], origin: [Array], 'user-agent': [Array], 'accept-encoding': [Array], host: [Array] }, [Symbol(errored)]: null, [Symbol(kHighWaterMark)]: 16384, [Symbol(kRejectNonStandardBodyWrites)]: false, [Symbol(kUniqueHeaders)]: null }, response: { status: 400, statusText: 'Bad Request', headers: Object [AxiosHeaders] { 'content-type': 'text/html; charset=utf-8', 'access-control-allow-origin': '', 'proxy-status': 'proxy_internal_response; e_fb_configversion="AcKM6MftkmgzVAP6fo4cXnzOk8hse6C1JG8WzDxTYYok-zZhgoFXRzLbTa3IjQ"; e_isproxyerr="AcIa1UXr8aPJV7-yXLwu1Ic6LL61SKoEVKPdOUUbnwjp5vt--l9kseuaSoaYig"; e_clientaddr="AcJaeJ2QsoTYfixsELHOdHT6lUXdN32HFl3aYR8-tWb8eSTH5BofrQU8CUi1-xgyfrsgixpDqtVIf2jb"; e_fb_vipport="AcInMou1UOLbVSpwLuEj4YaIxA9wkrczBMoYqQ7gHFOQXzazibosDEcO0zuD"; e_fb_requestsequencenumber="AcK89Tl3YLf_GVSpa4PvYUoAJI-72ASXWuS0Q3O_REzcQfys0gyMCOp6ZA"; e_fb_hostheader="AcKRz-SCeKdM8XUtJBlUTR_gkStTVMAgUnviMdvig3BA03aui-THfLpWAkzLS-la14z15dvFGZUcEA"; e_fb_vipaddr="AcKTcTBOeW-Om2_LQxi_hrVitKl0QXXf4mkdir8oaL_IAsGANcgWN-bYa_Fn_16Yihj_jCQO19U"; e_fb_requesthandler="AcL0xr-zDHXbVwOFKOzHMiSSIi14ODzrq8c00xtXPrr43dPhIaM9ZF41kD7y8ltFNUQlrPmSE2aWiVW0sUCZ0L8smrr1"; e_fb_requesttime="AcLNF8TjmVs2MvEAJKE34NfWh6aHx1zl9s6BsKsM7SFffTpTR4mXVUlk18-rrNQBJntCajZxxA"; e_fb_builduser="AcJeUqjd2yTBOCfRwgM7sAqNhfHeRFabjQlluC_XLfb3ZYdZ9xlC2xe3XoVnSih-qKA"; e_fb_httpversion="AcL-DlTfWzzbGaw6zIfJ01EHY0lqadhyAA15gTPWrqXAZGq_065iKLvo9wHK"; e_fb_binaryversion="AcKeTJE6cWIqp7IE6hDgmS7KirVZCzKmc6HMEEnh7E8kkxpS8dC4tv-YQC148G9oTLa-XtdTHJpbCQceajSvjBxIHahwHMfD_6E"; e_proxy="AcLPWIYIFL9j_ItCfgtoAYrg0qGa8pRwqgaGYG1dEuMBN0rHA1lK4kUpZvGuHtXF2YVH7GkQxMz1FAk"', date: 'Mon, 25 Mar 2024 21:25:55 GMT', connection: 'close', 'content-length': '101' }, config: { transitional: [Object], adapter: 'http', transformRequest: [Array], transformResponse: [Array], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: Infinity, maxBodyLength: Infinity, env: [Object], validateStatus: [Function: validateStatus], headers: [Object [AxiosHeaders]], responseType: 'stream', method: 'get', url: 'https://mmg.whatsapp.net', data: undefined }, request: <ref 1> ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, _header: 'GET / HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /*\r\n' + 'Origin: https://web.whatsapp.com\r\n' + 'User-Agent: axios/1.5.0\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: mmg.whatsapp.net\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/', _ended: false, res: [IncomingMessage], aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: [HTTPParser], maxHeadersCount: null, reusedSocket: false, host: 'mmg.whatsapp.net', protocol: 'https:', _redirectable: [Writable], [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kChunkedBuffer)]: [], [Symbol(kChunkedLength)]: 0, [Symbol(kSocket)]: [TLSSocket], [Symbol(kOutHeaders)]: [Object: null prototype], [Symbol(errored)]: null, [Symbol(kHighWaterMark)]: 16384, [Symbol(kRejectNonStandardBodyWrites)]: false, [Symbol(kUniqueHeaders)]: null }, data: IncomingMessage { _events: [Object], _readableState: [ReadableState], _maxListeners: undefined, socket: [TLSSocket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: false, rawHeaders: [Array], rawTrailers: [], joinDuplicateHeaders: undefined, aborted: false, upgrade: false, url: '', method: null, statusCode: 400, statusMessage: 'Bad Request', client: [TLSSocket], _consuming: false, _dumped: false, req: [ClientRequest], _eventsCount: 4, responseUrl: 'https://mmg.whatsapp.net/', redirects: [], [Symbol(shapeMode)]: true, [Symbol(kCapture)]: false, [Symbol(kHeaders)]: [Object], [Symbol(kHeadersCount)]: 12, [Symbol(kTrailers)]: null, [Symbol(kTrailersCount)]: 0 } } }

marciodiasdeveloper commented 3 months ago

+1