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

ECONNRESET at TLSWrap.onStreamRead issue impacting Azure extensions zip deploy (related to Node v16?) #146577

Closed
alexweininger opened this issue Apr 1, 2022 · 5 comments
Assignees

Comments

@alexweininger
Copy link
Member

Does this issue occur when all extensions are disabled?: No

  • VS Code Version: VS Code 1.66.0
  • OS Version: macOS 12.3 Monterey

The zip deploy feature present in the Azure Functions and Azure App Service extension broke in production as a result of the 1.66.0 VS Code release. It does not reproduce on 1.65.2.

The zip deploy feature uses the yazl package to create a .zip archive of app files and then sends a POST request streaming the archive. The code related to archiving lives here.

On version 1.66.0, the following error is thrown after initiating the POST request.
Error: read ECONNRESET\n at TLSWrap.onStreamRead (node:internal/stream_base_commons:220:20)\n at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17)

We're able to reproduce the issue consistently. During our investigation, we noticed that launching the extension with NODE_DEBUG=stream fixes the issue and allows for a successful zip deploy. This is really strange to me and any insight into why this might be happening is greatly appreciated. Does anyone know of specific changes to the Node.JS stream module, and how they could be effecting this?

We know that VS Code has upgraded from Node.JS v14 to v16 in 1.66.0. And suspect that this upgrade is related to this issue. Were there any other changes that could be impacting this?

Steps to Reproduce:

Use the Azure Functions or Azure App Service extensions and use the Zip Deploy method of deploying to an app.

Related issues:
#146470
microsoft/vscode-azurefunctions#2844
microsoft/vscode-azureappservice#2191

@faceoffers28
Copy link

faceoffers28 commented Apr 1, 2022

Same here. ng-version = 16.14.2 & VSC - About - Node.js = 16.13.0. #146470 (comment)

@Flarna
Copy link

Flarna commented Apr 1, 2022

There were quite some changes in node between 14 and 16. I remember at least nodejs/node#33035 which caused problems in Hapi.

FWIW upload fails for me with 1.65.2 if I set NODE_DEBUG=stream. Just now I was able to upload with 1.66 without setting anything (once).

Best guess here is that this is a timing issue. Maybe server ends connection fast for some reason and depending on node version, debug logging this connection reset arrives earlier or later on client side and is ignored in some cases but not in others.

@alexweininger
Copy link
Member Author

FWIW upload fails for me with 1.65.2 if I set NODE_DEBUG=stream. Just now I was able to upload with 1.66 without setting anything (once).

Are you debugging the extension from source? Or running VS Code with NODE_DEBUG=stream?

Best guess here is that this is a timing issue. Maybe server ends connection fast for some reason and depending on node version, debug logging this connection reset arrives earlier or later on client side and is ignored in some cases but not in others.

We are thinking along those lines as well. Hasn't been easy to pin down. Thank you for pointing me to nodejs/node#33035, I will look into that.

@Flarna
Copy link

Flarna commented Apr 1, 2022

I executed VS Code with NODE_DEBUG=stream (tried also NODE_DEBUG=http) as I have no idea how to execute the individual commands issued by the extension.

@deepak1556
Copy link
Collaborator

Merging to #146470, please subscribe to that issue for updates.

@github-actions github-actions bot locked and limited conversation to collaborators May 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants