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 ?

@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,
