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

Failed to Deploy Function App Code - Extension V1.6.1 #3094

Closed
BaronSparky opened this issue Apr 1, 2022 · 14 comments
Closed

Failed to Deploy Function App Code - Extension V1.6.1 #3094

BaronSparky opened this issue Apr 1, 2022 · 14 comments

Comments

@BaronSparky
Copy link

OS: Windows 11 Enterprise
Build Version: 10.0.22000
Function Core Tools: v3/4
Regression: Previous release

Repro Steps:

  • Open a previously working PowerShell Azure Function app code
  • Attempt to re-deploy code using the Azure Function extension - "Deploy to Function App"

Expect:
The previous function app ZIP code to be re/deployed

Actual:
Fail to redeploy function app code

OUTPUT LOG:

10:37:38 func-m365: Starting deployment...
10:37:39 func-m365: Creating zip package...
10:37:39 func-m365: Zip package size: 54.9 kB
10:42:17: Error: request to https://func-m365.scm.azurewebsites.net/api/zipdeploy?isAsync=true&author=VS%20Code failed, reason: read ECONNRESET

More Info:
This issue appeared in an environment I have been using for about 12 months and started on the 2022-03-24 which co-incides with V1.6.1 of the extension.
This was the last successful message in the "Deployments" folder from a deployment on the 2022-03-23

2022-03-23T17:52:51.890Z - Updating submodules.
2022-03-23T17:52:52.423Z - Preparing deployment for commit id '17ad008132'.
2022-03-23T17:52:53.942Z - Skipping build. Project type: Run-From-Zip
2022-03-23T17:52:55.168Z - Skipping post build. Project type: Run-From-Zip
2022-03-23T17:52:55.418Z - Triggering recycle (preview mode disabled).
2022-03-23T17:52:55.871Z - Deployment successful.

I get the same error though, when trying to deploy the code to a new function app "+ Create new Function App in Azure..."

@BaronSparky
Copy link
Author

I do note that signing out and then back into Azure in VS Code fixes the issue.

@BaronSparky
Copy link
Author

BaronSparky commented Apr 1, 2022

I spoke too soon. It has started happening again with 1.6.1

I downgraded the extension to 1.6.0. Signed out of Azure then redeployed sucessfully.

Updated th extension to 1.6.1 and then the issue returned.

@BaronSparky BaronSparky reopened this Apr 1, 2022
@elgorkad
Copy link

elgorkad commented Apr 3, 2022

same issue here vsc v1.66 azure function extension v1.6.1

however, downgraded to azure function extension v1.6.0 and still hanging

if its helpful, output says it has created zip file...

1:56:30 PM xxx: Starting deployment...
1:56:31 PM xxx: Creating zip package...
1:56:33 PM xxx: Zip package size: 1.48 MB

@klodha
Copy link

klodha commented Apr 4, 2022

Same issue here. Solution which worked for me was to downgrade VS Code to January update and then it worked fine.

@kamilkulik
Copy link

Same issue with VSCODE 1.66 and Azure Functions 1.61. After downgrading Azure Functions to 1.6 and VSCODE to 1.65 resolved the issue. To double check, I've re-updated Azure Functions extension to version 1.61 (latest). Deployment still works. The only difference between my setup when deployment didn't work and now that it works is VSCODE version.

My project's configuration:

Zip package size: 489 kB
NodeJS runtime
Consumption plan
Operating System: Windows
Runtime version: 3.5.2.0

@klodha
Copy link

klodha commented Apr 4, 2022

Confirmed this on another setup also. Core issue seems to be VSCODE update. Rolling back to previous version works fine.

Is there any workaround to manual upload zip (for or via CLI) without creating a service account?

@karyn3864
Copy link

I am also running into this issue. I'll try rolling back to previous version.

@klodha
Copy link

klodha commented Apr 4, 2022

I also tried Insider version of VSCode on macOS. That doesn't seems to work either. So as of now only working options is to rollback to VS Code 1.65.x builds. I am confused, why VSCode update is crashing plugin on deploy stage.

@nturinski
Copy link
Member

nturinski commented Apr 4, 2022

The title mentions the extension version, but it seems like this is related to this issue: #2844 where it's actually VS Code upgrading to Node V16 that is causing the issue.

We are currently investigating this issue, but for now the workaround is unfortunately to downgrade to any 1.65.x build of VS Code. We're very sorry for the inconvenience.

@klodha
Copy link

klodha commented Apr 5, 2022

Thanks @nturinski. I don't think anyone originally suspected VSCode upgrade being the root cause. But as we spent more time looking into possible solutions, figured that its not extension but the VSCode upgrade. Downgrading for now works 👍

Probably its high time to switch to NodeJS 16 globally, as many components in toolchains are already. VSCode upgrade also issues some security issues (not major one this time, but probably there will be another release in next 20-25 days).

It would be interesting to know more about this compatibility issue and underlying reasons for learning purpose. Meanwhile I have left comments on some of other GitHub issues having same problem and linked them with this one as duplicate.

@alexweininger
Copy link
Member

@klodha

It would be interesting to know more about this compatibility issue and underlying reasons for learning purpose.

We suspect that it was a regression in the libuv library caused by libuv/libuv@ce15b84, which was included in Node.JS 16.13.0.

See this issue, and specifically this comment for more information.

Meanwhile I have left comments on some of other GitHub issues having same problem and linked them with this one as duplicate.

Thanks for doing that, much appreciated!

@klodha
Copy link

klodha commented Apr 5, 2022

Thanks for sharing the details @alexweininger, really appreciate that.
I will check the thread you shared and keep watching. If you want me to test anything, do let me know and I will be happy to assist with that.

@alexweininger
Copy link
Member

Closing as duplicate of #2844

Until a fix is released in VS Code stable (hopefully the next major release), here are some options:

  1. Wait for the fix to come in VS Code Insiders
  2. Deploy via Azure CLI
  3. Downgrade your Azure Functions extension version to 1.2.1 (Feb 08, 2021), we used a different zip deploy method which seems to be working still. Note: it might not work in environments like WSL or Codespaces, which is why we changed our deploy in 1.3.0 (Mar 15, 2021).
  4. Downgrade to the VS Code February 2022 release, where zip deploy is working as discussed and confirmed above.

@alexweininger
Copy link
Member

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

@microsoft microsoft locked and limited conversation to collaborators May 21, 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

7 participants