Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.94k stars 442 forks source link

Azure Functions Host 1036 results in a 500 Error on a PUT to /admin/functions #10631

Open FinVamp1 opened 4 days ago

FinVamp1 commented 4 days ago

Check for a solution in the Azure portal

For issues in production, please check for a solution to common issues in the Azure portal before opening a bug. In the Azure portal, navigate to your function app, select Diagnose and solve problems from the left, and view relevant dashboards before opening your issue.

Investigative information

Please provide the following:

Repro steps

Provide the steps required to reproduce the problem:

1) Create a new Function App targeting Node 18 or 20 to allow Portal Create. 2) Try and add a Function via the Portal and see that it fails with 500 Server error. 3) The Function does get created but the Script Host restarts. 4) Pin back to 4.36.0 and try step 2 again. There are no errors.

Expected behavior

Provide a description of the expected behavior.

1) The Function create should not result in a 500 Server error.

Actual behavior

Provide a description of the actual behavior observed.

1) The Portal Function Function creation calls /admin/functions and this call returrns a 500 error but the files do get created. 2) The Host detects a file change notification from the Put and Initiates a restart. 3) There is an exception during the restart with this call stack.

System.ObjectDisposedException : Cannot access a disposed object. Object name: 'IServiceProvider'. at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException() at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier,ServiceProviderEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider,Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Microsoft.AspNetCore.Mvc.ObjectResult.ExecuteResultAsync(ActionContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultAsync(IActionResult result) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next,Scope& scope,Object& state,Boolean& isCompleted)

The ARM Template is from DataDog and an example deployment creates the Files in the ARM Template e.g datadog-serverless-functions/azure/deploy-to-azure/function_template.json at master · DataDog/datadog-serverless-functions

Known workarounds

Provide a description of any known workarounds.

Pin back to 4.36

Related information

Provide any related information

liliankasem commented 3 days ago

Thanks Finbar, I am able to repro. It looks like this is an emerging issue and the CRI loop is already investigating.