Giter Club home page Giter Club logo

Comments (26)

Guilherme-j10 avatar Guilherme-j10 commented on June 10, 2024 2

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.

from baileys.

nrbrttth avatar nrbrttth commented on June 10, 2024 1

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

from baileys.

raflyfirdausy avatar raflyfirdausy commented on June 10, 2024

Same issue

from baileys.

3CTec avatar 3CTec commented on June 10, 2024

Same issue

from baileys.

ahlulmukh avatar ahlulmukh commented on June 10, 2024

Same issue

from baileys.

Marcoant007 avatar Marcoant007 commented on June 10, 2024

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.

from baileys.

jefaokpta avatar jefaokpta commented on June 10, 2024

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

this config is not enough ?

from baileys.

juntiapps avatar juntiapps commented on June 10, 2024

hello, any update about this issue?

from baileys.

CleberSilva93 avatar CleberSilva93 commented on June 10, 2024

same issue

from baileys.

juntiapps avatar juntiapps commented on June 10, 2024

, the appli

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

from baileys.

Interspock avatar Interspock commented on June 10, 2024

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?

from baileys.

Guilherme-j10 avatar Guilherme-j10 commented on June 10, 2024

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

from baileys.

Guilherme-j10 avatar Guilherme-j10 commented on June 10, 2024

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

from baileys.

wincodedev avatar wincodedev commented on June 10, 2024

fixed?

from baileys.

vishwajit76 avatar vishwajit76 commented on June 10, 2024

Same issue

from baileys.

Jasermon avatar Jasermon commented on June 10, 2024

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: {}
  }
}

from baileys.

Guilherme-j10 avatar Guilherme-j10 commented on June 10, 2024

up

from baileys.

Jasermon avatar Jasermon commented on June 10, 2024

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,
});

from baileys.

Interspock avatar Interspock commented on June 10, 2024

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

from baileys.

AlbertoGermana avatar AlbertoGermana commented on June 10, 2024

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,
});

from baileys.

luanhduarte avatar luanhduarte commented on June 10, 2024

Any update?
same error

from baileys.

arcanjinha avatar arcanjinha commented on June 10, 2024

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!!

from baileys.

Interspock avatar Interspock commented on June 10, 2024

from baileys.

thipperz avatar thipperz commented on June 10, 2024

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!

from baileys.

roysG avatar roysG commented on June 10, 2024

Same

from baileys.

shanmugaacharan avatar shanmugaacharan commented on June 10, 2024

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: {}
}
}

from baileys.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.