1
votes

I am receiving below error when function app is running on the run-time version "2.0.12701.0" (FUNCTIONS_EXTENSION_VERSION = ~2 in App Settings). As soon I change the FUNCTIONS_EXTENSION_VERSION to 2.0.12673.0 in App Settings. function starts working without any code change or deployment.

Error:

DryIoc.ContainerException : Scope disposed{no name, Parent=disposed{no name, Parent=disposed{no name}}} is disposed and scoped instances are disposed and no longer available. at DryIoc.Throw.It(Int32 error,Object arg0,Object arg1,Object arg2,Object arg3) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 8991 at DryIoc.Scope.TryGet(Object& item,Int32 id) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 7881 at DryIoc.Container.InstanceFactory.GetAndUnwrapOrDefault(IScope scope,Int32 factoryId) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 1480 at DryIoc.Container.InstanceFactory.GetInstanceFromScopeChainOrSingletons(IResolverContext r) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 1466 at DryIoc.Container.ResolveAndCacheDefaultFactoryDelegate(Type serviceType,IfUnresolved ifUnresolved) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 224 at DryIoc.Container.DryIoc.IResolver.Resolve(Type serviceType,IfUnresolved ifUnresolved) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 195 at DryIoc.Resolver.Resolve[TService](IResolver resolver,IfUnresolved ifUnresolved) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 4742 at DryIoc.Microsoft.DependencyInjection.DryIocAdapter.<>c__DisplayClass3_0.b__0(IResolverContext r) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\DryIocAdapter.cs : 156 at DryIoc.Registrator.<>c__DisplayClass27_0.b__0(IResolverContext r) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 4541 at lambda_method(Closure ,IResolverContext ) at DryIoc.Factory.<>c__DisplayClass26_1.b__2() at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 6596 at DryIoc.Scope.TryGetOrAdd(ImMap1 items,Int32 id,CreateScopedValue createValue,Int32 disposalOrder) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 7840 at DryIoc.Scope.GetOrAdd(Int32 id,CreateScopedValue createValue,Int32 disposalOrder) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 7825 at DryIoc.Factory.ApplyReuse(Expression serviceExpr,Request request) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 6595 at DryIoc.Factory.GetExpressionOrDefault(Request request) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 6555 at DryIoc.Factory.GetDelegateOrDefault(Request request) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 6625 at DryIoc.DelegateFactory.GetDelegateOrDefault(Request request) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 7731 at DryIoc.Container.DryIoc.IResolver.Resolve(Type serviceType,Object serviceKey,IfUnresolved ifUnresolved,Type requiredServiceType,Request preResolveParent,Object[] args) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 290 at lambda_method(Closure ) at DryIoc.Scope.TryGetOrAdd(ImMap1 items,Int32 id,CreateScopedValue createValue,Int32 disposalOrder) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 7840 at DryIoc.Scope.GetOrAdd(Int32 id,CreateScopedValue createValue,Int32 disposalOrder) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 7825 at lambda_method(Closure ,IResolverContext ) at DryIoc.Container.ResolveAndCacheDefaultFactoryDelegate(Type serviceType,IfUnresolved ifUnresolved) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 224 at DryIoc.Container.DryIoc.IResolver.Resolve(Type serviceType,IfUnresolved ifUnresolved) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\DryIoc\Container.cs : 195 at Microsoft.Azure.WebJobs.Script.WebHost.DependencyInjection.ScopedServiceProvider.GetService(Type serviceType) at C:\azure-webjobs-sdk-script\src\WebJobs.Script.WebHost\DependencyInjection\ScopedServiceProvider.cs : 25 at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp,Type type,Type requiredBy,Boolean isDefaultParameterRequired) at lambda_method(Closure ,IServiceProvider ,Object[] ) at Microsoft.Azure.WebJobs.Host.Executors.DefaultJobActivator.CreateInstance[T](IServiceProvider serviceProvider) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\DefaultJobActivator.cs : 37 at Microsoft.Azure.WebJobs.Host.Executors.DefaultJobActivator.CreateInstance[T](IFunctionInstanceEx functionInstance) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\DefaultJobActivator.cs : 32 at Microsoft.Azure.WebJobs.Host.Executors.ActivatorInstanceFactory1.<>c__DisplayClass1_1.<.ctor>b__0(IFunctionInstanceEx i) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\ActivatorInstanceFactory.cs : 20 at Microsoft.Azure.WebJobs.Host.Executors.ActivatorInstanceFactory1.Create(IFunctionInstanceEx functionInstance) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\ActivatorInstanceFactory.cs : 26 at Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`2.CreateInstance(IFunctionInstanceEx functionInstance) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionInvoker.cs : 44 at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ParameterHelper.Initialize() at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs : 846 at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.TryExecuteAsyncCore(IFunctionInstanceEx functionInstance,CancellationToken cancellationToken) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Executors\FunctionExecutor.cs : 116

Changing the Function run-time version (FUNCTIONS_EXTENSION_VERSION =2.0.12673.0) in App Setting from default run-time version 2.0.12701.0 fixed the issue.

This is my Function App Startup class which register dependencies.

 public class FunctionAppStartup : FunctionsStartup
    {
        public override void Configure(IFunctionsHostBuilder builder)
        {
            var config = new ConfigurationBuilder()
                                .SetBasePath(Environment.CurrentDirectory)
                                .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
                                .AddJsonFile("secret.settings.json", optional: true, reloadOnChange: true)
                                .AddEnvironmentVariables()
                                .Build();

            builder.Services.Configure<ConfigurationManager>(x => config.Bind(x));
            builder.Services.AddSingleton<Contracts.IConfiguration>(resolver =>
                resolver.GetRequiredService<IOptions<ConfigurationManager>>().Value);

            builder.Services.AddScoped<IChannelAdapter, ChannelAdapter>();
            builder.Services.AddScoped<ITableStorageManager, TableStorageManager>();
            builder.Services.AddSingleton<IDatabaseContext, DatabaseContext>();
            builder.Services.AddScoped<IJobRepository, JobRepository>();
        }
    }

Expecting my function app to run on the latest run-time version instead of me targeting a minor run-time version.

1
Thanks for the report @SIDHU. I've created github.com/Azure/azure-functions-host/issues/4989 so we can try to reproduce what you're seeing. Would you mind following up with me there?brettsam
This issue is now fixed with the latest release of azure function run-time. github.com/Azure/azure-functions-host/issues/5060SIDHU

1 Answers

1
votes

Fro now, you couldn't use this runtime version.

Cause even this is a latest released version, however it's not updated to production site. Please check the release note.

Note: This release is not yet in production but will be deploying over the next few days. These release notes will be updated when it has been deployed to all production sites.

When it's updated, the official will update the note. So the latest available version is 2.0.12673.