Azure / webapps-deploy

Enable GitHub developers to deploy to Azure WebApps using GitHub Actions
MIT License
269 stars 193 forks source link

ZipDeploy to Web App via Github Actions fails without any error details #138

Closed bjomi closed 1 year ago

bjomi commented 3 years ago

Hi,

I'm setting up a new deploy pipeline with Github Actions. The action was initially created from Azure via the Deployment Center for the web app in question.

The project that gets build is a classic ASP.NET Framework (4.5.1) application. The web-app that I'm trying to deploy to has been around for many years (if that matters).

I have tried to run the deploy script both when the web-app is started and when it is stopped (to exclude locking issues).

The Github action is defined as follows:


# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy ASP app to Azure Web App - <webapp-name>(<webapp-slot-name>)

on:
  push:
    branches:
      - <branch-name>
  workflow_dispatch:

jobs:
  build:
    runs-on: 'windows-latest'

    steps:
    - uses: actions/checkout@v2

    - name: Setup MSBuild path
      uses: microsoft/setup-msbuild@v1.0.2

    - name: Setup NuGet
      uses: NuGet/setup-nuget@v1.0.5

    - name: Restore NuGet packages
      run: nuget restore .\<path-to-solution>\<solution-name>.sln

    - name: Publish to folder
      run: msbuild .\<path-to-project>\<project-name>.csproj /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:Configuration="Release" /p:_PackageTempDir="\published\"

    - name: Upload artifact for deployment job
      uses: actions/upload-artifact@v2
      with:
        name: ASP-app
        path: '/published/**'

  deploy:
    runs-on: 'windows-latest'
    needs: build
    environment:
      name: '<webapp-slot-name>'
      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

    steps:
    - name: Download artifact from build job
      uses: actions/download-artifact@v2
      with:
        name: ASP-app

    - name: Deploy to Azure Web App
      id: deploy-to-webapp
      uses: azure/webapps-deploy@v2
      with:
        app-name: '<webapp-name>'
        slot-name: '<webapp-slot-name>'
        publish-profile: ${{ secrets.AzureAppService_PublishProfile_<publish-profile-id> }}
        package: .

So, the source gets built, and the zip is uploaded to local/Temp and is extracted. But then it just stops and I get the following error message:

Cleaning up temp folders from previous zip deployments and extracting pushed zip file D:\local\Temp\zipdeploy\<file-id>.zip (16.98 MB) to D:\local\Temp\zipdeploy\extracted
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.

I can see that the zip has been extracted into D:\local\Temp\zipdeploy\extracted. So my guess is that something happens after that. I have enabled detailed logging but it does not give any further information about what goes wrong.

As I said, this web app has been around for many years. And there has been multiple deploy-methods. For example, I don't know if deploy.cmd is invoked in this process. If it is, there might be some mismatch there.

Grateful for any advice about how to diagnose the error and get the deploy working.

UncleJazzmus commented 3 years ago

I am experiencing the exact same issue! I have also hit a wall with the logs - the "Refer logs" in the error message hasn't exactly helped either.

github-actions[bot] commented 3 years ago

This issue is marked need-to-triage for generating issues report.

BALAGA-GAYATRI commented 3 years ago

@sanchitmehta Any idea about this?

BALAGA-GAYATRI commented 3 years ago

@bjomi @UncleJazzmus can you try adding a secret ACTIONS_STEP_DEBUG and set the value true and see if it helps debug the issue.

bjomi commented 3 years ago

@BALAGA-GAYATRI thanks for getting back!

I mentioned it in my original description of the issue, but not very clear. I did enable debugging and it did not give me any further information unfortunately.

UncleJazzmus commented 3 years ago

I added ACTIONS_STEP_DEBUG but it didn't add any new knowledge. I gave up on github actions and went back to a known working solution.

ArieJones commented 3 years ago

I am also running into the same issue and have tried a number of things..

  1. ACTIONS_STEP_DEBUG : no change
  2. Scaling up and down plan: no change
  3. Deployments in Advanced Tools shows the deployment commits properly.. but the deployment logs only show
  4. 2021-06-20T11:41:38 An unknown error has occurred. Check the diagnostic log for details. 2021-06-20T11:41:38 An unknown error has occurred. Check the diagnostic log for details.

