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

Chatwoot não recebe as mensagens evolution 1.6

Open MoreiraTv opened this issue 2 years ago • 28 comments

Utilizando chatwoot v3.3.1 Evolution 1.6.0

E mesmo gerando a caixa do chatwoot manual não consigo imitir o qrcode pelo chatwoot, e se tento conectar o qr code pelo manager, ele não recebe as mensagens no chatwoot.

image image

image

MoreiraTv avatar Dec 14 '23 03:12 MoreiraTv

Estranho @MoreiraTv isso está funcionando corretamente! Eu mesmo já estou utilizando em produção.

Já vi acontecer isso quando colocar a / no final do link do chatwoot, ID da conta errada ou ate mesmo o tokem.

matiasduartee avatar Dec 14 '23 10:12 matiasduartee

Verifique se suas credenciais estao corretas e se nao ja tem uma caixa de entrada com mesmo nome da instancia no chatwoot

DavidsonGomes avatar Dec 14 '23 10:12 DavidsonGomes

Eu apaguei todas as caixas de entradas, está zerado, apaguei ate o usuario antigo e criei um novo, estou colocando id do usuario correto, e tbm conferi a api token, testei tanto com / no final do link tanto sem tbm.

MoreiraTv avatar Dec 14 '23 11:12 MoreiraTv

Preciso do log de erro do inbox na evolution, nos logs enviados nao tem essa informação

DavidsonGomes avatar Dec 14 '23 11:12 DavidsonGomes

No logs do container não apareceu nenhum erro, tem alguma outra forma de eu ver logs de erro ? pelo que eu entendi o manager ta retornando oque o chatwoot retornou pra ele, mas como eu estou pedindo para evolution criar a caixa ela tinha que criar primeiro depois buscar, mas ela não esta criando, e dps tenta buscar. Ai tentei criar manual, mas mesmo assim não tem a comunicação de um com outro da sessão.

MoreiraTv avatar Dec 14 '23 11:12 MoreiraTv

dificil ajudar sem saber oq acontece la dentro, faz seguinte comenta o log VERBOSE no seu env, força o erro e manda print dos logs.

DavidsonGomes avatar Dec 14 '23 12:12 DavidsonGomes

Voltei na versão anterior da evolution e estou com mesmo erro:

image

MoreiraTv avatar Dec 14 '23 12:12 MoreiraTv

Ele nao esta encontrando a inbox 9, pode conferir se esse é o id da inbox realmente?

DavidsonGomes avatar Dec 14 '23 12:12 DavidsonGomes

9 é o usuario, ele não encontra inbox pq ela n foi criada, então o erro ta antes dela tentar encontrar, pq nem está sendo criado.

Encontrei mais um erro, quando criei a inbox manual no chatwoot e dps fui no manager registrar:

Como pode ver a inbox existe aqui no insonimia: image

image

image

Ele está dando erro na hora de buscar o contato que gera o qrcode

[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Getting instance name 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [AuthRepository]  [string]  finding auth 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [AuthRepository]  [string]  finding auth in db 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  event whatsapp to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  get client to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  get provider to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Finding chatwoot 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Getting instance name 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootRepository]  [string]  finding chatwoot 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootRepository]  [string]  finding chatwoot in db 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot account id: 9 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot token: FtnepRXJSmzmvLR2Wz7mnRvm 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot url: http://mchat.mcodec.com.br 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot inbox name: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot sign msg: false 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot reopen conversation: true 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot conversation pending: false 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  provider found 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  provider found 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  create client to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  client created 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  event qrcode.updated 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  qrcode success 

