IMAP Email Node No Longer Triggering Workflow

Hi @Jon,

If it helps, this weekend and since the update of n8n to version 0.197.0, 0.197.1 and 0.198.2 the Imap Trigger node causes in the installation the error Connection Lost in the frontend, that the container restarts continuously and in the log appears the following error:

Oct 17 16:11:24 Loading configuration overwrites from:
Oct 17 16:11:24 - /app/data/configs/default.json
Oct 17 16:11:24
Oct 17 16:11:26 => Started
Oct 17 16:11:26
Oct 17 16:11:26 Editor is now accessible via:
Oct 17 16:11:26 http://localhost:5678/
Oct 17 16:11:26
Oct 17 16:11:26 Manual executions will be visible only for the owner
Oct 17 16:11:26
Oct 17 16:11:26 Press "o" to open in Browser.
Oct 17 16:11:34 /app/code/node_modules/utf8/utf8.js:131
Oct 17 16:11:34 throw Error('Invalid continuation byte');
Oct 17 16:11:34 ^
Oct 17 16:11:34
Oct 17 16:11:34 Error: Invalid continuation byte
Oct 17 16:11:34 at readContinuationByte (/app/code/node_modules/utf8/utf8.js:131:9)
Oct 17 16:11:34 at decodeSymbol (/app/code/node_modules/utf8/utf8.js:184:12)
Oct 17 16:11:34 at Object.utf8decode [as decode] (/app/code/node_modules/utf8/utf8.js:206:17)
Oct 17 16:11:34 at /app/code/node_modules/imap-simple/lib/imapSimple.js:222:50
Oct 17 16:11:34 at processTicksAndRejections (node:internal/process/task_queues:96:5)
Oct 17 16:11:35 => Ensure directories
Oct 17 16:11:35 => Loading configuration
Oct 17 16:11:35 => Setting permissions
Oct 17 16:11:35 => Starting N8N
Oct 17 16:11:36
Oct 17 16:11:36 Loading configuration overwrites from:
Oct 17 16:11:36 - /app/data/configs/default.json

This happens when the workflow containing that node is active. When the workflow is deactivated or the node is not active within the workflow, the application works normally.

Hi @Jon @MutedJam ,

We are facing the exact same issue as well, and it’s effecting some of our customers.
Can you please let us know if we have any update on the fix of this issue ? or is there any work around to get the node working ?
Also, if it helps, during our testing, we noticed below error while facing this issue:

(node:36) UnhandledPromiseRejectionWarning: Error: Got 0 parts, should get 1
    at /data/packages/nodes-base/node_modules/imap-simple/lib/imapSimple.js:206:28
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) 

Hope it helps in debugging.

Really Looking forward to hear back on this, thanks.

Hey @Shahtaj_Khalid,

Can you try upgrading to the latest release? We put a fix out that should solve most of the issues now.

@martinhache @JUVOJustin @pbdco @MortgageRockstar

Updated 1 day after release and since then i did not have any issues. I set the authentication interval to 5 mins.

To clarify: The issues appeard mostly when the mailserver whent down for maintenance, so the server closed the connection. Because of the “bug” reconnecting did not work as supposed.

For me this can be considered as solved with the changes you made :slight_smile:

1 Like

@Jon That’s great, can you please point towards the exact release it’s fixed in ? we’re not completely in sync with n8n’s releases that’s why need to know about the release so we can sync our node with that release.

Thanks.

Hey @Shahtaj_Khalid,

The fix is in 0.200.0

1 Like

@Jon Can you please help me understand what changes have we made to fix this issue ? I was trying to compare the changes between release 0.199.0 (n8n/EmailReadImap.node.ts at [email protected] · n8n-io/n8n · GitHub) with the recent changes from release 0.200.0 (V1) (Comparing [email protected]@0.200.0 · n8n-io/n8n · GitHub)

And I couldn’t find any difference ? We implemented the connection related changes from 0.199.0 and after it we still faced the issue. Now I’m unable to identify the difference among these releases, if you can point it out, it’ll really help.

Thanks.

Hey @Shahtaj_Khalid,

I take it you are not using our shipped node and your own version of it then?

The commit for the changes is this one: fix(Email Trigger (IMAP) Node): improve connection handling and crede… · n8n-io/n8n@1a37f00 · GitHub

3 Likes

Just adding to this thread as the IMAP node that had been working for a while (silently) stopped working. Not sure if it was after the latest update or not.
Using 0.201.0.
Temp Fix was - Make the Workflow inactive and activate again and it worked.
Will upgrade to 0.202.0 and see what happens

Old post, but just FYI @Jon @MortgageRockstar I can confirm this issue with SMTP node has been solved in Version 0.200.1 and later.
My workflow containing the SMTP trigger node has been running stable without issues after this update for several months now.

Thanks guys!

1 Like

I’m glad it’s working for you @pbdco.

It was working for me for awhile, but it unfortunately has not been working for me again for some time. I’m unsure of the issue other than the IMAP node reads the email and marks it read, but does not execute the flow (does not appear in the execution log either).

Hello @Jon
I have consistently had the problem with the IMAP trigger since I started using n8n. As others describe here, the access to the mailbox works. The email is marked as read. However, the trigger is not fired in n8n. I installed the latest version 0.218.0 today. No matter what I do, it does not work. Can anyone tell me why?

Hey @Markus08,

Welcome to the community :tada:

We did an update to the node a few versions back which has fixed this for most cases and we only mark the email as read once we have processed it. It could be worth deleting the node from your workflow and adding it again just so that it uses the v2 node and see if that makes any difference.

1 Like

I did. Now it works. Thank you very much. :slight_smile:

3 Likes

I did delete the node and added it again and now it starts firing OK, just it fires the error workflow even more often then getting the trigger. The error workflow is not getting any data and runs, even though no workflow is getting executed.

What version of n8n are you running? It could be worth enabling debug logging to see if there is any extra data coming out of the node that could be useful.

I am on 0.217.1. What do I need to do to enable debug logging? I have a docker installation.

Hey @Martin_Neumann,

You can find the information on that in the link below. Although I have just realised there is no other information about your issue in this thread.

It might be worth opening a new topic and completing the template and include information and screenshots about what you are currently seeing along with which mail service you are using.

Hi, I’m a new user on n8n.io and loving it!

I’m also running into this bug. I’m running 0.222.0 in Docker and if I run this workflow manually it works ok but then if I let it run itself it seems to just mark the emails as read an go no further (and no execution logged). The email I’m checking is with gmail. This issue seems to be going on a couple of years now, has there been any solution found ?

Hey @McPhisto,

Welcome to the community :tada:

The email should be marked as read once we have finished processing it which would suggest you may be using an older workflow or the v1 email node. Can you add the IMAP node again to your workflow and see if that gets it running?

Can you also share some details on how you have n8n running and configured? I have had a local instance running for about 6 months now with the IMAP trigger node and have not had any issues so far, I am aware of a few community members seeing issues but we also have a lot of users that are not reporting issues with it so I am going to need all of the information I can get so we can work on trying to reproduce this and get it fixed.