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

Investigate ECONNRESET issue during "zipdeploy" call #2844

Closed
ejizba opened this issue Jun 8, 2021 · 46 comments
Closed

Investigate ECONNRESET issue during "zipdeploy" call #2844

ejizba opened this issue Jun 8, 2021 · 46 comments

Comments

@ejizba
Copy link
Member

ejizba commented Jun 8, 2021

Creating this issue as a catch-all for the "ECONNRESET" errors being reported specifically for the "zipdeloy" call. Usually a retry helps fix these errors, but it's possible our retry logic isn't working in this case because it's using a stream to send the zip file and I don't know if we handle restarting the stream on a retry.

It's also possible this could be caused by especially large zip files or especially slow internet.

Update April 13, 2022

The 1.66.0 VS Code update resulted in many users encountering ECONNRESET and 400 Bad Request errors when attempting to deploy their app. A fix has been released in version v1.6.2 of the extension. (comment)

@blomm
Copy link

blomm commented Nov 19, 2021

just tried 1.6, and it's still the case for me that any version 1.3.0 or greater fails with this error, so I'll stick to the version just before 1.3.0, 1.2.1 where it works just fine.

@miszu
Copy link

miszu commented Dec 22, 2021

I'm experiencing the same (I think) issues as @blomm - deploy of TypeScript Azure Functions project does not work from VS Code with v1.6 (ECONNRESET), works fine after downgrading to 1.2.1. Let me know if I could provide more info for the investigation

@transcendent
Copy link

Had the exact same issue and downgrading the Azure functions extension resolved it. Note that I had a whole bunch of issues deploying via Github actions which is why I moved to doing the deployment through the extension instead. My function app is quite large (~10 individual functions).

@nturinski
Copy link
Member

The only change between v1.3.0 and v1.2.1 that I can see that would impact the ECONNRESET error is right here: microsoft/vscode-azuretools@c6d587c#diff-193b27d62e4fbda3d563009fed5ec6761a05f73558d94b39fab63ae948c679eaR38

Between versions, we updated the vscode-azureappservice package from 0.72.1 to 0.73.0:
5de6996#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R1130

The only change between those versions is updating the ui package:
microsoft/vscode-azuretools@9c15e6f

Where we updated ms-rest-js
microsoft/vscode-azuretools@c6d587c

So seems like we should start our investigation from there. 🔍

@cek-cek
Copy link

cek-cek commented Mar 31, 2022

Ran into the issue yesterday after updating VS Code (I update frequently, so that it worked before should not have been caused by using some outdated version). Suddenly all TypeScript deployments got stuck just after the zip is created (Zip package size: X MB in the output) and eventually time out with ECONNRESET error for url https://xxx.scm.azurewebsites.net/api/zipdeploy?isAsync=true&author=VS Code.

I've tried everything from reinstalling Core Tools, rebooting, using different app service plan and waiting several hours (as I've read ECONNRESET in Azure is usually only transient issue), but only thing that makes this work again is downgrading to the previously mentioned year old release 1.2.1, where the zip creation is immediately followed by output Fetching changes. and eventually successfully completes.

@sven5
Copy link

sven5 commented Mar 31, 2022

Same issue here. After today's update of VSCode (March 2022) the Logic Apps deployment doesn't work anymore.

@blomm
Copy link

blomm commented Mar 31, 2022

can we treat this issue seriously yet @ejizba?
I'm still scared to perform any upgrades around the Azure Functions extension, sticking to 1.2.1

@cek-cek
Copy link

cek-cek commented Mar 31, 2022

One more problem with the v1.2.1 workaround - turns out this does not accept ~4 as a functions target version, only ~1 - ~3, which effectively constraints to use manual CLI publish if you need to target ~4.

@aLucaz
Copy link

aLucaz commented Mar 31, 2022

Same error using VSCode 1.66.0

@cek-cek
Copy link

cek-cek commented Mar 31, 2022

