'Azure App Service Web App Deploy from VScode "Number of entries expected in End Of Central Directory does not..."

I often have the following error when trying to deploy a Node app to Azure via the VScode Azure App Service extension. I am not sure what it doesn't like about my project. I have looked around and seen related hits to the problem that crack it up to be the fact that I am using a Windows machine and deploying to Linux, and that's why it doesn't like the zip file? In the past I have just avoided the problem by creating a new webapp on Azure to deploy to and it works, but I can never deploy to the same Webapp service twice.

10:00:21 AM CardGameServer: Starting deployment...

10:00:21 AM CardGameServer: Creating zip package...

10:02:03 AM CardGameServer: Zip package size: 20.1 kB

10:02:03 AM CardGameServer: Fetching changes.

10:02:04 AM CardGameServer: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/981fc9e6-5778-4a2c-9145-02463df858a7.zip (0.02 MB) to /tmp/zipdeploy/extracted

10:02:04 AM CardGameServer: Number of entries expected in End Of Central Directory does not correspond to number of entries in Central Directory.
10:02:10 AM CardGameServer: Deployment failed.

Also the "Creating zip package..." step takes about 4 minutes. The app is 20kb (as seen in the console output). Why does this take so long? Sometimes it even times out. Does it push my entire workspace to azure and zip it there? If I don't have a ignore pattern for the node_modules I get a zip with size 182mb in the output console, and it takes just as long to deploy as when node_modules is ignored.(I run npm install via the .deployment file with `"SCM_DO_BUILD_DURING_DEPLOYMENT=true" so I ignore the node_modules folder). The file count mismatch error occurs whether or not I have ZipIgnorePatterns specified, or if using only the "default" ignore patterns of "node_modules{,/**}", ".vscode{,/**}"

I thought I read somewhere on a Microsoft doc (trying to track down that page - it was a highlighted warning box on the page) that the web app publishing extension fails with apps that are apart of repos that have a large number of commits.

My workspace: workspace

Deployment settings: enter image description here



Solution 1:[1]

Yes, deploy through VS Code would push your entire workspace to azure with an zip package, and extract not zip them on Azure.

About Creating zip package... step, it seems something going wrong with your project. Actually it should take some time for compressing your entire project, and the Zip package size should not be so small.

As I can see, your zipIgnorepattern is too much. Maybe some file you set ignore is required. Just let the settings.json file to be default and try to deploy again.

I have a simple node project and deploy it through VS Code successfully: enter image description here

And this is the file structure on Azure kudu site: enter image description here My default settings.json: enter image description here

Solution 2:[2]

Check in Azure if your App Service or Function App is set up under Deployment Center. We had originally set up the build pipeline and release pipeline through the Azure Deployment Center. Then when we tried to create a new release pipeline to the same app service we ended up with the error:

Offset to Central Directory cannot be held in an Int64.
Error: Failed to deploy web package to App Service.
Error: To debug further please check Kudu stack trace URL
Error: Package deployment using ZIP Deploy failed. Refer logs for more details.

The solution is to go into Azure Portal > App Service (or deployment slot) > Deployment Center and then Disconnect your app.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Doris Lv
Solution 2 Jeff Widmer