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

ZIP Deploy failed #42

Closed
wmmihaa opened this issue Jul 3, 2020 · 31 comments
Closed

ZIP Deploy failed #42

wmmihaa opened this issue Jul 3, 2020 · 31 comments

Comments

@wmmihaa
Copy link

wmmihaa commented Jul 3, 2020

I've enabled GitHub Actions for my Azure App Service Dev Slot, but it fails on the deployment step using the webapps-deploy action.

##[error]Failed to deploy web package to App Service.
##[error]Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.

Workflow

name: Build and deploy XXXXXX - XXXXXX-web(dev)

env:
  AZURE_WEBAPP_NAME: XXXXXX-web
  AZURE_WEBAPP_PATH: '.'
  AZURE_WEBAPP_SLOT: 'dev'
  DOTNET_VERSION: '3.1.102'
  GITHUB_BRANCH: 'dev'

on:
  push:
    branches:
      - dev

jobs:
  build-and-deploy:
    runs-on: windows-latest

    steps:
    - uses: actions/checkout@master

    - name: Set up .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: ${{ env.DOTNET_VERSION }}

    - name: Build XXXXXX project
      run: dotnet build .\XXXXXX\XXXXXX.csproj --configuration Release

    - name: Publish XXXXXX project
      run: dotnet publish .\XXXXXX\XXXXXX.csproj -c Release -o ${{ env.DOTNET_ROOT }}/myapp

    - name: Deploy to Azure Web App
      uses: azure/webapps-deploy@v2
      with:
        app-name: 'XXXXXX-web'
        slot-name: 'Dev'
        publish-profile: ${{ secrets.AzureAppService_PublishProfile_YYYYYYYYYYYYYYYYYYYYYY }}
        package: ${{env.DOTNET_ROOT}}/myapp 

Output

   package: C:\hostedtoolcache\windows\dncs\3.1.102\x64/myapp
  env:
    AZURE_WEBAPP_NAME: XXXXXX-web
    AZURE_WEBAPP_PATH: .
    AZURE_WEBAPP_SLOT: dev
    DOTNET_VERSION: 3.1.102
    GITHUB_BRANCH: dev
    DOTNET_ROOT: C:\hostedtoolcache\windows\dncs\3.1.102\x64
Package deployment using ZIP Deploy initiated.
Updating submodules.
Preparing deployment for commit id '2a48ddc76b'.
Generating deployment script.
Using cached version of deployment script (command: 'azure -y --no-dot-deployment -r "D:\local\Temp\zipdeploy\extracted" -o "D:\home\site\deployments\tools" --basic --sitePath "D:\local\Temp\zipdeploy\extracted\XXXXXX.com"').
Running deployment command...
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling Basic Web Site deployment.
Creating app_offline.htm
Error: Could not find a part of the path 'D:\local\Temp\zipdeploy\extracted\XXXXXX.com'.
KuduSync.NET from: 'D:\local\Temp\zipdeploy\extracted\XXXXXX.com' to: 'D:\home\site\wwwroot'
Failed exitCode=1, command="kudusync" -v 50  -f "D:\local\Temp\zipdeploy\extracted\XXXXXX.com" -t "D:\home\site\wwwroot" -n "D:\home\site\deployments\2a48ddc76bbd4b4c87cb0834cd179a08\manifest" -p "D:\Program Files (x86)\SiteExtensions\Kudu\87.20522.4610\bin\Scripts\firstDeploymentManifest" -i ".git;.hg;.deployment;deploy.cmd"
An error has occurred during web site deployment.
Error: Could not find a part of the path 'D:\local\Temp\zipdeploy\extracted\XXXXXX.com'.\r\nD:\Program Files (x86)\SiteExtensions\Kudu\87.20522.4610\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
##[error]Failed to deploy web package to App Service.
##[error]Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
Successfully updated deployment History at https://XXXXXX-web-dev.scm.azurewebsites.net/api/deployments/517bd24fdfb7cee6da766301e1a72a83b52d221e1593760589047
App Service Application URL: http://XXXXXX-web-dev.azurewebsites.net
@wmmihaa
Copy link
Author

wmmihaa commented Jul 3, 2020

UPDATE

(not a permanent solution but for input)
After updating the /site/deployments/tools/deploy.cmd file from

call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 !IGNORE_MANIFEST_PARAM! -f "%DEPLOYMENT_SOURCE%"/XXXXXX -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"

... to (removing the project name from the deployment source)

call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 !IGNORE_MANIFEST_PARAM! -f "%DEPLOYMENT_SOURCE%"-t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"

...it seams to find the file, but says it's being used by another process:

Package deployment using ZIP Deploy initiated.
Fetching changes.
Cleaning up temp folders from previous zip deployments and extracting pushed zip file D:\local\Temp\zipdeploy\kvnzzqpr.zip (65.91 MB) to D:\local\Temp\zipdeploy\extracted
The process cannot access the file because it is being used by another process.
##[error]Failed to deploy web package to App Service.
##[error]Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
##[error]Package deployment using ZIP Deploy failed. Refer logs for more details.