I've captured the problematic request and did a little comparison. It seems, that while the old 1.2.1 version provides Content-Length and the actual file content, the 1.6.1 request issues a chunk request, without any body - maybe that's where the server hangs waiting for the first chunk. The non-working request does not make it into Kudu traces at /api/vfs/LogFiles/kudu/.

image

@ejizba
Copy link
Member Author

ejizba commented Mar 31, 2022

Based on the number of comments within several hours, I'm guessing this is a new issue related to the release of VS Code 1.66. Does it reproduce if you use the previous version of VS Code? I checked the release notes and the only thing I saw that could be related is they bumped from Node.js v14 to v16.

I'm not on this particular team anymore, but hopefully @nturinski @alexweininger or @bwateratmsft could take a look relatively soon.

@sven5 the logic apps extension is a different extension/team - you'll have to follow up with them separately.

@alexweininger
Copy link
Member

Users created an issue on VS Code: microsoft/vscode#146470

I'm able to reproduce the issue on 1.67.0-insider.

VS Code version details
Version: 1.67.0-insider (Universal)
Commit: 909602cf04e0fa42528d692676d0d4e15e67bba2
Date: 2022-03-31T11:04:00.413Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Darwin x64 21.4.0

I agree that this seems to be related to the 1.66.0 VS Code release due to the timing of the issue reports. Further backed up by comments saying zip deploy worked again after reverting to 1.65.2.

As for the issue itself, I'm not immediately sure how upgrading from Node.JS v14 to v16 could break zip deploy, but we'll investigate. 🕵️

@ShawnMcGough
Copy link

Also having this issue.

Could be from VSCode Azure SDK for Node.js - App Service Tools.

Which appears to silently failing unit tests? I'm not sure, but those look like errors from the log, yet reporting successful test cases. Which maybe why it wasn't caught pre-release.

Should an issue be opened on the Azure SDK for Node.js repo?

@aLucaz
Copy link

aLucaz commented Apr 1, 2022

An alternative if someone is looking for another option (using Azure Functions Core Tools (4.x or later) and Azure CLI (2.4 or later)):

#!/bin/bash
# $1 => folder or file name to be zipped
# $2 => function app name
# $3 => resource group name
echo "Starting deployment..."
ZIP_NAME=`date "+%Y%m%d%H%M%S.zip"`
echo "Changing directory to $1/"
cd $1
echo "Creating zip package"
zip -r ${ZIP_NAME} . --exclude @.funcignore --exclude .funcignore > /dev/null 2>&1
echo "Zip created"
az functionapp deployment source config-zip -n $2 -g $3 --src ${ZIP_NAME}
rm ${ZIP_NAME}
echo "Zip removed"

open to suggestions

@eshy
Copy link

eshy commented Apr 2, 2022

Was having the same issue. Reverting to 16.5.2 did solve it

@klodha
Copy link

klodha commented Apr 4, 2022

Same issue, VS Code updated to March 2022 release and suddenly deployments stopped. All I see in logs was creating a zip file and then after long wait an error to call zipdeploy API. Tried all options but eventually downgrading to 1.65 helped.

Not sure what is the root issue, but there is something breaking between the two releases when it comes to Azure functions.

@dangater
Copy link

dangater commented Apr 4, 2022

This issue has been plaguing me for days but downgrading VS Code to 1.65.2 solved it instantly.

@cutty201
Copy link

cutty201 commented Apr 5, 2022

I can't believe it -- I search internet -- and you kind people are right -- the new update broke all this -- I couldnt even get LocalGit to work right . Thanks for the downgrade suggestion - its working again for me

@paladin2005
Copy link

They updated vscode and it is fixed for me now
Not sure, as current version (including the latest Insider build) of VS code doesn't work. Only option for now is to downgrade VS Code to 1.65.x.

I don't know why to downvote me, I am telling you I had that problem too, VScode updated and start working, and my client was waiting for some changes.
in my case, I couldn't deploy the "publish" folder in my backend and the "dist" folder on my frontend, it was getting stuck when creating the zip file to publish. I saw an update and tried again and it worked again.
Was this update: Vscode 1.66.1

@gleysonlf
Copy link

They updated vscode and it is fixed for me now
Not sure, as current version (including the latest Insider build) of VS code doesn't work. Only option for now is to downgrade VS Code to 1.65.x.

I don't know why to downvote me, I am telling you I had that problem too, VScode updated and start working, and my client was waiting for some changes. in my case, I couldn't deploy the "publish" folder in my backend and the "dist" folder on my frontend, it was getting stuck when creating the zip file to publish. I saw an update and tried again and it worked again. Was this update: Vscode 1.66.1

It didn't work for me:

VS Code: 1.66.1
Azure App Service: 0.23.1
Azure Functions: 1.6.1

It worked was to downgrade to VS Code 1.65.2

@klodha
Copy link

klodha commented Apr 11, 2022

@paladin2005 Understood. There seems to be some misunderstanding due to language gaps perhaps.

Do you want to say that: your VSCode also got updated to 1.66 and you started working on some changes which client asked. But when you tried to upload, it failed.

If that is the part with "update", you are absolutely correct. Everyone started facing the problem with this update to version 1.66.

Only solution which worked for others (and most likely for you also) is to downgrade to 1.65 release of VSCode.

@rdeveen
Copy link

rdeveen commented Apr 11, 2022

Alternative one-line deployment use func azure functionapp publish <FunctionAppName>

See: https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cwindows%2Ccsharp%2Cportal%2Cbash#project-file-deployment

@alexweininger
Copy link
Member

alexweininger commented Apr 11, 2022

Hi everyone,

I believe to have found a fix. If anyone can help verify the fix for me that would be a big help!

Steps to install extension development build:

  1. If needed, update VS Code to 1.66.0 or greater.
  2. Download the extension .VSIX from our Azure DevOps Pipeline - Direct download link | View artifacts
  3. Extract the .vsix file from the .zip folder
  4. From the command palette (F1 or Command/Ctrl + Shift + P), run the "Extensions: Install from VSIX..." command.
  5. Select the downloaded .vsix file, then reload VS Code as prompted.
  6. Navigate to the extensions view and verify the version is 1.6.2-alpha
    Screen Shot 2022-04-12 at 12 19 33 PM

Once installed, attempt to deploy your app as normal. Report back and let us know if deployment succeeded/failed.

Thanks!

@klodha
Copy link

klodha commented Apr 12, 2022

Thanks @alexweininger, I will give it a try in few minutes.

@chazix
Copy link

chazix commented Apr 12, 2022

@alexweininger - I just tried here, installed v1.6.2-alpha from the vsix on v1.66.0 vscode. I received the same error unfortunately: 1:55:34 AM: Error: request to https://project-name.scm.azurewebsites.net/api/zipdeploy?isAsync=true&author=VS%20Code failed, reason: read ECONNRESET

Downgrading to v1.65.2 vscode resolves temporarily, as mentioned by others

@alexweininger
Copy link
Member

@chazix thanks for taking the time to verify. Could you try again with the updated steps? Thanks!

@klodha
Copy link

klodha commented Apr 13, 2022

Thanks @alexweininger, I will give it a try in few minutes.

@alexweininger, I tried using updated plugin (Zip package size: 4.96 MB) and it seems to be working 🎉 I would say a bit slower though (but that could be some network glitch or due to plugin being alpha).

I have included my plugin configuration and VS Code version details here.

image

image

I am happy that you finally found the fix 👍🏻. Looking forward for some technical details about the same (for learning) as well general release of this update for the plugin.

@tommyhtran
Copy link

@alexweininger
I can confirm v1.6.2-alpha works.
image

@stefano-8wave
Copy link

Hi everyone,

