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

Deploying to Azure Functions with message "socket hang up" after "creating zip package..." #2516

Closed
Lucasje19 opened this issue Nov 5, 2020 · 4 comments

Comments

@Lucasje19
Copy link

Lucasje19 commented Nov 5, 2020

Created an Azure Function in Visual Studio Code and deployed it succesfully at first. When adding a second function, it failed after Creating zip package.... Now any time I try to create/deploy a function it does not make any progress beyond the Creating zip package... message. Seems similar to #2390.

Does this occur consistently? Yes; only the very first time after Azure Function extension installation was successful.
Repro steps:

Actual:

  1. Running a project in Visual Studio Code with the Remote - Containers extension
  2. Creating a default Azure Function HTTP trigger using the Azure Function extension. For testing purposes I simply followed the tutorial and did not change any code.
  3. Deployed the app, again following the tutorial, which fails after Creating zip package...

Expected:
Similar output as my first try and the results of the tutorial: a deployed Azure Function.

Steps taken to resolve the issue:

  1. Deleted the Docker container and image and rebuild those (using a devcontainer.json file that includes the installation for the Azure Function extension)
  2. Signed out of Azure in Visual Studio Code, and subsequently signed in again.
  3. Closed the file in the editor.
  4. Make sure Visual Studio Code was not in the debug mode.
  5. Read up on Deployment hangs while "creating zip package ..." if a .ts file is opened #1105, no change in the results.

Action: azureFunctions.deploy
Error type: ECONNRESET
Error Message: request to https://function.scm.azurewebsites.net/api/zipdeploy?isAsync=true&author=VS%20Code failed, reason: socket hang up

Version: 1.0.0
OS: linux
OS Release: 5.4.39-linuxkit
Product: Visual Studio Code
Product Version: 1.50.1
Language: en

Call Stack
ClientRequest.<anonymous> extension.js:363:15219
ClientRequest.emit events.js:228:7
TLSSocket.socketOnEnd _http_client.js:440:9
TLSSocket.emit events.js:228:7
endReadableNT _stream_readable.js:1185:12
processTicksAndRejections task_queues.js:81:21

Read in multiple issues that it miraculously started working for other users again, so I'll keep trying.

@Lucasje19
Copy link
Author

DId some more testing this morning and indeed there seems to be some randomness involved.

  1. When deploying from a local workspace, the issue happens only so often (though I don't know why sometimes it does and other times it does not)
  2. When deploying from within a container, the issue happens everytime, except for the first time when building the image and running a container.
  3. Simply using the >Remote-Containers: Rebuild and Reopen in Container helps resolve the issue, and anytime I try to deploy a function I do not receive an error.

I'll keep track of the issue and update if I find more unwanted behavior.

@JosXa
Copy link

JosXa commented Nov 12, 2020

Yes, with Windows as the host it works flawlessly, but under Linux in a devcontainer I run into the same issue. Could you reopen?

@Lucasje19 Lucasje19 reopened this Nov 13, 2020
@dan-osull
Copy link

This workaround allows me me to publish a Python 3.8/Azure Functions 3 function from WSL 2:

Prereqs: func command line tool, az command line tool, Docker (I'm using the WSL 2 engine provided by Docker Desktop on Windows)

az account set --subscription "subscription_name"
func azure functionapp publish function_name --build-native-deps

@Lucasje19
Copy link
Author

Dupe of #2108

@ejizba ejizba closed this as completed Nov 16, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 31, 2020
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

4 participants