Timed out-IMAP Email

Hi Team,

I got the error “Timed out while connecting to server” using node IMAP Email.
How can i have have this sorted?
I’m using Gmail to test.

Welcome to the community.

Not sure what might be happening. The authentication timeout is set to 20 seconds (defaults is 5 seconds). So it should be enough time to connect to the server.

Did you follow the steps here?

Hi @RicardoE105!!

Yes i used that guide to implement it.
I tried connecting to outlook as well and got the same error.
For Gmail i think it’s related with firewall rules because i was not able to perform telnet with sucess. But for outlook i don’t know what’s going on.

Hi @RicardoE105.
Can you help with this issue?
Thanks in advance

Hey @hermanmaleiane!

For Outlook you have to give access to the application. You might have received an email mentioning that they have blocked access to IMAP or something similar. You will have to give access to the app. This is an added layer of security by Outlook.

1 Like

Thank you @harshil1712!!

Hi @harshil1712!!!

Now i have this!! It’s processing since long time.
I don’t know what’s going on there.

Logs extracted

(node:128) UnhandledPromiseRejectionWarning: Error: Command Error. 10
at Connection._resTagged (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Connection.js:1502:11)
at Parser. (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Connection.js:194:10)
at Parser.emit (events.js:315:20)
at Parser._resTagged (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Parser.js:175:10)
at Parser._parse (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Parser.js:139:16)
at Parser._tryread (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Parser.js:82:15)
at Socket.Parser.cbReadable (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Parser.js:53:12)
at Socket.emit (events.js:315:20)
at emitReadable
at processTicksAndRejections (internal/process/task_queues.js:79:21)
(Use node --trace-warnings ... to show where the warning was created)
(node:128) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:128) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
throw er; // Unhandled ‘error’ event
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:209:20)
Emitted ‘error’ event on ImapSimple instance at:
at Connection. (/usr/local/lib/node_modules/n8n/node_modules/imap-simple/lib/imapSimple.js:39:14)
at Connection.emit (events.js:315:20)
at Socket._onError (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Connection.js:151:10)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -104,
syscall: ‘read’,
source: ‘socket’

Hey @hermanmaleiane!

Looks like it is not able to connect. May I know how are you running n8n? I will test it with an Outlook account and keep you posted :slight_smile:

Hi @harshil1712!!

I running n8n using docker.
Please check the docker-compose file.

Hey @hermanmaleiane!

It works for me. @krynble can probably help out here :slight_smile:

HI @harshil1712.
Thank you for your support.
Now i don’t have errors but it keeps processing the node for long time and never finish.

Hello @hermanmaleiane

When you execute the node manually it will wait until a new message arrives. Only then it finishes execution.

You should not have issues if you activate the workflow so that it runs on the background.

Regarding the connection errors you had, this is something we are looking into. The problem is that we’re unable to simulate the error locally.

@harshil1712 if you find a way to reproduce the issues locally please let me know!


Thank you @harshil1712 and @krynble.
I have manage to overcome it.
It’s working.

1 Like

That’s awesome!

Have fun :tada:

Awesome @hermanmaleiane

Glad it worked!