[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  temp file name: /evolution/store/temp/[object Object].png 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  create temp file 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  send qrcode to chatwoot 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  create bot qr to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  get client to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  get provider to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Finding chatwoot 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Getting instance name 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootRepository]  [string]  finding chatwoot 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootRepository]  [string]  finding chatwoot in db 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot account id: 9 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot token: `*****************
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot url: http://mchat.mcodec.com.br 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot inbox name: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot sign msg: false 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot reopen conversation: true 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot conversation pending: false 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  provider found 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  provider found 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  create client to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  client created 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  find contact in chatwoot 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  find contact to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  get client to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  get provider to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Finding chatwoot 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Getting instance name 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootRepository]  [string]  finding chatwoot 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootRepository]  [string]  finding chatwoot in db 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot account id: 9 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot token: **************************
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot url: http://mchat.mcodec.com.br 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot inbox name: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot sign msg: false 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot reopen conversation: true 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [WAStartupService]  [string]  Chatwoot conversation pending: false 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  provider found 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  provider found 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  create client to instance: mcodec_novo1 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  client created 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  format phone number 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     VERBOSE   [ChatwootService]  [string]  find contact in chatwoot 
[Evolution API]  v1.6.0  1   -  Thu Dec 14 2023 09:51:38     ERROR   [ChatwootService]  [object]   
ApiError: Not Found
    at catchErrorCodes (/evolution/node_modules/@figuro/chatwoot-sdk/dist/core/request.js:226:15)
    at /evolution/node_modules/@figuro/chatwoot-sdk/dist/core/request.js:257:17
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  url: 'http://mchat.mcodec.com.br/api/v1/accounts/9/contacts/search?q=%2B123456&page=1',
  status: 404,
  statusText: 'Not Found',
  body: '<html>\r\n' +
    '<head><title>404 Not Found</title></head>\r\n' +
    '<body>\r\n' +
    '<center><h1>404 Not Found</h1></center>\r\n' +
    '<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n' +
    '</body>\r\n' +
    '</html>\r\n',

  request: {
    method: 'GET',
    url: '/api/v1/accounts/{account_id}/contacts/search',
    path: { account_id: '9' },
    query: { q: '+123456', sort: undefined, page: 1 },
    errors: { '401': 'Authentication error' }
  }
} 

Está com erro " errors: { '401': 'Authentication error' }" mas conferi o token e esta certo e tbm testei no insomnia com mesmo token e não tive este erro

MoreiraTv avatar Dec 14 '23 12:12 MoreiraTv

Consegui resolver o problema era realmente o chatwoot. Eu tinha um snapshot dele e restaurei e voltou funcionar!

mas minhas mensagens não estão sendo recebidas.

MoreiraTv avatar Dec 14 '23 13:12 MoreiraTv

image image

image

MoreiraTv avatar Dec 14 '23 13:12 MoreiraTv

Utilizando a api antiga recebo a mensagens normalmente.

MoreiraTv avatar Dec 14 '23 15:12 MoreiraTv

@MoreiraTv verifica agora se as configs da sua env estão corretas, mais especificamente a - SERVER_URL= pois se estiver com o link errado ao criar a caixa de entrada automaticamente o webhook será enviado errado para a configuração.

matiasduartee avatar Dec 14 '23 15:12 matiasduartee

Utilizando a api antiga recebo a mensagens normalmente. Tenta mandar aqui sempre o log da api, por exemplo nessa caso de nao receber a mensagem no chatwoot.

matiasduartee avatar Dec 14 '23 15:12 matiasduartee

Sim está correta, e tbm abri as configurações da caixa para conferir, e se tivesse errado acredito que nem consegueria enviar mensagens usando chatwoot e o envio das mensagens funciona, só que para receber não.

MoreiraTv avatar Dec 14 '23 15:12 MoreiraTv

Sim está correto, e tbm abri as configurações da caixa para conferir, e se tivesse errado acreditar que nem conseguiria enviar mensagens usando chatwoot e o envio das mensagens funciona, só que para receber não.

Caramba que estranho, realmente não sei o que pode estar acontecendo no seu projeto. Eu posso dizer por mim aqui, tenho dois cenários, um produção e um de teste e ambos estão com o chatwoot 3.3.1 e a Evolution 1.6.0.

matiasduartee avatar Dec 14 '23 15:12 matiasduartee

EHeh mais coisa ainda pra ficar mais estranho ainda kkkk,

Quando envio midia como, audio ou foto a api recebe, mas quando envio mensagem de texto o api não recebe:

image

Esse é o erro que tenho quando recebo um texto: image

MoreiraTv avatar Dec 14 '23 17:12 MoreiraTv

EHeh mais coisa ainda pra ficar mais estranho ainda kkkk,

Quando envio midia como, audio ou foto a api recebe, mas quando envio mensagem de texto o api não recebe:

image

Esse é o erro que tenho quando recebo um texto: image

Você está usando a versão 3.3.1 do chatwoot? Vi que você voltou snapshot então acredito que seja uma versão anterior. Pela mensagem de erro acredito que seja problema entre sua versão do cw e a versão 1.6 da evo. Se possível use a versão 3.3.1 do cw.

jaison-x avatar Dec 14 '23 18:12 jaison-x

Realmente volotu para 3.2.0, mas isso faria mensagem parar de funcionar e manter midias funcionando ?

MoreiraTv avatar Dec 14 '23 18:12 MoreiraTv

Subi outra instancia com 3.3.1 funcionou amigo, vlw, mas o de vocês estão pegando o reply e os reactions ? o meu não está

MoreiraTv avatar Dec 14 '23 18:12 MoreiraTv