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

Deployment to Azure Web App is failed, reason: read ECONNRESET #2191

Closed
Zvenigora opened this issue Mar 31, 2022 · 15 comments · Fixed by #2200
Closed

Deployment to Azure Web App is failed, reason: read ECONNRESET #2191

Zvenigora opened this issue Mar 31, 2022 · 15 comments · Fixed by #2200
Labels
Milestone

Comments

@Zvenigora
Copy link

Deployment to Azure App Service works in VS Code 1.65.2 and it fails in VS Code 1.66.0. Downgrading to version 1.65.2 restores the function.

Steps:

Login to Azure.
Open Explorer tab.
Right-click on the deployment package and select Deploy to Web App...
Optionally select the Web App and file folder.
Confirm the dialog 'Are you sure you want to deploy to "..."? This will overwrite any previous deployment and cannot be undone'. Select 'Deploy' button.
VS Code starts the deployment.
Check the output tab.

Actual logs in output tab (ver. 1.66.0)

12:58:09 PM uat-vwusasurvey-staging: Starting deployment...
12:58:11 PM uat-vwusasurvey-staging: Creating zip package...
12:58:50 PM uat-vwusasurvey-staging: Zip package size: 49.5 MB
1:03:38 PM: Error: request to https://uat-vwusasurvey-staging.scm.azurewebsites.net/api/zipdeploy?isAsync=true&author=VS%20Code failed, reason: read ECONNRESET
image

Expected logs in the output tab (ver 1.65.2)

11:00:28 a.m. uat-vwusasurvey-staging: Starting deployment...
11:00:30 a.m. uat-vwusasurvey-staging: Creating zip package...
11:01:37 a.m. uat-vwusasurvey-staging: Zip package size: 49.6 MB
11:01:38 a.m. uat-vwusasurvey-staging: Fetching changes.
11:01:38 a.m. uat-vwusasurvey-staging: Cleaning up temp folders from previous zip deployments and extracting pushed zip file C:\local\Temp\zipdeploy\ofydv0ab.zip (47.29 MB) to C:\local\Temp\zipdeploy\extracted
11:01:46 a.m. uat-vwusasurvey-staging: Updating submodules.
11:01:46 a.m. uat-vwusasurvey-staging: Preparing deployment for commit id '7a3cb5db76'.
11:01:47 a.m. uat-vwusasurvey-staging: Generating deployment script.

image

@chacabuk
Copy link

Same here
Azure App Service 0.23.1

@stevenpua
Copy link

I'm getting this as logs on app service

2022-04-01T04:48:17 Startup Request, url: /api/zipdeploy?isAsync=true&author=VS%20Code, method: POST, type: request, pid: 65,1,5, ScmType: None
2022-04-01T04:50:42 Error occurred, type: error, text: Unexpected end of request content., stackTrace: at Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException.Throw(RequestRejectionReason reason)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1ChunkedEncodingMessageBody.PumpAsync()
at System.IO.Pipelines.PipeCompletion.ThrowLatchedException()
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.GetReadAsyncResult()
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1ChunkedEncodingMessageBody.ReadAsyncInternal(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.CopyToAsyncInternal(Stream destination, CancellationToken cancellationToken)
at Kudu.Services.Deployment.PushDeploymentController.PushDeployAsync(ArtifactDeploymentInfo deploymentInfo, Boolean isAsync, HttpContext context, JObject requestJson)
at Kudu.Services.Deployment.PushDeploymentController.ZipPushDeploy()
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
at Kudu.Services.Web.Tracing.TraceMiddleware.Invoke(HttpContext context)
2022-04-01T04:50:42 Outgoing response, type: response, statusCode: 400, statusText: BadRequest

@alexweininger
Copy link
Member

Using this issue as a catch-all for ECONNRESET errors when attempting to deploy a zip in the App Service extension.

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 App Service extension version to v0.21.1 (Mar 04, 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 v0.21.2 (Mar 09, 2021).
  4. Downgrade to the VS Code February 2022 release, where zip deploy is working as discussed and confirmed above.

Here's some information on the bug we suspect is causing the issue with zip deploy.

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.

The Azure Functions and App Service extensions use the same code to zip deploy, so Azure Functions is facing the same issue.

@cemg
Copy link

cemg commented Apr 11, 2022

I downgraded my VS Code from latest to 1.64 and after that deployment is working fine.
but latest versions have a timeout problem.
Previouse versions of VS Code

@alexweininger
Copy link
Member

Hi everyone,

I believe to have found a fix for the ECONNRESET error on deployment. 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. From the command palette (F1 or Command/Ctrl + Shift + P), run the "Extensions: Install from VSIX..." command.
  4. Select the downloaded .VSIX file, then reload VS Code as prompted.

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

Thanks!

@Zvenigora
Copy link
Author

Hi @alexweininger,

Thank you for sharing the link for the fix. Unfortunately, I cannot validate it because I have no permission to download it.

@alexweininger
Copy link
Member

@Zvenigora could you try this link? The .vsix is inside the vsix folder.

@Zvenigora
Copy link
Author

Hi @alexweininger,

It works, thank you.

Old Environment:
VS Code 1.66.1
Azure App Service v0.23.1

Result: Socket hang up after 16 minutes.
image

New Environment:
VS Code 1.66.1
Azure App Service v0.23.2-alpha

Result: Deployment successful

image

@alexweininger
Copy link
Member

@Zvenigora thank you for verifying the fix!

@faceoffers28
Copy link

@alexweininger The latest fix worked for me. Thanks!

@alexweininger
Copy link
Member

@faceoffers28 Awesome, thanks! ❤️

@faceoffers28
Copy link

@alexweininger Some items don't appear to be copying over to Azure. What did you change? My project is working locally as expected. When I deploy to Azure using VSC, some items that were there before are now missing.

@alexweininger
Copy link
Member

Some items don't appear to be copying over to Azure. What did you change? My project is working locally as expected. When I deploy to Azure using VSC, some items that were there before are now missing.

@faceoffers28 Nothing in terms of what files are deployed should have changed. The only change is microsoft/vscode-azuretools#1114

@alexwolfmsft
Copy link

Just wanted to comment that I have also verified that this latest build fixes the issue, thanks.

@alexweininger
Copy link
Member

alexweininger commented Apr 13, 2022

Fix has been released in version https://github.com/microsoft/vscode-azureappservice/releases/tag/v0.23.2 of the extension.

Huge thanks to everyone who helped verify the fix! ❤️

@microsoft microsoft locked and limited conversation to collaborators May 28, 2022
@v-chenzha v-chenzha unpinned this issue Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants