Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erro ao enviar mensagem. #1834

Open
chagasjoao opened this issue Sep 14, 2023 · 10 comments
Open

Erro ao enviar mensagem. #1834

chagasjoao opened this issue Sep 14, 2023 · 10 comments
Assignees
Labels
bug Something isn't working needs triage

Comments

@chagasjoao
Copy link

Description

Quando tento enviar mensagem, recebo o seguinte erro:
Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing

Recebimento de mensagem continua normal.

Environment

  • WPPConnect version(s): 1.28.0
  • Browser: Chromium 116.0.5845.187
  • OS: Ubuntu 22.04.3 LTS
  • Node version: 18.16

Log Output

Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing

Your Code

const res = await whatsappClient.sendText(contactId, message);

Additional context / Screenshot

Dentro do grupo do discord, encontrei alguns topicos discutindo sobre o mesmo problema, mas sempre foi falado que estava relacionado com a quantidade de requisições que são feitas dentro da instancia, levando ao "travamento".
O problema é: nesse teste que eu estava fazendo, é um chip NOVO e está acontencendo o erro acima com apenas um chat, sugerindo que não possui relação com o volume de mensagens.

@chagasjoao chagasjoao added bug Something isn't working needs triage labels Sep 14, 2023
@thiagoarioli
Copy link

up

@xXDeonoXx
Copy link

Same Issue, any fix ?

@GJakobi
Copy link

GJakobi commented Sep 15, 2023

up

@edgardmessias edgardmessias self-assigned this Sep 15, 2023
@renandecarlo
Copy link
Contributor

Same
7624d58a-e04d-4941-acd8-76bdfb058774

@cardonazio
Copy link

olá ocorreu comigo tmb,
node v18.16.0
Sem título
erro de database
número do chip é antigo, ocorreu isto depois de algum tempo conectado.
/

@antirek
Copy link
Contributor

antirek commented Oct 19, 2023

today I also received this error ))

{
   name: 'InvalidStateError',
   message: "Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.",
   err: Error [InvalidStateError]: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.
       at /usr/src/app/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:107:31
       at step (/usr/src/app/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:49:23)
       at Object.next (/usr/src/app/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:30:53)
       at fulfilled (/usr/src/app/node_modules/@wppconnect-team/wppconnect/dist/api/helpers/evaluate-and-return.js:21:58)
       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
   JS Stack: Error: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.
       at we.create (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:38839)
       at https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:30282
       at https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:15228
       at Le (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:10440)
       at Ye (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:11197)
       at Be (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:11048)
   Function: function (_a) {
                               var to = _a.to, content = _a.content, options = _a.options;
                               return WPP.chat.sendTextMessage(to, content, __assign(__assign({}, options), { waitForAck: true }));
                           } {
     _e: {
       name: 'Error',
       message: '',
       stack: 'Error\n' +
         '    at z (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:4041)\n' +
         '    at new r (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:5569)\n' +
         '    at Me.rejectionMapper (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:56931)\n' +
         '    at Ue (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:9711)\n' +
         '    at Le (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:10613)\n' +
         '    at Ye (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:11197)\n' +
         '    at Be (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:11048)'
     },
     inner: {
       name: 'InvalidStateError',
       message: "Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.",
       stack: "Error: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.\n" +
         '    at we.create (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:38839)\n' +
         '    at https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:30282\n' +
         '    at https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:15228\n' +
         '    at Le (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:10440)\n' +
         '    at Ye (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:11197)\n' +
         '    at Be (https://web.whatsapp.com/vendor1~app.6470964955d882fdfd6f.js:7:11048)'
     }
   }
 }

@chagasjoao
Copy link
Author

@edgardmessias Não sei se ajuda... mas notei que logo após o erro
InvalidStateError: Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.

Eu tentei: fechar o browser (client.close) e iniciar novamente utilizando os mesmo token. E para todas as tentativas, recebo o seguinte erro ao iniciar instancia.

Error: Execution context was destroyed, most likely because of a navigation.
0|wppinstance  |     at rewriteError (/home/ubuntu/monest-backend/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:311:15)
0|wppinstance  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
0|wppinstance  |     at async #evaluate (/home/ubuntu/monest-backend/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:250:60)
0|wppinstance  |     at async ExecutionContext.evaluate (/home/ubuntu/monest-backend/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:149:16)

@chagasjoao
Copy link
Author

@edgardmessias Mais alguns pontos.
Reiniciando a instancia me aparece

statusFind: mia company 3561 browserClose
Using browser folder '/home/ubuntu/monest-backend/apps/whatsapp-instances/tokens/session-3561
0|wppinstance  | http:     [session-3561:client] Checking is logged...
0|wppinstance  | info:     [session-3561:client] Auto close configured to 45s
0|wppinstance  | http:     [session-3561:client] Authenticated
0|wppinstance  | [Nest] 443533  - 10/20/2023, 5:36:47 PM   DEBUG [WhatsappClientService] statusFind: mia company 3561 isLogged

Beleza, teoricamente estariamos loggados... Mas continuando o log ele desconecta.

0|wppinstance  | error:    Unhandled Rejection: Error: Execution context was destroyed, most likely because of a navigation.
0|wppinstance  |     at rewriteError (/home/ubuntu/monest-backend/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:311:15)
0|wppinstance  |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
0|wppinstance  |     at async #evaluate (/home/ubuntu/monest-backend/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:250:60)
0|wppinstance  |     at async ExecutionContext.evaluate (/home/ubuntu/monest-backend/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:149:16)
0|wppinstance  | verbose:  [session-3561:page] Page loaded
0|wppinstance  | verbose:  [session-3561:client] Injecting wapi.js
0|wppinstance  | [Nest] 443533  - 10/20/2023, 5:36:52 PM   DEBUG [WhatsappClientService] statusFind: mia company 3561 desconnectedMobile

Logo depois ele pede o qrCode.

Minha dúvida... será que quando estoura esse erro ele não chama automaticamente um client.logout() ?

@caiodutra08
Copy link

Same issue here. I guess it doesn't exists a way to reconnect to the device when this error occours right?

@wernerpj1
Copy link

Mesmo problema aqui estou usando o wa-js e estou tendo este problema pensei ser por ultrapassar 500mb mas o proprio indexeddb permite mais de 100gb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

10 participants