vscode: Deployment to Azure Function Fails with reason: read ECONNRESET

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

  • VS Code Version: 1.66.0
  • OS Version: Windows 10

Steps to Reproduce:

  1. Attempt to deploy to an Azure Function using Azure Function extension fails with the error “reason: read ECONNRESET”
  2. I downgraded VSCode to version 1.65.2 and the deployment started working again
  3. I have disabled automatic updates for the time being.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 12
  • Comments: 34 (18 by maintainers)

Most upvoted comments

Just to update on the progress, the azure extension team is working on a minimal repro with Nodejs to see if there is already a fix in newer versions that can be backported and at the same time identify the commit which caused this behavior change.

It is still failing with version 1.66.2.

Important for testing - if the zip file is ~10 kB or less, it works. Make sure your test cases are larger than 10 kB or you’ll get false successes.

Fails when > 10kB

4:51:13 PM function-test: Starting deployment...
4:51:14 PM function-test: Creating zip package...
4:51:14 PM function-test: Zip package size: 10.7 kB
4:52:01 PM: Error: request to /api/zipdeploy?isAsync=true&author=VS%20Code failed, reason: read ECONNRESET

Success when < 10kB

4:52:13 PM function-test: Starting deployment...
4:52:14 PM function-test: Creating zip package...
4:52:14 PM function-test: Zip package size: 9.91 kB
...
4:52:21 PM function-test: Deployment successful.

Version

Version: 1.66.2 (user setup)
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:46:01.075Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Windows_NT x64 10.0.19042

I grabbed the latest Insiders build and it seems to still be on Electron v17, so does not have the needed fix yet as I understand. It needed an update to v18 right?

Sorry for the confusion, the electron build numbers don’t change, backports have been made to the same version. What would change in these cases is process.versions["microsoft-build"]

Since it is confirmed that insiders does not fix the issue, I would need to investigate further with E2E setup. I will update here once there is some progress.

I am also experiencing this issue deploying a function app.

Reverting to version 1.65.2 (user setup) fixed the issue.

Fix has been released in version v1.6.2 of the Azure Functions extension. 🎉

@alexweininger yup I am working on the build, will update here once it is available for testing. Thanks for the help!

I am on 1.66.0 and also experience this problem. Installing https://code.visualstudio.com/updates/v1_65 instead solved the problem.

I can confirm that deployment is now working with VS Code v1.66 and Azure Functions Extension v1.6.2. Thank you everyone for your help.

@isidorn yup the issue has been isolated to a third-party module used by the extension whose behavior regressed with some changes to the Nodejs streams component. I have been syncing with @alexweininger offline, we can close this issue as it does not require any work from core and can be addressed on the extension side.

After I downgraded, and tried most of the stuff I found about this issue, that error passed away but now I get the following fail:

Creating virtual environment... 1:22:05 PM boirndextauto: /opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9 -i /tmp/8da1880713886a2 --compress-destination-dir -p virtualenv_name=antenv --log-file /tmp/build-debug.log 1:22:07 PM boirndextauto: Deployment Failed. 1:22:16 PM boirndextauto: Deployment failed.

Do you know why is this?

@LidorPrototype please file a new issue on the Azure Functions extension, thanks!

@deepak1556

I just tried insiders build but that doesn’t seems to address the issue. Same issue of ECONNRESET.

Version: 1.67.0-insider
Commit: f050b17dacedba13962244b13c70084a473d08f7
Date: 2022-04-06T05:26:11.128Z (3 hrs ago)
Electron: 17.3.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Darwin arm64 21.4.0
Error log: 

2:40:55 PM func-sample: Starting deployment...
2:40:58 PM func-sample: Creating zip package...
2:41:02 PM func-sample: Zip package size: 1.34 MB
2:45:42 PM: Error: request to https://func-sample.scm.azurewebsites.net/api/zipdeploy?isAsync=true&author=VS%20Code failed, reason: read ECONNRESET

FYI, A new version of Azure Function Core Tools was released, version 4.0.4426. I did this update and then reinstalled VS Code 1.66.0. This did NOT fix the issue. I still get the same error when trying to deploy to Azure

@jrieken @chrmarti I outlined this in #146577, but will repeat here in case it provides more context to the issue:

I found that setting NODE_DEBUG=stream while debugging the Azure Functions extension somehow fixes the issue. Without NODE_DEBUG=stream, I can reproduce the issue consistently. Any insight?