node-red / node-red/node-red-nodes

email-in node crashed node-red

Open
#1,130 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
13h 57m
Merged PRs (30d)
3

Description

Which node are you reporting and issue on?

This only happened once, so I'm sorry it's hard to reproduce.
I have a mail-in node, configured like this:

Image

One time (I might have been on a dodgy internet connection on a train), node-red crashed with this error message:

[red] Uncaught Exception:
17 Apr 09:29:41 - [error] TypeError: Cannot read properties of undefined (reading 'type')
    at Parser.<anonymous> (/Users/andysc/.node-red/node_modules/node-red-node-email/node_modules/imap/lib/Connection.js:227:29)
    at Parser.emit (node:events:519:28)
    at Parser._resContinue (/Users/andysc/.node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:296:8)
    at Parser._parse (/Users/andysc/.node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:141:16)
    at Parser._tryread (/Users/andysc/.node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:82:15)
    at Parser._cbReadable (/Users/andysc/.node-red/node_modules/node-red-node-email/node_modules/imap/lib/Parser.js:53:12)
    at TLSSocket.emit (node:events:519:28)
    at emitReadable_ (node:internal/streams/readable:834:12)
    at onEofChunk (node:internal/streams/readable:812:5)
    at readableAddChunkPushByteMode (node:internal/streams/readable:466:5)
    at Readable.push (node:internal/streams/readable:392:5)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:231:12)
    at Socket.ondata (node:internal/js_stream_socket:79:22)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
What are the steps to reproduce?

As mentioned, hard to reproduce - it only happened once - but it was fetching whilst on an iffy wifi connection.

What happens?

Node-red crashed with an uncaught exception.

What did you expect to happen?

Error conditions to be handled gracefully and node-red to continue running.

Example flow

email-in node, configured as shown above, linked to a debug node.

Environment
  • Node-RED version: 4.1.0
  • Node.js version: v22.19.0
  • npm version: 11.6.0
  • Platform/OS: Mac/OS
  • Browser: Safari

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining node-red-node-email's email-in node and the referenced imap files, node_modules/node-red-node-email/node_modules/imap/lib/Connection.js and Parser.js. Investigate the uncaught exception under interrupted or unreliable connections, then verify that the email-in node handles the error without crashing Node-RED and that the existing flow behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.