Skip to content

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

Closed

Description

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

Activity

  1. faceoffers28 commented on Apr 1, 2022

    @faceoffers28

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

  2. Flarna commented on Apr 1, 2022

    @Flarna

    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.

  3. alexweininger commented on Apr 1, 2022

    @alexweininger
    MemberAuthor

    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.

  4. Flarna commented on Apr 1, 2022

    @Flarna

    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.

  5. deepak1556 commented on Apr 4, 2022

    @deepak1556
    Collaborator

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

  6. locked and limited conversation to collaborators on May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions