Connection Errors since 0.112.0

Hello,

since 0.112.0 we have experiencing connection errors to login.microsoft.com.
Same problems persist with 0.113.0. Though there are no issues with 0.111.0

To reproduce the error … it appears every second time when trying to reauthenticate with Oauth2 credentials (for example Microsoft Outlook API or basic OAUTH2)

The logs show this information


2021-03-29T11:21:21.864+03:00	at TLSSocket.onError (/usr/local/lib/node_modules/n8n/node_modules/popsicle-transport-http/dist/index.js:589:35)

2021-03-29T11:21:21.864+03:00	at Object.onceWrapper (events.js:422:26)

2021-03-29T11:21:21.864+03:00	at TLSSocket.emit (events.js:315:20)

2021-03-29T11:21:21.864+03:00	at emitErrorNT (internal/streams/destroy.js:106:8)

2021-03-29T11:21:21.864+03:00	at emitErrorCloseNT (internal/streams/destroy.js:74:3)

2021-03-29T11:21:21.864+03:00	at processTicksAndRejections (internal/process/task_queues.js:80:21)

2021-03-29T11:21:21.864+03:00	(node:6) 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: 3)

What changed?

Hey @Rugia!

There were no changes made to the nodes. Did you try with new credentials?

Hey,

I’ve tried credentials from two different tenants and two different Client ID’s (Azure applications). Same issues persist :frowning:

So downgrading solves the issue? Because then maybe an underlying library changed.

Yes @jan downgrading to 0.111.0 and below solves the issue.
Upgrading to 0.112.0 or 0.113.0 reproduces the issue.

This is quite weird. The Outlook node is working just fine for me with 0.112.0.

Sorry for the slow response… but it’s actually weird because I can reproduce it on two independent installations (docker on-prem and aws ECS).

To reproduce the timeout I’m initiating re-auth / connect.

And every second time I get Timeout
image

So far I understand I’m the only one that is experiencing this kind of problems? :expressionless:

I’ve done some research and it seems that popsicle-transport-http has changed on 2021.03.16 to version 1.1.3 (before n8n 0.112.0 version) https://www.npmjs.com/package/popsicle-transport-http?activeTab=versions

Is it possible to change the popsicle-transport-http module version after n8n deployment?

Hi guys @jan, @RicardoE105, @harshil1712 .

Just wanted to inform you that I’ve created issue in popsicle-transport-http
It seems that the bug was found and was fixed in latest popsicle release!! So I’m waiting for new n8n release to test it out :slight_smile:

P.S.: Before fixing there was one comment though about n8n and I feel the need to share it. Maybe it’s still important.

Ok, I looked through the n8n code and the primary issue appears to be async functions being used but the errors aren’t handled: n8n/packages/cli/src/Server.ts at f4916c7efbff6ec4f76fb7cd948e3ad7f13ac821 · n8n-io/n8n · GitHub. That results in any requests timing out if something fails. Would recommend you bring this issue up with them while I keep looking into why you have TLS issues every second request on the latest release. I would recommend something like GitHub - blakeembrey/async-middleware: Wrap an asynchronous middleware (or handler) function for Express, Connect, router, etc. with express until express has native promise support built in.

1 Like

I’ve been having issues with the Outlook node timing out randomly after updating to a recent version (0.100 => 0.116.1) too, don’t know if it’s the same issue though. I have two Outlook nodes in a workflow and only one of them works successfully but the other one throws an error.

image

Good job with the debugging!

Seems to be the same problem, so you have two options:

  • downgrade to 0.111.0 (and wait with me to see if with the 0.118.0 release everything is back to normal)
  • change node retry settings (although this workaround extends the whole workflow execution time)
    image
1 Like

Update to 0.118.0 (or later)

0.118.0 contains newest popsicle-transport-http 1.1.4 release and the timeouts are gone!

1 Like

Great to hear that it got resolved on the popsicle side.