Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-red-node-email unhelpful connect error #1065

Open
5 tasks done
Rudd-O opened this issue May 8, 2024 · 4 comments
Open
5 tasks done

node-red-node-email unhelpful connect error #1065

Rudd-O opened this issue May 8, 2024 · 4 comments

Comments

@Rudd-O
Copy link

Rudd-O commented May 8, 2024

Which node are you reporting an issue on?

node-red-node-email 2.2.1

What are the steps to reproduce?

Connect to IMAP server, SSL port 993 basic authentication.

What happens?

This used to work fine and now it only gives me "connect error". The error object says this unhelpful thing:

{"error":{"message":"","source":{"id":"c0d86f58da60f25e","type":"e-mail in","name":"Post email","count":1}},"_msgid":"3aeeab65094bc76b"}

What do you expect to happen?

Get email out as it used to work.

Please tell us about your environment:

  • Node-RED version: 3.1.9
  • node.js version: 20.10.0
  • npm version: 10.2.3
  • Platform/OS: Fedora
  • Browser: Firefox
@Rudd-O Rudd-O changed the title node-red-node-email node-red-node-email unhelpful connect error May 8, 2024
@Rudd-O
Copy link
Author

Rudd-O commented May 8, 2024

Adding a console.log here yields me this thing:

May 08 00:16:42 assistant Node-RED[3830233]: Error checking: AggregateError

What the eff is an AggregateError?

@Rudd-O
Copy link
Author

Rudd-O commented May 8, 2024

Stack trace by console.logging the e.stack says:

May 08 00:19:24 assistant Node-RED[3830630]: Stack: AggregateError
May 08 00:19:24 assistant Node-RED[3830630]:     at internalConnectMultiple (node:net:1114:18)
May 08 00:19:24 assistant Node-RED[3830630]:     at internalConnectMultiple (node:net:1177:5)
May 08 00:19:24 assistant Node-RED[3830630]:     at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
May 08 00:19:24 assistant Node-RED[3830630]:     at listOnTimeout (node:internal/timers:575:11)
May 08 00:19:24 assistant Node-RED[3830630]:     at process.processTimers (node:internal/timers:514:7)

There appears to be a zero seconds timeout somewhere, which cannot be controlled through the Node-RED interface.

@Rudd-O
Copy link
Author

Rudd-O commented May 8, 2024

Weird. Logging the tout variable says:

May 08 00:21:54 assistant Node-RED[3831027]: Timeout configured: 15000

That should be plenty milliseconds for the connect to work.

I would like to leave constance of the fact that my e-mail server is not logging any connections from the machine running Node-RED, and that TCP connections work fine:

telnet xxxx.xxxxxx.com 993
Trying 12.234.345.56...
Connected to xxxx.xxxxxx.com.
Escape character is '^]'.
^]quit

telnet> quit
Connection closed.

@Rudd-O
Copy link
Author

Rudd-O commented May 8, 2024

Think I figured it out. My server recently (a few months ago) gained an IPv6 address, but the client machine does not have IPv6 connectivity. For some reason, Node-RED times out connecting to the IPv4 address and still attempts to connect (immediately) to the IPv6 address (perhaps in parallel?). As a result of that, the aggregate error contains two errors:

May 08 00:26:34 assistant Node-RED[3831665]: Error checking: AggregateError
May 08 00:26:34 assistant Node-RED[3831665]: Stack: AggregateError
May 08 00:26:34 assistant Node-RED[3831665]:     at internalConnectMultiple (node:net:1114:18)
May 08 00:26:34 assistant Node-RED[3831665]:     at internalConnectMultiple (node:net:1177:5)
May 08 00:26:34 assistant Node-RED[3831665]:     at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
May 08 00:26:34 assistant Node-RED[3831665]:     at listOnTimeout (node:internal/timers:575:11)
May 08 00:26:34 assistant Node-RED[3831665]:     at process.processTimers (node:internal/timers:514:7)
May 08 00:26:34 assistant Node-RED[3831665]: Errors: Error: connect ETIMEDOUT <IPv4>:993,Error: connect ENETUNREACH <IPv6>:993 - Local (:::0)

Please either fix handling of IPv6 (a good fix would be to ensure if either of the two connection modes works, ignore the other error) or provide an option to force only IPv4 or IPv6 here. I think this defect must be on the imap library that this node uses.

Thanks.

Upstreamed here: mscdex/node-imap#918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant