Baileys icon indicating copy to clipboard operation
Baileys copied to clipboard

[Error] -> Timed Out

Open Marcoant007 opened this issue 2 years ago • 34 comments

Hey guys, I don't know if you've already come across this error, but normally when it happens to me I have to scan the qrcode again.

Does anyone know how to fix this error? because it is in the lib itself.

  • Note: I'm already using the new version.

Error: image

Marcoant007 avatar Apr 27 '23 19:04 Marcoant007

Usually this happens after a certain time that the connection is active, this timedout problem really sucks. But basically the way I dealt with it was creating solutions in which when it was not possible to send a message because of timedout I restarted the connection and you don't have to read the qrcode again every time this happens, you can activate the sessions and there it is saved if you stop the code and turn it on again it will not ask to read the qr again.

Guilherme-j10 avatar Apr 28 '23 03:04 Guilherme-j10

@Guilherme-j10 How do you restart the connection exactly? Where to catch this?

nrbrttth avatar Apr 28 '23 07:04 nrbrttth

Same issue

raflyfirdausy avatar May 11 '23 14:05 raflyfirdausy

Same issue

3CTec avatar May 22 '23 17:05 3CTec

Same issue

ahmuq avatar May 25 '23 09:05 ahmuq

Hey everyone, it looks like it's normal for baileys to lose connection to the socket.

Unfortunately, you have to keep trying to perform this reconnection automatically.

A possible approach to solving this error is to use a messaging service, where when the socket does not respond, you leave the message with an error status and when the socket is restarted and responds again, the application will consume this message.

I use this approach and so far it has worked very well.

Marcoant007 avatar Jun 06 '23 19:06 Marcoant007

A question. /** ping-pong interval for WS connection */ keepAliveIntervalMs: number

this config is not enough ?

jefaokpta avatar Jun 19 '23 15:06 jefaokpta

hello, any update about this issue?

juntiapps avatar Jun 26 '23 03:06 juntiapps

same issue

CleberSilva93 avatar Jun 27 '23 01:06 CleberSilva93

, the appli

how to do this btw? I mean, where should i edit?

juntiapps avatar Jun 27 '23 02:06 juntiapps

Same Issue... I guess that using pm2 is a patch that circunvent the problem... but should be a way to solve or at least prevent the program halt, catching this?

Interspock avatar Jul 07 '23 12:07 Interspock

pm2 it just keeps the service running, the timedout itself doesn't stop the service it stays in a freeze state where it's possible to only receive messages but not send them

Guilherme-j10 avatar Jul 07 '23 14:07 Guilherme-j10

this problem is a bit annoying to tell the truth and any way to solve it is inefficient from the point of view that when the connection is being restarted and a message is received it will not be saved. Anyway inconsistencies will be generated

Guilherme-j10 avatar Jul 07 '23 14:07 Guilherme-j10

fixed?

wincodedev avatar Jul 18 '23 01:07 wincodedev

Same issue

vishwajit76 avatar Jul 18 '23 04:07 vishwajit76

same

.../node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:136
            .then(() => reject(new boom_1.Boom('Timed Out', {
                               ^

Error: Timed Out
    at .../@whiskeysockets/baileys/lib/Utils/generics.js:136:32 {
  data: {
    stack: 'Error\n' +
      '    at promiseTimeout (.../node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:131:19)\n' +
      '    at waitForMessage (.../node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:114:53)\n' +
      '    at query (.../node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:136:22)\n' +
      '    at groupQuery (.../node_modules/@whiskeysockets/baileys/lib/Socket/groups.js:12:55)\n' +
      '    at groupMetadata (.../node_modules/@whiskeysockets/baileys/lib/Socket/groups.js:22:30)\n' +
      '    at .../node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:288:47\n' +
      '    at .../node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:291:23\n' +
      '    at Object.transaction (.../node_modules/@whiskeysockets/baileys/lib/Utils/auth-utils.js:136:32)\n' +
      '    at relayMessage (.../node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:278:30)\n' +
      '    at Object.sendMessage (.../node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:649:23)'
  },
  isBoom: true,
  isServer: false,
  output: {
    statusCode: 408,
    payload: {
      statusCode: 408,
      error: 'Request Time-out',
      message: 'Timed Out'
    },
    headers: {}
  }
}

Kepron avatar Sep 20 '23 16:09 Kepron

up

Guilherme-j10 avatar Sep 21 '23 13:09 Guilherme-j10

Guys i think i found a solution. My project was giving this error after 2 days. 3 days passed and there was no problem. I just added the following:

defaultQueryTimeoutMs: undefined,

Here is my full code:

sock = makeWASocket({
  printQRInTerminal: true,
  auth: state,
  logger: log({ level: "silent" }),
  browser: Browsers.macOS("Desktop"),
  syncFullHistory: false,
  /** Default timeout for queries, undefined for no timeout */
  defaultQueryTimeoutMs: undefined,
});

Kepron avatar Sep 25 '23 03:09 Kepron

I live with this issue. Just PM2 do the job of restarting the process everytime it exits. I'll check the undefined thing, sounds weird

Interspock avatar Sep 25 '23 11:09 Interspock

Has anyone tried Jasermon's solution and can confirm that it solves the problem?

Guys i think i found a solution. My project was giving this error after 2 days. 3 days passed and there was no problem. I just added the following:

defaultQueryTimeoutMs: undefined,

Here is my full code:

sock = makeWASocket({
  printQRInTerminal: true,
  auth: state,
  logger: log({ level: "silent" }),
  browser: Browsers.macOS("Desktop"),
  syncFullHistory: false,
  /** Default timeout for queries, undefined for no timeout */
  defaultQueryTimeoutMs: undefined,
});

AlbertoGermana avatar Oct 19 '23 12:10 AlbertoGermana

Any update? same error

luanhduarte avatar Nov 06 '23 20:11 luanhduarte

Alguém já tentou a solução do Jasermon e pode confirmar que ela resolve o problema?

Pessoal, acho que encontrei uma solução. Meu projeto estava apresentando esse erro após 2 dias. 3 dias se passaram e não houve problema. Acabei de adicionar o seguinte: defaultQueryTimeoutMs: undefined, Aqui está meu código completo:

sock = makeWASocket({
  printQRInTerminal: true,
  auth: state,
  logger: log({ level: "silent" }),
  browser: Browsers.macOS("Desktop"),
  syncFullHistory: false,
  /** Default timeout for queries, undefined for no timeout */
  defaultQueryTimeoutMs: undefined,
});

Eu utilizei mas deu foi erro!!

arcanjinha avatar Nov 21 '23 13:11 arcanjinha

Desistí de que funcione sin que de Timeout. Lo uso con PM2 y listo

El mar, 21 nov 2023 a las 10:56, arcanjinha @.***>) escribió:

Alguém já tentou a solução do Jasermon e pode confirmar que ela resolve o problema?

Pessoal, acho que encontrei uma solução. Meu projeto estava apresentando esse erro após 2 dias. 3 dias se passaram e não houve problema. Acabei de adicionar o seguinte: defaultQueryTimeoutMs: undefined, Aqui está meu código completo:

sock = makeWASocket({ printQRInTerminal: true, auth: state, logger: log({ level: "silent" }), browser: Browsers.macOS("Desktop"), syncFullHistory: false, /** Default timeout for queries, undefined for no timeout */ defaultQueryTimeoutMs: undefined, });

Eu utilizei mas deu foi erro!!

— Reply to this email directly, view it on GitHub https://github.com/WhiskeySockets/Baileys/issues/34#issuecomment-1820973739, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3Y4CEDCZ2QYNFJJKCSWDTYFSXJDAVCNFSM6AAAAAAXOJSAIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRQHE3TGNZTHE . You are receiving this because you commented.Message ID: @.***>

--

Claudio Falaschini

Interspock avatar Nov 21 '23 14:11 Interspock

Hello everyone,

I had this issue for a couple days, in my case, the problem was that I should NOT add a "+" at the start of the jid.

So, instead of '[email protected]' it should be '[email protected]'

Hope this helps someone!

thipperz avatar Feb 14 '24 16:02 thipperz

Same

roysG avatar Mar 26 '24 04:03 roysG

I got the same error. There is any solution for it. .../node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:136 .then(() => reject(new boom_1.Boom('Timed Out', { ^

Error: Timed Out at .../@whiskeysockets/baileys/lib/Utils/generics.js:136:32 { data: { stack: 'Error\n' + ' at promiseTimeout (.../node_modules/@whiskeysockets/baileys/lib/Utils/generics.js:131:19)\n' + ' at waitForMessage (.../node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:114:53)\n' + ' at query (.../node_modules/@whiskeysockets/baileys/lib/Socket/socket.js:136:22)\n' + ' at groupQuery (.../node_modules/@whiskeysockets/baileys/lib/Socket/groups.js:12:55)\n' + ' at groupMetadata (.../node_modules/@whiskeysockets/baileys/lib/Socket/groups.js:22:30)\n' + ' at .../node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:288:47\n' + ' at .../node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:291:23\n' + ' at Object.transaction (.../node_modules/@whiskeysockets/baileys/lib/Utils/auth-utils.js:136:32)\n' + ' at relayMessage (.../node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:278:30)\n' + ' at Object.sendMessage (.../node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js:649:23)' }, isBoom: true, isServer: false, output: { statusCode: 408, payload: { statusCode: 408, error: 'Request Time-out', message: 'Timed Out' }, headers: {} } }

shanmugaacharan avatar Apr 30 '24 12:04 shanmugaacharan

I am also facing same issue , any fix available ?

rajdeep74 avatar Jun 28 '24 15:06 rajdeep74

Hello everyone,

I had this issue for a couple days, in my case, the problem was that I should NOT add a "+" at the start of the jid.

So, instead of '[email protected]' it should be '[email protected]'

Hope this helps someone!

Sorry, I don't understand. Where exactly are these JIDs being defined? In my case, I don’t need to perform any actions for this issue to occur after some time running.

That said, while it's possible to partially "fix" this issue by restarting the process when it exits, I find this approach unattractive. We could potentially miss events while it’s rebooting and logging in again.

rodrigogs avatar Jul 13 '24 23:07 rodrigogs