I have checked all available kudo and trace log files.. but nothing is showing up.. wondering if this could possibly be a webpack 5 issue.. but it builds successfully both locally and through the action.. it is just the deploy piece that is jacked up. Possibly need to enable the ability to flip up to node 16?? but it looks like app service only supports 14LTS?

`Using Node version: v14.15.1

Using Yarn version: 1.22.10

Running 'yarn install --prefer-offline'...

yarn install v1.22.10 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.3.2: The platform "linux" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning "@zeit/next-css > css-loader@1.0.0" has unmet peer dependency "webpack@^4.0.0". warning "@zeit/next-css > mini-css-extract-plugin@0.4.3" has unmet peer dependency "webpack@^4.4.0". warning " > react-beautiful-dnd@13.0.0" has incorrect peer dependency "react@^16.8.5". warning " > react-beautiful-dnd@13.0.0" has incorrect peer dependency "react-dom@^16.8.5". warning " > react-big-calendar@0.28.5" has incorrect peer dependency "react@^16.6.1". warning " > react-big-calendar@0.28.5" has incorrect peer dependency "react-dom@^16.6.1". warning "react-flow-renderer > easy-peasy@4.0.1" has incorrect peer dependency "react@^16.8.0". warning " > yup-phone@1.2.19" has incorrect peer dependency "yup@^0.27.0". warning " > eslint-loader@4.0.2" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". warning " > raw-loader@4.0.2" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". warning "ts-migrate > ts-migrate-plugins > jscodeshift@0.12.0" has unmet peer dependency "@babel/preset-env@^7.1.6". warning " > url-loader@4.1.1" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". [4/4] Building fresh packages... Done in 239.00s.

Running 'yarn run build'...

yarn run v1.22.10 $ next build info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5 info - Checking validity of types... info - Creating an optimized production build... An unknown error has occurred. Check the diagnostic log for details. 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.`

Any insight would be helpful.. on a short timeline here.. and now on like day 3 of failed deployments

ArieJones commented 3 years ago

I have also tried to use VC Deploy to Azure package since that uses zip deploy and I was wondering if I would get better results.. but it seems as if that one is failing as well.. same generic error with nothing in the logs to point a way forward

ArieJones commented 3 years ago

I have finally got it going again... it seems that Azure App Service is having an issue with webpack 5. I haven't the fainest what it is .. but if I disable webpack 5 and make the nextjs proejct use the older 4 then it will finally deploy without error.

I would maybe guess that it has to do with App Service only supporting Node 14 LTS. It would help if maybe the error messages or logging were a little clearer on what was happening and also if we had the ability to chose the desired Node version like we can in the build service.

github-actions[bot] commented 3 years ago

This issue is idle because it has been open for 14 days with no activity.

BALAGA-GAYATRI commented 3 years ago

@ehamai @JasonFreeberg Does App Service supports only Node 14LTS? The above comments says so. Your thoughts?

rtomlinii-landrys commented 3 years ago

What is this status of this bug? When I try to deploy a file of .zip type, I get an error saying this file isn't supported. I can add images if need be.

github-actions[bot] commented 3 years ago

This issue is idle because it has been open for 14 days with no activity.

danmana commented 2 years ago

I had the same issue with a Node+Angular app and App Service with Node 16 ... but it magically went away overnight.

Package deployment using ZIP Deploy initiated.
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.

It could have been some mixup with a previous canceled build ... as I was trying different things and canceled some builds that were taking too long. The next day pushing just a readme change triggered a successful build.

Now the build works fine, I just wanted to add here the info about canceled builds.

github-actions[bot] commented 2 years ago

This issue is idle because it has been open for 14 days with no activity.

github-actions[bot] commented 2 years ago

This issue is idle because it has been open for 14 days with no activity.

viliusvig commented 2 years ago

The same issue occurred deploying a .NET 6 application, however the next run completed successfully

github-actions[bot] commented 2 years ago

This issue is idle because it has been open for 14 days with no activity.

shpraka commented 1 year ago

@bjomi Are you using Windows? Is it still happening?

github-actions[bot] commented 1 year ago

This issue is idle because it has been open for 14 days with no activity.

kumaraksh1 commented 1 year ago

@bjomi we are closing this issue for now. You can always re-create/re-open the issue.