@MrThePlague
Copy link

This also seems to be affecting Linux Web Apps.

Kudu Sync failed
\n/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh"
##[error]Failed to deploy web package to App Service.
##[error]Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.

@wmmihaa
Copy link
Author

wmmihaa commented Jul 19, 2020

@aksm-ms, @N-Usha do you have an update on this?

@AmrutaKawade AmrutaKawade added bug Something isn't working and removed bug Something isn't working labels Sep 17, 2020
@aksm-ms aksm-ms added bug Something isn't working and removed need-to-triage labels Oct 29, 2020
@aksm-ms
Copy link
Contributor

aksm-ms commented Oct 29, 2020

@wmmihaa this looks like an issue with the Kudu APIs we use in action code, not the action code itself. Will check and update.

@aksm-ms
Copy link
Contributor

aksm-ms commented Nov 30, 2020

@wmmihaa are you still facing this issue?

@aksm-ms aksm-ms added waiting-for-customer and removed bug Something isn't working labels Nov 30, 2020
@wmmihaa
Copy link
Author

wmmihaa commented Nov 30, 2020

I have not tried again. Has anything changed?

@aksm-ms
Copy link
Contributor

aksm-ms commented Dec 2, 2020

@sanchitmehta Can you please take a look at this issue? cc: @N-Usha @nadesu

@aksm-ms
Copy link
Contributor

aksm-ms commented Dec 3, 2020

@sanchitmehta Any update?

@N-Usha
Copy link
Contributor

N-Usha commented Dec 7, 2020

@ehamai - Can you please confirm if your team could help on this? or could you please help loop in the right product owners for the APIs under question? Thanks!

@ehamai
Copy link
Collaborator

ehamai commented Dec 9, 2020

@sanchitmehta is this something you can help with please?\

@rohit-patel-ce21
Copy link

@aksm-ms I am also getting the almost same error. Please help me with that.
https://stackoverflow.com/questions/65528704/github-azure-webapps-deployv2-package-deployment-using-zip-deploy-failed

@AmrutaKawade
Copy link
Contributor

There is similar issue on kudu team and they are working on the fix projectkudu/kudu#3169

@AmrutaKawade AmrutaKawade self-assigned this Jan 5, 2021
@AmrutaKawade
Copy link
Contributor

@rohit-patel-ce21 from your stackoverflow issue it seems that you are getting different error. please enable debugging by setting ACTIONS_STEP_DEBUG = true in secrets.

@wmmihaa as confirmed with appservice team internally they have fixed original issue Error: Could not find a part of the path. Please let us know if you are still facing this issue

@AmrutaKawade
Copy link
Contributor

Closing this issue as its already fixed. Let us know if you are still facing issue, we will reopen this issue.

@vonbv
Copy link

vonbv commented Jan 29, 2021

@AmrutaKawade was this fixed? I'm getting the same error:

Run azure/webapps-deploy@v2
  with:
    app-name: *****
    slot-name: xxx
    publish-profile: ***
    package: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet/myapp
  env:
    DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet
Package deployment using ZIP Deploy initiated.
Updating submodules.
Preparing deployment for commit id '*****'.
Generating deployment script.
Using cached version of deployment script (command: 'azure -y --no-dot-deployment -r "D:\local\Temp\zipdeploy\extracted" -o "D:\home\site\deployments\tools" --basic --sitePath "D:\local\Temp\zipdeploy\extracted\*****\*****.csproj"').
Running deployment command...
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling Basic Web Site deployment.
Creating app_offline.htm
KuduSync.NET from: 'D:\local\Temp\zipdeploy\extracted\*****\*****.csproj' to: 'D:\home\site\wwwroot'
Error: Could not find a part of the path 'D:\local\Temp\zipdeploy\extracted\*****\*****.csproj'.
Failed exitCode=1, command="kudusync" -v 50  -f "D:\local\Temp\zipdeploy\extracted\*****\*****.csproj" -t "D:\home\site\wwwroot" -n "D:\home\site\deployments\*****\manifest" -p "D:\Program Files (x86)\SiteExtensions\Kudu\91.21119.4922\bin\Scripts\firstDeploymentManifest" -i ".git;.hg;.deployment;deploy.cmd"
An error has occurred during web site deployment.
Error: Could not find a part of the path 'D:\local\Temp\zipdeploy\extracted\*****\*****.csproj'.\r\nD:\Program Files (x86)\SiteExtensions\Kudu\91.21119.4922\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
Error: Failed to deploy web package to App Service.
Error: Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.

@MalteToenjes
Copy link

I get the same error. I'm using ADO Pipeline. I try to deploy a Windows FunctionApp. Interesting is that this error occurs only when I try to deploy to a slot. No issue with deploying it to production.

@willdave865
Copy link

I had the same problem. The issue appeared to be caused while having the deployment open in IDE (Visual Studio 2019 latest) at the same time as Github. Attempting to deploy codebase from GitHub when I hadn't finished last details (keyvault, username/password) for publish from V.S

@SteveWinward
Copy link

I discovered for me that I was not using the right GitHub Action template. I was using the dotnet core app vs the ASP.NET MVC template on the docs below,

https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel#aspnet

Once I updated to using the ASP.NET MVC template everything worked correctly.

@MalteToenjes
Copy link

After the MS support also couldn't help me I decided to delete the ressource and recreated it...after this it worked....

@wmmihaa
Copy link
Author

wmmihaa commented Jun 13, 2022

If anyone is still getting this error, here is the solution and a desctiption of what likely caused the problem.

Before GitHub actions were a thing, we used Kudo directly from the Deployment Center of the App Service. However, becase our solution had multiple projects, we had to set a PROJECT configuration variable so Kudo would understand which project to deploy.

Since then, we have copied our app service configuration every time we set up a new site, including the PROJECT configuration variable. This variable is not required when using GitHub Actions, but is still used in Kudo, which is still the underlying framework for deploying your app when using azure/webapps-deploy@v2.

With the PROJECT configuration variable set, Kudo will add it as a parameter as visible in the log:

Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "C:\local\Temp\zipdeploy\extracted" -o "C:\home\site\deployments\tools" --basic --sitePath "C:\local\Temp\zipdeploy\extracted\YOUR-PROJECT-VARIABLE"'.

In conclusion, just remove the PROJECT configuration variable from your App Service Configuration.

@Dr-Abishek
Copy link

Dr-Abishek commented Dec 2, 2022

This error is not resolved for me.

How do I do "In conclusion, just remove the PROJECT configuration variable from your App Service Configuration."?

I am trying to deploy on Azure App service.

@wmmihaa
Copy link
Author

wmmihaa commented Dec 2, 2022

Have a look in the Configuration of your App Service. If you have an App setting called "PROJECT", remove it. This setting was previously used if you had more than one project in your solution but is now stated in the workflow.

There has been other cases where I see this issue which tend to point to diffferenses in Bootstrap versions where it tries to remove a LICENSE directory or file (can't remember which). If you see a similar error, just remove the file/directory from the console.

HTH

@Dr-Abishek
Copy link

Dr-Abishek commented Dec 2, 2022 via email

@wmmihaa
Copy link
Author

wmmihaa commented Dec 2, 2022

Then that is not the issue for you. In GitHub, navigate to the Action menu and click the failed workflow and the again on the failed job. Scroll down to the failed step and copy the whole error message and paste it here.

For more detailed errors, cosider to "Re-run jobs" and select "Enable debug logging".

@Dr-Abishek
Copy link

Dr-Abishek commented Dec 2, 2022 via email

@Praveen-Sudhakar
Copy link

This is not resolved for me. None of the above suggestions helped in my case. Appreciate any help on this.

I am deploying a Sentiment Analysis model created using PyTorch & BERT through Flask API. Here is my repo for your reference - https://github.com/Praveen-Sudhakar/SentimentAnalysis

@ZahidSafi
Copy link

this is the error message that I am receiving:
Error: Failed to deploy web package to App Service.
Error: Deployment Failed with Error: Error: Failed to deploy web package to App Service.

@DoubleTime
Copy link

Run azure/webapps-deploy@v[2](myrepo)
  with:
    app-name: myappname
    slot-name: staging
    publish-profile: ***
    package: .
  
Package deployment using ZIP Deploy initiated.
Fetching changes.
Cleaning up temp folders from previous zip deployments and extracting pushed zip file D:\local\Temp\zipdeploy\zcdcn0[3](https://github.com/trilobyte-my/recafi/actions/runs/4626638465/jobs/8184273952#step:3:3)5.zip (58.5[4](https://github.com/trilobyte-my/recafi/actions/runs/4626638465/jobs/8184273952#step:3:4) MB) to D:\local\Temp\zipdeploy\extracted
Error: Failed to deploy web package to App Service.
Error: Deployment Failed, Package deployment using ZIP Deploy failed. Refer logs for more details.

Windows App Service.
Keep stuck at here, any solution?

@VasilisZenergi
Copy link

Closing this issue as its already fixed. Let us know if you are still facing issue, we will reopen this issue.

Seems that it is still happening.....

@NoCopy
Copy link

NoCopy commented May 3, 2023

ACTIONS_STEP_DEBUG = true

SECURITY WARNING: Some packages will dump plain text ENV vars in the log. Such as azure/webapps-deploy. Be careful using this!

@assilabdulrahim
Copy link

Yes, It is happening , I still fail to deploy on any slot. I have tried all possible ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests