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 hung in Visual Studio Codespaces & WSL #2108

Closed
chunliu opened this issue May 16, 2020 · 21 comments
Closed

Deployment hung in Visual Studio Codespaces & WSL #2108

chunliu opened this issue May 16, 2020 · 21 comments

Comments

@chunliu
Copy link

chunliu commented May 16, 2020

I created a new Azure Function project with .net core 3.1 in a VS Codespaces environment. The project could run locally and it could be deployed with command line in the terminal.

However, when I tried to deploy it to Azure, the deployment hung at the Creating zip package step. The following is the log from output:

1:22:06 PM: Creating new function app "funcappinst2"...
1:22:27 PM: Successfully created function app "funcappinst2": https://funcappinst2.azurewebsites.net
1:22:35 PM funcappinst2: Creating zip package...

The instance type of the codespace was Standard (Linux). The OS of the function app in Azure was also Linux.
Runtime version: 3.0.13113
Azure Functions Extension version: 0.22.1

@nturinski
Copy link
Member

nturinski commented May 18, 2020

Thanks for reporting @chunliu

Is this problem recurring? Have you tried just deploying your project to the create function app? Sometimes there are just hiccups in the deploying command and re-trying will resolve the issue.

If it's getting hung up at the zipping step, perhaps your project is really large?

@nturinski nturinski added the info-needed See https://aka.ms/azcodeissuereporting label May 18, 2020
@ejizba ejizba added investigate and removed info-needed See https://aka.ms/azcodeissuereporting labels May 18, 2020
@ejizba
Copy link
Member

ejizba commented May 18, 2020

@nturinski we should try deploying in Codespaces ourselves before labeling this issue "needs more info" (I assume you haven't tried it). I could totally see us having problems specific to Codespaces

@ejizba ejizba added this to the 0.23.0 milestone May 18, 2020
@chunliu
Copy link
Author

chunliu commented May 19, 2020

@nturinski the problem keeps happening with Codespaces. It happened with a new project created by the extension so the project is not large. No matter if it is an existing function app or a new one created by the extension, the deployment hung. I would be surprised if you cannot reproduce it with Codespaces.

@ejizba ejizba changed the title Deployment hung in Visual Studio Codespaces Deployment hung in Visual Studio Codespaces & WSL May 29, 2020
@techfg
Copy link

techfg commented Jun 6, 2020

Encountering this issue as well (hung at Creating zip package...) and I'm not using codespaces and am running WSL 1.

Was running VSCode 1.42.1 and all was good. Upgraded to 1.45.1 and started encountering the issue. Uninstalled back to 1.42.1 and everything worked as expected. Installed 1.43.0 and problem occurred. Uninstalled back to 1.42.1 and all was good so appears problem was introduced between 1.42.1 and 1.43.0.

Additional Info:

  • Problem does not seem to occur when not using WSL.
  • Occurs regardless of whether or not files are on WSL (~/myproject) or outside (/mnt/c)
  • Azure Functions Extension Version 0.22.1

Steps to repro:

  1. Create new Function App using all defaults
  2. Deploy to Azure using all defaults

Expected Result:
Function App Deploys

Actual Result:
Hangs on "Deploying zip package..."

@anthonychu
Copy link
Member

If anyone else is hitting this issue, I was able to get it to work (at least temporarily) by uninstalling and reinstalling the extension. Not sure if it was a fluke or would work for everyone but it fixed it for me on a couple of occasions. Sharing in case anyone is running into this before the fix is published.

@sebastianrogers
Copy link

I can get it to work if I open the folder, not the workspace in VS Codespaces (Online)

@ejizba
Copy link
Member

ejizba commented Jul 13, 2020

@sebastianrogers can you clarify what you mean? Is there some important difference between "folder" and "workspace" (If so, what?) or is it all about normal VS Code vs. VS Codespaces?

@sebastianrogers
Copy link

@benc-uk
Copy link

benc-uk commented Aug 7, 2020

Same
WSL2 user here, hangs at creating zip, even on an empty and brand new functions project (func init)

I don't think this is just Codespaces related. It happens in WSL2 and VS Code remote containers (which is effectively a local version of Codespaces)

@anthonychu
Copy link
Member

I ran into this this week locally in a devcontainer as well. (Stuck at creating zip)

@ejizba ejizba modified the milestones: 0.24.0, 0.25.0 Aug 25, 2020
@ejizba ejizba modified the milestones: 0.25.0, 0.26.0 Sep 29, 2020
@FredChap
Copy link

Does anyone could solve this issue ?
It's actually really painful to uninstall and reinstall the Azure Function extension (which requires re-authenticating)
just to make a deployment.

@gpolyn
Copy link

gpolyn commented Jan 10, 2021

Hitting same issue...

request to https://unanetexport.scm.azurewebsites.net/api/zipdeploy?isAsync=true&author=VS%20Code failed, reason: socket hang up

@cdennig
Copy link

cdennig commented Jan 11, 2021

Hi...any news on that one? Unfortunately, it makes using the extension impossible in WSL2.

@elasticdotventures
Copy link

ditto, same issues - Azure functions with Microsoft VS Code, with Microsoft Windows WSL2

@cdennig
Copy link

cdennig commented Feb 25, 2021

Hi folks, do you have any news on that? This bug is so annoying and makes working in WSL2 with the extension impossible! Thanks for any updates on that topic.

@benc-uk
Copy link

benc-uk commented Feb 25, 2021

I find it incredible the Azure Functions team don't test anything under WSL or even use it themselves. This is isn't the first time there's been WSL specific issues

@cdennig
Copy link

cdennig commented Feb 25, 2021

@benc-uk, it's not only AzFunctions...it's also the AppService extension. Both use the same lib for the zip-deployment.

@nturinski
Copy link
Member

Hi @cdennig I'm trying to repro this issue on WSL2, but not having any luck. I've tried with both a node.js and .NET 3.1 project.

Could you let me know what distro you're using? I was trying on Ubuntu 18.04 so I'm wondering if maybe certain distributions don't work with our npm zip package.

@cdennig
Copy link

cdennig commented Feb 26, 2021

Hi @nturinski, I'm running VS Code in WSL2 with Ubuntu 20.04 LTS version. I could narrow the problem down to "runWithZipStream" of the vscode-azureappservice module.

runWithZipStream function:

// Setup several tasks related to the zip stream and await them all together
const streamTasks = [];
// 1. Generic task that will reject if there's an error with the stream
streamTasks.push(new Promise((resolve, reject) => {
    zipStream.on('end', resolve);
    zipStream.on('error', reject);
}));
// 2. `callback` sets up where the zip stream is piped
streamTasks.push(callback(zipStream));
// 3. `zipStream.finalize` lets "archiver" know we're done adding files to the zip
if (zipStream.finalize) {
    streamTasks.push(zipStream.finalize());
}
yield Promise.all(streamTasks);

All of those 3 promises in streamTasks seem to not resolve. zipStream is of type Archiver (version 4.0.1 - there is a major as well as a new minor version available) and it is correctly initialized with all the relevant files that need to be deployed.

Hope this helps...

@cdennig
Copy link

cdennig commented Mar 4, 2021

Hi @nturinski, I can confirm that - with the merge from yesterday - the deployment from VS Code to an Azure Function app is successful. Just tried with a clean environment.

Thank you very much 🙏 Looking forward to the next release of the extension 😊

@ejizba
Copy link
Member

ejizba commented Mar 15, 2021

Hey all - we included a fix for this in v1.3.0 of the extension released last week. Thank you to @cdennig for verifying! I'll go ahead and close this issue, but let us know if you're still running into this bug after the update.

@ejizba ejizba closed this as completed Mar 15, 2021
@ejizba ejizba modified the milestones: Backlog Candidates, 1.3.0 Mar 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2021
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