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

[PT][BUG] Typebot

Open S1LV4 opened this issue 2 years ago • 8 comments

Título: Typebot + Evolution

Estou tentando conectar o Evolution, estou configurando tudo certinho, já tentei reinstalar tudo, e nada, da o mesmo erro

Erro:

[Evolution API] v1.6.2 1 - Sun Jan 14 2024 17:51:47 ERROR [TypebotService] [object] AxiosError: connect ETIMEDOUT 181.215.236.236:8071 at AxiosError.from (/evolution/node_modules/axios/dist/node/axios.cjs:837:14) at RedirectableRequest.handleRequestError (/evolution/node_modules/axios/dist/node/axios.cjs:3090:25) at RedirectableRequest.emit (node:events:514:28) at RedirectableRequest.emit (node:domain:488:12) at eventHandlers. (/evolution/node_modules/follow-redirects/index.js:37:24) at ClientRequest.emit (node:events:514:28) at ClientRequest.emit (node:domain:488:12) at Socket.socketErrorListener (node:_http_client:495:9) at Socket.emit (node:events:514:28) at Socket.emit (node:domain:488:12) { port: 8071, address: '181.215.236.236', syscall: 'connect', code: 'ETIMEDOUT', errno: -110, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: Object [AxiosHeaders] { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json', 'User-Agent': 'axios/1.6.5', 'Content-Length': '105', 'Accept-Encoding': 'gzip, compress, deflate, br' }, method: 'post', url: 'http://joaoopsd.com:8071/api/v1/typebots/themis/startChat', data: '{"prefilledVariables":{"remoteJid":"[email protected]","pushName":"Joao","instanceName":"dpe"}}' }, request: <ref *1> Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false, [Symbol(kOnFinished)]: [] }, _events: [Object: null prototype] { response: [Function: handleResponse], error: [Function: handleRequestError], socket: [Function: handleRequestSocket] }, _eventsCount: 3, _maxListeners: undefined, _options: { maxRedirects: 21, maxBodyLength: Infinity, protocol: 'http:', path: '/api/v1/typebots/themis/startChat', method: 'POST', headers: [Object: null prototype], agents: [Object], auth: undefined, family: undefined, beforeRedirect: [Function: dispatchBeforeRedirect], beforeRedirects: [Object], hostname: 'joaoopsd.com', port: '8071', agent: undefined, nativeProtocols: [Object], pathname: '/api/v1/typebots/themis/startChat' }, _ended: false, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 105, _requestBodyBuffers: [ [Object] ], _onNativeResponse: [Function (anonymous)], _currentRequest: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: false, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: '105', _hasBody: true, _trailer: '', finished: false, _headerSent: true, _closed: false, socket: [Socket], _header: 'POST /api/v1/typebots/themis/startChat HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Content-Type: application/json\r\n' + 'User-Agent: axios/1.6.5\r\n' + 'Content-Length: 105\r\n' + 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 'Host: joaoopsd.com:8071\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/api/v1/typebots/themis/startChat', _ended: false, res: null, aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'joaoopsd.com', protocol: 'http:', _redirectable: [Circular *1], [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype], [Symbol(errored)]: null, [Symbol(kHighWaterMark)]: 16384, [Symbol(kRejectNonStandardBodyWrites)]: false, [Symbol(kUniqueHeaders)]: null }, _currentUrl: 'http://joaoopsd.com:8071/api/v1/typebots/themis/startChat', [Symbol(kCapture)]: false }, cause: Error: connect ETIMEDOUT 181.215.236.236:8071 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) { errno: -110, code: 'ETIMEDOUT', syscall: 'connect', address: '181.215.236.236', port: 8071 } }

[Evolution API] v1.6.2 1 - Sun Jan 14 2024 17:51:47 ERROR [TypebotService] [object] TypeError: Cannot read properties of undefined (reading 'messages') at TypebotService. (/evolution/dist/src/whatsapp/services/typebot.service.js:573:72) at Generator.next () at fulfilled (/evolution/dist/src/whatsapp/services/typebot.service.js:5:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Tentativa:

Fiz a requisição direta e funcionou, o que pode esta acontecendo ?

image

S1LV4 avatar Jan 14 '24 20:01 S1LV4

Olá bom dia. Como baixo a versão 1.6.2?

asabocinski avatar Jan 15 '24 11:01 asabocinski

Olá bom dia. Como baixo a versão 1.6.2?

Então mano, tentei em praticamente 3 versões recentes e o erro persiste, respondendo sua pergunta é a versão (Homolog via docker)

S1LV4 avatar Jan 16 '24 05:01 S1LV4

bom dia, estou tendo o mesmo problema, alguém pode ajudar?

guns317 avatar Jan 23 '24 04:01 guns317

Então.. faz um git da branch develop e da um build no docker... coloca no seu dockerhub e ai vai conseguir a versão 1.6.2 eu ja testei e typebot ta funcionando.

asabocinski avatar Jan 23 '24 13:01 asabocinski

EU tbm... Será alguma versão do Typebot (Versão: 2.19.1) ?

1|evolutionapi | [Evolution API] v1.6.1 1659707 - Wed Jan 24 2024 19:49:00 ERROR [TypebotService] [object] 1|evolutionapi | TypeError: Cannot read properties of undefined (reading 'messages') 1|evolutionapi | at TypebotService. (/root/evolution-api/dist/src/whatsapp/services/typebot.service.js:583:72) 1|evolutionapi | at Generator.next () 1|evolutionapi | at fulfilled (/root/evolution-api/dist/src/whatsapp/services/typebot.service.js:5:58) 1|evolutionapi | at processTicksAndRejections (node:internal/process/task_queues:96:5)

jrprado avatar Jan 24 '24 19:01 jrprado

@jrprado

Resolvi o problema da seguinte forma, editei o arquivo conforme o "Pull request", adicionando a linha 277 no arquivo "src/whatsapp/services/typebot.service.js" na versão NPM e fiz o rebuild usando o PM2, não sei como editar o arquivo dentro de uma imagem docker, então fiz a instalação da Evolution usando NPM. Espero que ajude.

Adicione este código no arquivo "src/whatsapp/services/typebot.service.js" na linha 277

responseRowId: msg.listResponseMessage?.singleSelectReply?.selectedRowId,

300126049-76c3cfce-d60d-45fb-a4bc-9cc1db05c0e3

guns317 avatar Jan 27 '24 21:01 guns317

@guns317 o problema que o mano está tendo não é relacionado a sendList ....

Luis-Fernando-Developer avatar Feb 12 '24 00:02 Luis-Fernando-Developer

resolveu. @S1LV4 ?

gbretas avatar Jun 05 '24 21:06 gbretas