EvolutionAPI / evolution-api

Evolution API is an open-source WhatsApp integration API
https://evolution-api.com
GNU General Public License v3.0
921 stars 482 forks source link

[PT][BUG] Problema na conexão do Chatwoot 3.7.0 com a Evolution 1.7.1 / 1.7.2 #533

Closed MariaIsabelli closed 3 weeks ago

MariaIsabelli commented 2 months ago

Título: Problema na conexão do Chatwoot 3.7.0 com a Evolution 1.7.1 / 1.7.2

Descrição:

Estou com o seguinte problema, toda vez que tento conectar o chatwoot 3.7.0 com a evolution 1.7.1 ou a 1.7.2 me retorna um erro 500 de servidor, como o abaixo:

{ "status": 500, "error": "Internal Server Error", "response": { "message": "Internal Server Error" } } Screenshot from 2024-04-16 14-21-47

Fui verificar um logs e tive o seguinte logs da Evolution:

{ origin: Promise {

TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) } O erro basicamente diz que o arquivo whatsapp.service.js contém um erro no código, indica que há uma tentativa de acessar a propriedade 'host' de um objeto que é indefinido, resultando em um erro de tipo indefinido,whatsapp.service.js na linha 527. Estou usando tudo no docker compose, chatwoot e evolution numa kvm.
jaison-x commented 2 months ago

Está usando localProxy? Pelo que vi pode ser isso. Se for tente desabilitar para ver se pode ser isso.

MariaIsabelli commented 2 months ago

@jaison-x retirei, mas ainda sigo com os mesmos logs:

origin: Promise {

TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) } [Evolution API] v1.7.2 1 - Wed Apr 17 2024 09:36:44 ERROR [unhandledRejection] [object] { origin: Promise { TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) } (node:1) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode on September 8, 2024 and reach end-of-support on September 8, 2025. Please migrate your code to use AWS SDK for JavaScript (v3). For more information, check blog post at https://a.co/cUPnyil (Use `node --trace-warnings ...` to show where the warning was created) [Evolution API] v1.7.2 1 - Wed Apr 17 2024 09:43:51 ERROR [unhandledRejection] [object] { origin: Promise { TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) } [Evolution API] v1.7.2 1 - Wed Apr 17 2024 09:43:51 ERROR [unhandledRejection] [object] { origin: Promise { TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) } (node:1) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode on September 8, 2024 and reach end-of-support on September 8, 2025. Please migrate your code to use AWS SDK for JavaScript (v3). For more information, check blog post at https://a.co/cUPnyil (Use `node --trace-warnings ...` to show where the warning was created) [Evolution API] v1.7.2 1 - Wed Apr 17 2024 09:45:10 ERROR [unhandledRejection] [object] { origin: Promise { TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) } [Evolution API] v1.7.2 1 - Wed Apr 17 2024 09:45:10 ERROR [unhandledRejection] [object] { origin: Promise { TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'host') at BaileysStartupService. (/evolution/dist/src/api/services/whatsapp.service.js:527:71) at Generator.next () at fulfilled (/evolution/dist/src/api/services/whatsapp.service.js:5:58) }
jaison-x commented 2 months ago

Eu vi que tiveram commits para ajustar isso. Parece ter sido realmente um bugh. Tente usar a versão develop. Deve corrigir este problema.

MariaIsabelli commented 2 months ago

@jaison-x okey, obrigada irei tentar sim. ;-)

MariaIsabelli commented 2 months ago

GET Screenshot from 2024-04-17 11-57-29

POST Screenshot from 2024-04-17 11-57-56

jaison-x commented 2 months ago

Você usou a develop? Foi feito merge de duas PR uns minutos atras. Consegue enviar os logs para vermos o erro que deu?

MariaIsabelli commented 2 months ago

Sim, atualizei, agora ele está criando a caixa no chatwoot, no entanto não é posivel enviar nem receber as mensagens por lá, e qianda da erro 500 ao fazer a conexão.

tenho o seguinte log: (node:1) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode on September 8, 2024 and reach end-of-support on September 8, 2025. Please migrate your code to use AWS SDK for JavaScript (v3). For more information, check blog post at https://a.co/cUPnyil (Use node --trace-warnings ... to show where the warning was created) [Evolution API] v1.7.3 1 - Wed Apr 17 2024 13:33:45 ERROR [ChatwootService] [object]
ApiError: Internal Server Error 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: 'https://chat.kangoo.digital/api/v1/accounts/15/conversations', status: 500, statusText: 'Internal Server Error', body: { status: 500, error: 'Internal Server Error' },  request: { method: 'POST', url: '/api/v1/accounts/{account_id}/conversations', path: { account_id: '15' }, body: { contact_id: '535', inbox_id: '25' }, errors: { '403': 'Access denied' } } } (node:1) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode on September 8, 2024 and reach end-of-support on September 8, 2025. Please migrate your code to use AWS SDK for JavaScript (v3). For more information, check blog post at https://a.co/cUPnyil (Use node --trace-warnings ... to show where the warning was created)

MariaIsabelli commented 2 months ago

(node:1) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode on September 8, 2024 and reach end-of-support on September 8, 2025. Please migrate your code to use AWS SDK for JavaScript (v3). For more information, check blog post at https://a.co/cUPnyil (Use node --trace-warnings ... to show where the warning was created) [Evolution API] v1.7.3 1 - Thu Apr 18 2024 09:45:06 ERROR [unhandledRejection] [object]
{ origin: Promise {

TypeError: Cannot read properties of undefined (reading 'forEach') at /evolution/dist/src/api/services/whatsapp/whatsapp.baileys.service.js:649:26 },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'forEach') at /evolution/dist/src/api/services/whatsapp/whatsapp.baileys.service.js:649:26 } [Evolution API] v1.7.3 1 - Thu Apr 18 2024 09:45:06 ERROR [unhandledRejection] [object] { origin: Promise { TypeError: Cannot read properties of undefined (reading 'forEach') at /evolution/dist/src/api/services/whatsapp/whatsapp.baileys.service.js:649:26 },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'forEach') at /evolution/dist/src/api/services/whatsapp/whatsapp.baileys.service.js:649:26 }
MariaIsabelli commented 2 months ago

(node:1) NOTE: The AWS SDK for JavaScript (v2) will enter maintenance mode on September 8, 2024 and reach end-of-support on September 8, 2025. Please migrate your code to use AWS SDK for JavaScript (v3). For more information, check blog post at https://a.co/cUPnyil (Use node --trace-warnings ... to show where the warning was created) [Evolution API] v1.7.3 1 - Thu Apr 18 2024 09:48:23 ERROR [unhandledRejection] [object]
{ origin: Promise {

TypeError: Cannot read properties of undefined (reading 'forEach') at /evolution/dist/src/api/services/whatsapp/whatsapp.baileys.service.js:649:26 },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'forEach') at /evolution/dist/src/api/services/whatsapp/whatsapp.baileys.service.js:649:26 } [Evolution API] v1.7.3 1 - Thu Apr 18 2024 09:48:24 ERROR [unhandledRejection] [object] { origin: Promise { TypeError: Cannot read properties of undefined (reading 'forEach') at /evolution/dist/src/api/services/whatsapp/whatsapp.baileys.service.js:649:26 },  stderr: 2, error: TypeError: Cannot read properties of undefined (reading 'forEach') at /evolution/dist/src/api/services/whatsapp/whatsapp.baileys.service.js:649:26 } [Evolution API] v1.7.3 1 - Thu Apr 18 2024 09:51:18 ERROR [ChatwootService] [object] ApiError: Internal Server Error 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: 'https://chat.kangoo.digital/api/v1/accounts/15/conversations', status: 500, statusText: 'Internal Server Error', body: { status: 500, error: 'Internal Server Error' },  request: { method: 'POST', url: '/api/v1/accounts/{account_id}/conversations', path: { account_id: '15' }, body: { contact_id: '536', inbox_id: '28' }, errors: { '403': 'Access denied' } } }
SMolizini commented 2 months ago

Conseguiu alguma solução? Estou com o mesmo problema.

MariaIsabelli commented 2 months ago

@SMolizini ainda não consegui resolver, você teve já algum avanço?

jaison-x commented 2 months ago

@SMolizini ainda não consegui resolver, você teve já algum avanço?

Utilizem a versão 1.7.3. Ela tem correção para alguns problemas da nova versão do CW.

SMolizini commented 2 months ago

Também não obtive nenhum progresso, mas estou com um outro erro também: { "status": 401, "error": "Internal Server Error", "response": { "message": "Unauthorized" } }

@SMolizini ainda não consegui resolver, você teve já algum avanço?

MariaIsabelli commented 2 months ago

@SMolizini tive esse problema tbm, estou atulizando o evo para 1.7.3 eo CW para 3.8.0 para ver aqui...

SMolizini commented 2 months ago

@MariaIsabelli Se conseguir, me avise :)

possebon commented 2 weeks ago

Também não obtive nenhum progresso, mas estou com um outro erro também: { "status": 401, "error": "Internal Server Error", "response": { "message": "Unauthorized" } }

@SMolizini ainda não consegui resolver, você teve já algum avanço?

Está usando o nginx proxy manager ou o nginx como proxy reverso? Se sim, você precisa adicionar na configuração do seu host do Chatwoot:

server {
    ...
    location / {
        ...
        underscores_in_headers on;
    }
}
JuniorArruda commented 6 days ago

Também não obtive nenhum progresso, mas estou com um outro erro também: { "status": 401, "error": "Internal Server Error", "response": { "message": "Unauthorized" } }

@SMolizini ainda não consegui resolver, você teve já algum avanço?

Está usando o nginx proxy manager ou o nginx como proxy reverso? Se sim, você precisa adicionar na configuração do seu host do Chatwoot:

server {
    ...
    location / {
        ...
        underscores_in_headers on;
    }
}

Estava com mesmo problema, essa foi a solução. Uso o nginx como proxy reverso.

Obs. correção do local onde a linha underscores_in_headers on; deve ficar.

`>server {

... location / { ... } underscores_in_headers on; }`