I believe to have found a fix. If anyone can help verify the fix for me that would be a big help!

Steps to install extension development build:

  1. If needed, update VS Code to 1.66.0 or greater.
  2. Download the extension .VSIX from our Azure DevOps Pipeline - Direct download link | View artifacts
  3. Extract the .vsix file from the .zip folder
  4. From the command palette (F1 or Command/Ctrl + Shift + P), run the "Extensions: Install from VSIX..." command.
  5. Select the downloaded .vsix file, then reload VS Code as prompted.
  6. Navigate to the extensions view and verify the version is 1.6.2-alpha
    Screen Shot 2022-04-12 at 12 19 33 PM

Once installed, attempt to deploy your app as normal. Report back and let us know if deployment succeeded/failed.

Thanks!

I can confirm, with version 1.6.2-alpha works!

@alexweininger
Copy link
Member

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

Huge thank you to everyone who helped verify the fix! ❤️

@klawrawkz
Copy link

Hi, my name is klawrawkz. I am fine. How are you?

It's not fixed for me. Nope. Not at all.

Hi ho, hi ho, it's off to work I go...

Tryin to get some work done...
image

La, la, la, ... tryin to get some work done...
image

Hmm, mmm, mmm, ...tryin to get some work done...
image

I'm not in the error biznizz, so this is no fun, my babe, no fun....

@alexweininger, what am I missing here?

Hope you are well.

klaw

@ghost
Copy link

ghost commented Apr 27, 2022

I get the same error when deploying Logic Apps Standard.
This does not appear to have been resolved.
image

How can I get the same error when deploying from VSCode and using

@tommyhtran
Copy link

@alexweininger,
klawrawkz and masakawa527 seem to be having a problem with the Azure Logic Apps (Standard) extension. I recommend closing this issue as it's resolved for the Azure Functions extension.

@klawrawkz
Copy link

klawrawkz commented May 10, 2022

All,

Regarding @masakawa527's suggestion, I think it would be premature to close this issue unless it is demonstrated and proven conclusively that this "logic" issue/bug is not related to the this "the original function extension" issue/bug (#2844 ). It is my understanding that "logic apps" depend on the "function app" extension. It seems reasonable to suggest that this error is not isolated in the "logic" extension, but perhaps originates from the function portion of the two codependent extensions. What say you?

It is also important to preserve this thread because of the relationship between logic and function extensions. If this issue is closed, is there an open issue specific to "logic apps" related to this?

@MicroFish91 MicroFish91 unpinned this issue May 11, 2022
@blomm
Copy link

blomm commented Jun 9, 2022

1.7.3 just released, somehow my VS code extension automatically upgraded me to this.
Still doesn't deploy, "socket hang up" this time, I've reinstalled old trusty version 1.2.1

@esdccs1
Copy link

esdccs1 commented Jun 13, 2022

I had this issue while trying to publish a logic app...

vscode 1.68
vscode-azurefunction version 1.7.3

I ended up targeting my log app via the command line instead (Since I figure this is what the vscode extension is doing behind the scenes)

# holding host.json, connections.json and all the workflow.json folders 
cd root_logic_app_folder     
func azure functionapp publish my-logic-app-name-resource     
# where this name is the logic app in your resource group   

@nturinski
Copy link
Member

Hi @klawrawkz. Regarding this statement:

It is my understanding that "logic apps" depend on the "function app" extension.

This is actually not correct. A long time ago, the Logic Apps extension cloned the Functions Apps extension and then continued to build their extension from there. That means any fixes in Functions does not automatically get picked up by Logic Apps.

This was fixed in the package @microsoft/vscode-azext-azureappservice in v0.6.2. The Logics Apps extension didn't update that package until June. But now that it is updated, this issue hasn't been reported so I will close this as fixed.

@nturinski nturinski unpinned this issue Jan 12, 2023
@microsoft microsoft locked and limited conversation to collaborators Feb 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests