Azure / functions-action

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

Unable to deploy function app to azure. Getting 'Internal Server Error (CODE: 500)' #113

Closed kimj04 closed 2 years ago

kimj04 commented 2 years ago

I am trying to deploy function app to the Function App service in Azure. I am getting this error.

Successfully parsed SCM credential from old 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 . into /home/runner/work/_temp/temp_web_package_7979426040970914.zip as function app content Will use Kudu https:///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 500 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 19 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 18 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 17 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 16 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 15 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 14 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 13 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 12 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 11 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 10 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 9 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 8 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 7 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 6 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 5 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 4 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 3 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 2 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 1 App setting SCM_DO_BUILD_DURING_DEPLOYMENT has not been propagated to Kudu container yet, remaining retry 0 Warning: App setting SCM_DO_BUILD_DURING_DEPLOYMENT fails to propagate to Kudu container Setting ENABLE_ORYX_BUILD in Kudu container to true Update using Client.updateAppSettingViaKudu Response with status code 500 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 19 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 18 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 17 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 16 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 15 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 14 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 13 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 12 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 11 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 10 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 9 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 8 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 7 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 6 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 5 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 4 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 3 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 2 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 1 App setting ENABLE_ORYX_BUILD has not been propagated to Kudu container yet, remaining retry 0 Warning: App setting ENABLE_ORYX_BUILD fails to propagate to Kudu container Package deployment using ZIP Deploy initiated. Error: Failed to deploy web package to App Service. Warning: Error: Failed to update deployment history. Internal Server Error (CODE: 500) 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_7979426040970914.zip as ZipDeploy content Error: Failed to deploy web package to App Service. Internal Server Error (CODE: 500) Error: Error: Failed to deploy web package to App Service. Internal Server Error (CODE: 500) at Kudu. (/home/runner/work/_actions/Azure/functions-action/v1.4.3/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js:175:23) at Generator.next () at fulfilled (/home/runner/work/_actions/Azure/functions-action/v1.4.3/node_modules/azure-actions-appservice-rest/Kudu/azure-app-kudu-service.js:5:58) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) Error: Deployment Failed!

Here is my yaml file.

name: Deploy to Dev

on: push: branches:

env: AZURE_FUNCTIONAPP_NAME: azure-function-app-sample NODE_VERSION: '12.x' AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' AZURE_CREDENTIALS: ${{ secrets.DEV_CREDENTIALS }}

jobs: build-and-deploy: runs-on: ubuntu-latest steps:

I see this in the log from Deployment Center in the function app service.

Failed to load deployment logs: {"Message":"An error has occurred.","ExceptionMessage":"An error occurred when trying to create a controller of type 'DeploymentController'. Make sure that the controller has a parameterless public constructor.","ExceptionType":"System.InvalidOperationException","StackTrace":" at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)\r\n at System.Web.Http.Controllers.HttpControllerDescriptor.CreateController(HttpRequestMessage request)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d1.MoveNext()","InnerException":{"Message":"An error has occurred.","ExceptionMessage":"Access to the path 'C:\home\LogFiles\kudu\deployment' is denied.","ExceptionType":"System.UnauthorizedAccessException","StackTrace":" at System.IO.Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)\r\n at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)\r\n at System.IO.Directory.CreateDirectory(String path)\r\n at System.IO.Abstractions.DirectoryWrapper.CreateDirectory(String path)\r\n at Kudu.Core.Infrastructure.FileSystemHelpers.CreateDirectory(String path) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\FileSystemHelpers.cs:line 32\r\n at Kudu.Core.Environment.get_DeploymentTracePath() in C:\Kudu Files\Private\src\master\Kudu.Core\Environment.cs:line 297\r\n at Kudu.Services.Web.App_Start.NinjectServices.GetLogger(IEnvironment environment, IKernel kernel) in C:\Kudu Files\Private\src\master\Kudu.Services.Web\App_Start\NinjectServices.cs:line 775\r\n at Kudu.Services.Web.App_Start.NinjectServices.<>cDisplayClass10_0.b__13(IContext context) in C:\Kudu Files\Private\src\master\Kudu.Services.Web\App_Start\NinjectServices.cs:line 280\r\n at Ninject.Activation.Providers.CallbackProvider1.CreateInstance(IContext context)\r\n at Ninject.Activation.Provider1.Create(IContext context)\r\n at Ninject.Activation.Context.ResolveInternal(Object scope)\r\n at Ninject.Activation.Context.Resolve()\r\n at Ninject.KernelBase.<>cDisplayClass15.bf(IBinding binding)\r\n at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()\r\n at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source)\r\n at Ninject.Planning.Targets.Target1.GetValue(Type service, IContext parent)\r\n at Ninject.Planning.Targets.Target1.ResolveWithin(IContext parent)\r\n at Ninject.Activation.Providers.StandardProvider.GetValue(IContext context, ITarget target)\r\n at Ninject.Activation.Providers.StandardProvider.<>cDisplayClass4.b2(ITarget target)\r\n at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext()\r\n at System.Linq.Buffer1..ctor(IEnumerable1 source)\r\n at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)\r\n at Ninject.Activation.Providers.StandardProvider.Create(IContext context)\r\n at Ninject.Activation.Context.ResolveInternal(Object scope)\r\n at Ninject.Activation.Context.Resolve()\r\n at Ninject.KernelBase.<>cDisplayClass15.bf(IBinding binding)\r\n at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()\r\n at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source)\r\n at Ninject.Planning.Targets.Target1.GetValue(Type service, IContext parent)\r\n at Ninject.Planning.Targets.Target1.ResolveWithin(IContext parent)\r\n at Ninject.Activation.Providers.StandardProvider.GetValue(IContext context, ITarget target)\r\n at Ninject.Activation.Providers.StandardProvider.<>cDisplayClass4.b2(ITarget target)\r\n at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext()\r\n at System.Linq.Buffer1..ctor(IEnumerable1 source)\r\n at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)\r\n at Ninject.Activation.Providers.StandardProvider.Create(IContext context)\r\n at Ninject.Activation.Context.ResolveInternal(Object scope)\r\n at Ninject.Activation.Context.Resolve()\r\n at Ninject.KernelBase.<>cDisplayClass15.b__f(IBinding binding)\r\n at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()\r\n at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source)\r\n at Ninject.ResolutionExtensions.TryGet[T](IEnumerable1 iterator)\r\n at Kudu.Services.Web.Services.NinjectDependencyScope.GetService(Type serviceType) in C:\\Kudu Files\\Private\\src\\master\\Kudu.Services.Web\\Services\\NinjectWebApiDependencyResolver.cs:line 40\r\n at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.GetInstanceOrActivator(HttpRequestMessage request, Type controllerType, Func1& activator)\r\n at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)"}}

Not sure if the error message is related. Do I need to configure anything in my Function App Service or in the repository or my yaml file?

Thanks.

patelchandni commented 2 years ago

@kimj04 I see you are using v1.4.3 which had this bug. Please switch to v1 for the latest version that has this fix.