Azure / functions-action

Enable GitHub developers to deploy to Azure Function Apps using GitHub Actions
MIT License
148 stars 73 forks source link

Error 404: When request Azure resource at PublishContent, zipDeploy : Failed to use /home/runner/work/_temp/temp_web_package_...zip as ZipDeploy content #216

Open martin-greentrax opened 5 months ago

martin-greentrax commented 5 months ago

These github workflows have worked 2 years for us to deploy various python functions hundreds of times to azure and now are suddenly no longer reliable:

      - name: Publish Azure Function
        uses: Azure/functions-action@v1
        id: fa
        with:
          app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
          package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
          publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}

While debugging now we also tried v1.5.1, but no success with it either. Some more or less random restart/delete/disable may or may not help to resolve it (as described here https://github.com/microsoft/azure-pipelines-tasks/issues/18739#issuecomment-1905856749) but the issue comes back and then one can start the deployment over and over again and see the same error.

Here is how the github job log starts with debug logging:

Current runner version: '2.311.0'
Operating System
Runner Image
  Image: ubuntu-22.04
  Version: 20240116.3.0
  Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240116.3/images/ubuntu/Ubuntu2204-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240116.3
Runner Image Provisioner
  2.0.324.1

And this is how it fails:

##[debug]Deployment status: 0 'Building and Deploying '***-4e62-871a-d8bdc4ef87f0'.'. retry after 5 seconds
##[debug]setting affinity cookie ["ARRAffinity=****a443cf3f6c7c2e4daaee92c2062af1b69e3649bf26d43fe66fe700a7de;Path=/;HttpOnly;Secure;Domain=***.scm.azurewebsites.net","ARRAffinitySameSite=****443cf3f6c7c2e4daaee92c2062af1b69e3649bf26d43fe66fe700a7de;Path=/;HttpOnly;SameSite=None;Secure;Domain=***.scm.azurewebsites.net"]
##[debug][GET] [https://***.scm.azurewebsites.net:443/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY_FUNCTIONS_V1&time=2024-01-23_11-20-47Z](https://***.scm.azurewebsites.net/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY_FUNCTIONS_V1&time=2024-01-23_11-20-47Z)
##[debug]Could not parse response body.
##[debug]{}
Error: Failed to deploy web package to App Service.
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error:   When request Azure resource at PublishContent, zipDeploy : Failed to use /home/runner/work/_temp/temp_web_package_8472975363497814.zip as ZipDeploy content
Error:     Failed to deploy web package to App Service.
Not Found (CODE: 404)
Error:       Error: Failed to deploy web package to App Service.
Not Found (CODE: 404)
    at Kudu.<anonymous> (/home/runner/work/_actions/Azure/functions-action/v1/lib/appservice-rest/Kudu/azure-app-kudu-service.js:235:41)
    at Generator.throw (<anonymous>)
    at rejected (/home/runner/work/_actions/Azure/functions-action/v1/lib/appservice-rest/Kudu/azure-app-kudu-service.js:6:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Deployment Failed!
##[debug]Node Action run completed with exit code 1

It does seem to finish the publishing though (as our version tag shows the new version) but it does not start the remaining steps of the deployment as it considers this step as failed.

martin-greentrax commented 5 months ago

This issue keeps occurring randomly for our deployments. :(

mboiman commented 5 months ago

same here too. Microsoft fix this please!

mboiman commented 4 months ago

@patelchandni @Hazhzeng any ideas how to solve this problem?

charlesgardyn commented 4 months ago

Same here

CaptainJojo commented 4 months ago

Same here, I have error but it's deploy

kuuselajuha commented 4 months ago

Any solutions inbound? Having the same issue with v1.5.0 and 1.5.1

codingawayy commented 4 months ago

Same thing here - the builds suddenly started failing after 2 years.

My workaround for now is to use https://github.com/Azure/webapps-deploy instead. Found the workaround in another related issue: https://github.com/Azure/functions-action/issues/213.

  - name: Deploy
    uses: azure/webapps-deploy@v2
    id: fa
    with:
      app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
      package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/build'
      publish-profile: ${{ secrets.AZURE_API_PUBLISH_PROFILE }}
skvark commented 4 months ago

Same issue here as well...

amorimcode commented 3 months ago

same issue here

kokatic commented 3 months ago

same issue here!

hynrbf commented 2 months ago

Same issue here!

kokatic commented 2 months ago

Any alternative solutions to propose ?

viachmev commented 2 months ago

+1

kokatic commented 2 months ago

Hello Allo, I fixed the issue by :

Hope this can help you !

SjoerdTimovanVliet commented 1 month ago

+1

runeheidem commented 3 weeks ago

+1

ricardofalc commented 2 weeks ago

Same issue here.