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
(internal/streams/readable.js:569:12)
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 Command-line API | Node.js v17.8.0 Documentation). (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.
events.js:292
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,
code: ‘ECONNRESET’,
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.
image

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!

2 Likes

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!

Hi Folks!

I’m facing a similar issue.

This message appears when I run my Read IMAP node: “ERROR: Timed out while connecting to server”

What I don’t understand’s that the exact same workflow with the exact same credentials works on the n8n version that runs on my computer (I’m currently moving it to our server).

Would you know why it doesn’t works when I run it on the server?

Thanks!

Hey @Anthony73370,

Welcome to the community :tada:

My first guess would be that maybe there is a different network policy in place for the server. When you run it on your computer are you using Desktop, A container or NPM?

1 Like

Hey @Jon !

Thank you! :raised_hands:

I use the desktop version! Does it gives you a more precise idea of the origin of the issue?

I’m lost :joy:

Hey @Anthony73370,

Are you using the desktop version on the server as well? When you run the workflow on the server is manual or is it saved and activated?

1 Like

I do use the NPM version on the server, sorry!

Well, I try to run the workflow manually to test it and that’s when the error occurs.

I tried to activate it crashes with the same error message: “ERROR: Timed out while connecting to server”.

It’s saved but no way to bypass the error to activate the workflow