evolution-api icon indicating copy to clipboard operation
evolution-api copied to clipboard

API retornando Connection Closed na versão 2.2.3

Open JonathanLopes404 opened this issue 9 months ago • 10 comments

Welcome!

  • [x] Yes, I have searched for similar issues on GitHub and found none.

What did you do?

Estou enviando requests para a rota chat/whatsappNumbers e para a rota message/sendText

A API às vezes ta retornando sucesso, e às vezes retorna um erro 500 com esse body: {"status":500,"error":"Internal Server Error","response":{"message":"Connection Closed"}}

Quando ele dá esse erro, a instância fica com status connecting por um tempo e depois volta ao normal. Esse erro é temporário. Aparece, depois some, depois volta denovo...

E não é problema no número conectado na instância, a gente fez o teste no whatsapp, o número tava funcionando normalmente

What did you expect?

Resposta com status 200

What did you observe instead of what you expected?

Resposta com erro 500 e com o body: {"status":500,"error":"Internal Server Error","response":{"message":"Connection Closed"}}

Screenshots/Videos

No response

Which version of the API are you using?

2.2.3

What is your environment?

Linux

Other environment specifications

No response

If applicable, paste the log output

2025-03-05T19:37:05.123087074Z [1m[31m[Evolution API][0m [1m[31m [1m[31m v2.2.3 [1m[31m 31 [0m [1m[31m - [1m[37m Wed Mar 05 2025 16:37:05 [0m [31m[41m[1m ERROR [0m [33m[1m [unhandledRejection][0m [31m[1m [object][0m [31m [0m 2025-03-05T19:37:05.123694181Z { 2025-03-05T19:37:05.123714481Z origin: Promise { 2025-03-05T19:37:05.123719381Z Error: Timed Out 2025-03-05T19:37:05.123723681Z at /evolution/node_modules/baileys/lib/Utils/generics.js:170:32 { 2025-03-05T19:37:05.123727581Z data: [Object], 2025-03-05T19:37:05.123730981Z isBoom: true, 2025-03-05T19:37:05.123734381Z isServer: false, 2025-03-05T19:37:05.123737781Z output: [Object] 2025-03-05T19:37:05.123741181Z } 2025-03-05T19:37:05.123744481Z }, 2025-03-05T19:37:05.123747881Z stderr: 2 2025-03-05T19:37:05.123751281Z } 2025-03-05T19:37:05.123754581Z 2025-03-05T19:37:05.123757981Z [1m[31m[Evolution API][0m [1m[31m [1m[31m v2.2.3 [1m[31m 31 [0m [1m[31m - [1m[37m Wed Mar 05 2025 16:37:05 [0m [31m[41m[1m ERROR [0m [33m[1m [unhandledRejection][0m [31m[1m [object][0m [31m [0m 2025-03-05T19:37:05.123781382Z Error: Timed Out 2025-03-05T19:37:05.123785582Z at /evolution/node_modules/baileys/lib/Utils/generics.js:170:32 { 2025-03-05T19:37:05.123789182Z data: { 2025-03-05T19:37:05.123792482Z stack: 'Error\n' + 2025-03-05T19:37:05.123796082Z ' at promiseTimeout (/evolution/node_modules/baileys/lib/Utils/generics.js:165:19)\n' + 2025-03-05T19:37:05.123799782Z ' at waitForMessage (/evolution/node_modules/baileys/lib/Socket/socket.js:117:53)\n' + 2025-03-05T19:37:05.123803282Z ' at query (/evolution/node_modules/baileys/lib/Socket/socket.js:139:22)\n' + 2025-03-05T19:37:05.123806982Z ' at Object.executeUSyncQuery (/evolution/node_modules/baileys/lib/Socket/usync.js:62:30)\n' + 2025-03-05T19:37:05.123810582Z ' at Object.onWhatsApp (/evolution/node_modules/baileys/lib/Socket/chats.js:122:36)\n' + 2025-03-05T19:37:05.123814182Z ' at Rs.whatsappNumber (/evolution/dist/main.js:251:1191)\n' + 2025-03-05T19:37:05.123817682Z ' at async Kt.whatsappNumber (/evolution/dist/main.js:2:7612)\n' + 2025-03-05T19:37:05.123872083Z ' at async Ui.dataValidate (/evolution/dist/main.js:286:62716)\n' + 2025-03-05T19:37:05.123878783Z ' at async /evolution/dist/main.js:286:115236' 2025-03-05T19:37:05.123882383Z }, 2025-03-05T19:37:05.123885783Z isBoom: true, 2025-03-05T19:37:05.123889083Z isServer: false, 2025-03-05T19:37:05.123892583Z output: { 2025-03-05T19:37:05.123895883Z statusCode: 408, 2025-03-05T19:37:05.123899183Z payload: { 2025-03-05T19:37:05.123902583Z statusCode: 408, 2025-03-05T19:37:05.123905983Z error: 'Request Time-out', 2025-03-05T19:37:05.123909383Z message: 'Timed Out' 2025-03-05T19:37:05.123912783Z }, 2025-03-05T19:37:05.123916883Z headers: {} 2025-03-05T19:37:05.123920383Z } 2025-03-05T19:37:05.123923683Z } 2025-03-05T19:37:05.123926983Z

Additional Notes

No response

JonathanLopes404 avatar Mar 05 '25 19:03 JonathanLopes404

I'm also facing this behavior. I have to restart the instance but it doesn't an acceptable solution. In my case using proxy feature, I'm wornder if it is a connection problem

marcogaruthix avatar Mar 06 '25 16:03 marcogaruthix

Também estou tendo esse problema, a conexão cai por um tempo e depois normaliza sozinho. Só que nesse meio tempo dá erro nos meus agentes.

viniciustrndd avatar Mar 12 '25 08:03 viniciustrndd

tambien tengo ese problema

jjose230391 avatar Mar 12 '25 19:03 jjose230391

+1

rafwell avatar Mar 14 '25 14:03 rafwell

también tengo ese problema, alguna solución ?

salomonamiga avatar Mar 30 '25 19:03 salomonamiga

aqui tb...se reiniciar o canal volta.

viniciusverasdossantos avatar Apr 12 '25 06:04 viniciusverasdossantos

Aqui também com esse erro nessa verão 2.2.3

luispimenta avatar Apr 12 '25 12:04 luispimenta

Também tenho esse problema com o chatwoot, as mensagens não são enviadas e o mesmo erro aparece nos logs

brunopq avatar Apr 23 '25 16:04 brunopq

Aqui também com esse erro nessa versão 2.2.3. Voltei para 2.2.2, mesmo assim o erro persiste.

2025-05-03T04:32:35.191031053Z [Evolution API] v2.2.2 185 - Sat May 03 2025 01:32:35 ERROR [unhandledRejection] [object]
2025-05-03T04:32:35.191461955Z Error: Timed Out 2025-05-03T04:32:35.191479589Z at /evolution/node_modules/baileys/lib/Utils/generics.js:170:32 { 2025-05-03T04:32:35.191485339Z data: { 2025-05-03T04:32:35.191490805Z stack: 'Error\n' + 2025-05-03T04:32:35.191496768Z ' at promiseTimeout (/evolution/node_modules/baileys/lib/Utils/generics.js:165:19)\n' + 2025-05-03T04:32:35.191502903Z ' at waitForMessage (/evolution/node_modules/baileys/lib/Socket/socket.js:117:53)\n' + 2025-05-03T04:32:35.191509633Z ' at query (/evolution/node_modules/baileys/lib/Socket/socket.js:139:22)\n' + 2025-05-03T04:32:35.191544703Z ' at Object.executeUSyncQuery (/evolution/node_modules/baileys/lib/Socket/usync.js:62:30)\n' + 2025-05-03T04:32:35.191551054Z ' at Object.onWhatsApp (/evolution/node_modules/baileys/lib/Socket/chats.js:122:36)\n' + 2025-05-03T04:32:35.191557581Z ' at As.whatsappNumber (/evolution/dist/main.js:251:1191)\n' + 2025-05-03T04:32:35.191562741Z ' at async As.sendMessageWithTyping (/evolution/dist/main.js:239:8915)\n' + 2025-05-03T04:32:35.191567889Z ' at async As.textMessage (/evolution/dist/main.js:239:13897)\n' + 2025-05-03T04:32:35.191573069Z ' at async ts.sendText (/evolution/dist/main.js:2:22395)\n' + 2025-05-03T04:32:35.191578275Z ' at async hn.dataValidate (/evolution/dist/main.js:286:62716)' 2025-05-03T04:32:35.191583718Z }, 2025-05-03T04:32:35.191588588Z isBoom: true, 2025-05-03T04:32:35.191593920Z isServer: false, 2025-05-03T04:32:35.191599493Z output: { 2025-05-03T04:32:35.191608274Z statusCode: 408, 2025-05-03T04:32:35.191613344Z payload: { 2025-05-03T04:32:35.191618295Z statusCode: 408, 2025-05-03T04:32:35.191623268Z error: 'Request Time-out', 2025-05-03T04:32:35.191628367Z message: 'Timed Out' 2025-05-03T04:32:35.191633135Z }, 2025-05-03T04:32:35.191638969Z headers: {} 2025-05-03T04:32:35.191643840Z }

SandroAlmeidaDev avatar May 03 '25 04:05 SandroAlmeidaDev

Mesmo erro: {"status":500,"error":"Internal Server Error","response":{"message":"Connection Closed"}

giordano221 avatar May 07 '25 11:05 giordano221

tive esse problema depois de meses usando sem problemas. v2.2.3 (somente uma conexao, sendo que tenho varias ativas) fiz o restart pelo manager e voltou. o que causa isso, alguem sabe?

galdianoo avatar Jul 23 '25 16:07 galdianoo

Alguém solucionou o problema? Estou também na versão v2.2.3 e já tentei algumas possíveis solucoes mas não funcionou.

leonardoakio avatar Jul 29 '25 10:07 leonardoakio

Eu consegui resolver isso, atualizando a versão mais recente

Floryvibla avatar Aug 05 '25 04:08 Floryvibla

Eu consegui resolver isso, atualizando a versão mais recente

Com a versão 2.3.1 ?

luispimenta avatar Aug 05 '25 08:08 luispimenta

A última versão no Docker Hub está sendo a v2.2.3

leonardoakio avatar Aug 05 '25 10:08 leonardoakio

A última versão no Docker Hub está sendo a v2.2.3

Mudou o repositório, já esta na v2.3.1

https://hub.docker.com/r/evoapicloud/evolution-api/tags

luispimenta avatar Aug 05 '25 11:08 luispimenta

Como resolvi o problema no Evolution (Connection Closed de instância ativa):

Segui este processo:

  1. Abrir o WhatsApp Web

  2. Verificar a versão do WhatsApp Web

    • Vá em Configurações > Ajuda.
    • No final da página aparecerá uma informação semelhante a: Versão 2.3000.1026640367
    • Copie apenas os números dessa versão (ex.: 2.3000.1026640367).
  3. Atualizar a stack do Evolution no Portainer

    • Acesse seu painel do Portainer.
    • Vá em Stacks > Evolution > Editor.
    • Procure a variável de ambiente chamada CONFIG_SESSION_PHONE_VERSION.
    • Substitua o valor antigo pelo novo número que você copiou do WhatsApp Web.
  4. Salvar e atualizar a stack

    • Após editar, clique em Deploy the stack para aplicar as alterações.

📌 Resultado: Esse ajuste corrigiu o problema. Todos os números que estavam com falha voltaram a funcionar sem precisar reconectar manualmente.

LucasRobs avatar Sep 03 '25 12:09 LucasRobs