microsoft / Oryx

Build your repo automatically.
Other
748 stars 171 forks source link

Intermittent issue when deploying Azure functions using Github Actions #1845

Closed rpatilarch closed 8 months ago

rpatilarch commented 1 year ago

Bug Report

Successfully parsed SCM credential from publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
Successfully acquired app settings from function app (with SCM credential)!
Will archive v1/GO/Orchestrator/ into /home/runner/work/_temp/temp_web_package_9045459948020618.zip as function app content
Will use Kudu https://<scmsite>/api/zipdeploy to deploy since publish-profile is detected.
Setting SCM_DO_BUILD_DURING_DEPLOYMENT in Kudu container to true
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting SCM_DO_BUILD_DURING_DEPLOYMENT propagated to Kudu container
Setting ENABLE_ORYX_BUILD in Kudu container to true
Update using Client.updateAppSettingViaKudu
Response with status code 204
App setting ENABLE_ORYX_BUILD propagated to Kudu container
Package deployment using ZIP Deploy initiated.
Updating submodules.
Preparing deployment for commit id '41960ef7-9'.
PreDeployment: context.CleanOutputPath False
PreDeployment: context.OutputPath /home/site/wwwroot
Repository path is /tmp/zipdeploy/extracted
Running oryx build...
Command: oryx build /tmp/zipdeploy/extracted -o /tmp/build/expressbuild --platform python --platform-version 3.8.6 -i /tmp/8db00b52d679ded -p packagedir=.python_packages/lib/site-packages
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20220812.1, Commit: cdf6b1bef[16](https://github.com/xxxx/xxxxxxx5967d938f4, ReleaseTagName: 20220812.1

Build Operation ID: |9GPhqmTxHOM=.f7da47e2_
Repository Commit : 41960ef7-901b-477d-9f[18](https://github.com/xxxx

Detecting platforms...
Error: Oops... An unexpected error has occurred.
Error: Oops... An unexpected error has occurred.\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /tmp/build/expressbuild --platform python --platform-version 3.8.6 -i /tmp/8db00b52d679ded -p packagedir=.python_packages/lib/site-packages

Generating summary of Oryx build
Deployment Log file does not exist in /tmp/oryx-build.log
The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
Deployment Failed. deployer = GITHUB_ZIP_DEPLOY deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
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_90454599480[20](https://github.com/xxx/xxxx.zip as ZipDeploy content
Error:     Package deployment using ZIP Deploy failed. Refer logs for more details.
Error: Deployment Failed!
cormacpayne commented 1 year ago

@rpatilarch Hey Ravindra, apologies that you're running into this issue -- when you have a chance, would you mind answering the following questions:

MaxWilson commented 1 year ago

I have this same issue, when deploying an F# Azure (static web app) function via Azure/static-web-apps-deploy@v1. The code is essentially unchanged from last week when it deployed fine, but now it times out on the "Finished Upload. Polling on deployment." step. The same issue happened for a week or so around November of last year.

Example log: https://github.com/MaxWilson/POCDungeonDraw/actions/runs/4094911431/jobs/7061465470

I am not sure whether my static web app's Azure Function can be deployed via azure cli or portal, but that sounds like a worthwhile workaround. I will try. Edit: it looks like I cannot deploy separately because I am using Managed Functions, not Bring Your Own Functions, per documentation at https://learn.microsoft.com/en-us/azure/static-web-apps/apis-functions.

MaxWilson commented 1 year ago

As a workaround I upgraded to a standard plan and switched to Bring Your Own Functions. It took some work to get all the authentication/authorization configuration switched over but at least now deployment is reliably succeeding.

rpatilarch commented 1 year ago

@rpatilarch Hey Ravindra, apologies that you're running into this issue -- when you have a chance, would you mind answering the following questions:

  • What step in your GitHub Actions workflow is this error coming from?

    • e.g., is this coming from Azure/functions-action, Azure/functions-container-action, a custom script, etc.
  • What type of Python application are you attempting to build and deploy?

    • e.g., Conda, Django, Flask, etc.
  • Are you able to successfully build and deploy your application outside of GitHub Actions?

It is intermittent, and after re-trying a few times, we can deploy it.

philhagger commented 1 year ago

I have just had this start happening across a number of function apps that I deploy to using GitHub actions. These have been working no problems for months and I have had loads of problems in the last 24 hours. Has there been a change that might have impacted: Azure/functions-action@v1?

rpatilarch commented 1 year ago

My issue is resolved, after using the template given here. https://github.com/Azure/actions-workflow-samples/blob/master/FunctionApp/linux-python-functionapp-on-azure.yml

simonjj commented 8 months ago

We're closing this issue due to its age. If this is still impacting you please open a new issue and simply link back to this one.