azure-functions-core-tools
azure-functions-core-tools copied to clipboard
func kubernetes deploy: System.NullReferenceException thrown by KedaV2Resource.GetDurableScalar
I am trying to deploy a KEDA Function for the first time just following the docs but am getting an exception.
Steps I followed (Ubuntu 18.04.6 LTS VM with az and docker installed, kubectl configured):
- sudo apt-get install azure-functions-core-tools-4
- func kubernetes install --namespace keda
- sudo snap install dotnet-sdk --classic
- git clone https://github.com/cloudydemos/flightaware.git
- cd flightaware/Functions
- (Manually create a local local.settings.json file)
- func kubernetes deploy --name flightaware-functions --registry cloudyflightaware.azurecr.io --image-name flightaware-functions:latest --dry-run --debug
Result:
dotnet build --output bin/output
System.NullReferenceException: Object reference not set to an instance of an object.
at Azure.Functions.Cli.Kubernetes.KEDA.V2.KedaV2Resource.GetDurableScalar(JObject hostJson)+MoveNext() in D:\a\1\s\src\Azure.Functions.Cli\Kubernetes\KEDA\V2\KedaV2Resource.cs:line 59
at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.TraverseList[TContext](IObjectDescriptor value, IObjectGraphVisitor
1 visitor, TContext context, Stack1 path) at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.TraverseObject[TContext](IObjectDescriptor value, IObjectGraphVisitor
1 visitor, TContext context, Stack1 path) at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.Traverse[TContext](Object name, IObjectDescriptor value, IObjectGraphVisitor
1 visitor, TContext context, Stack1 path) at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.TraverseProperties[TContext](IObjectDescriptor value, IObjectGraphVisitor
1 visitor, TContext context, Stack1 path) at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.TraverseObject[TContext](IObjectDescriptor value, IObjectGraphVisitor
1 visitor, TContext context, Stack1 path) at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.Traverse[TContext](Object name, IObjectDescriptor value, IObjectGraphVisitor
1 visitor, TContext context, Stack1 path) at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.TraverseProperties[TContext](IObjectDescriptor value, IObjectGraphVisitor
1 visitor, TContext context, Stack1 path) at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.TraverseObject[TContext](IObjectDescriptor value, IObjectGraphVisitor
1 visitor, TContext context, Stack1 path) at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.Traverse[TContext](Object name, IObjectDescriptor value, IObjectGraphVisitor
1 visitor, TContext context, Stack1 path) at YamlDotNet.Serialization.ObjectGraphTraversalStrategies.FullObjectGraphTraversalStrategy.YamlDotNet.Serialization.IObjectGraphTraversalStrategy.Traverse[TContext](IObjectDescriptor graph, IObjectGraphVisitor
1 visitor, TContext context)
at YamlDotNet.Serialization.SerializerBuilder.ValueSerializer.SerializeValue(IEmitter emitter, Object value, Type type)
at YamlDotNet.Serialization.Serializer.EmitDocument(IEmitter emitter, Object graph, Type type)
at YamlDotNet.Serialization.Serializer.Serialize(IEmitter emitter, Object graph)
at YamlDotNet.Serialization.Serializer.Serialize(TextWriter writer, Object graph)
at Azure.Functions.Cli.Kubernetes.KubernetesHelper.SerializeResources(IEnumerable`1 resources, OutputSerializationOptions outputFormat) in D:\a\1\s\src\Azure.Functions.Cli\Kubernetes\KubernetesHelpers.cs:line 491
at Azure.Functions.Cli.Actions.KubernetesActions.KubernetesDeployAction.RunAsync() in D:\a\1\s\src\Azure.Functions.Cli\Actions\KubernetesActions\KubernetesDeployAction.cs:line 152
at Azure.Functions.Cli.ConsoleApp.RunAsync[T](String[] args, IContainer container) in D:\a\1\s\src\Azure.Functions.Cli\ConsoleApp.cs:line 64
I am also getting this exact error message. Has anything been discovered on this since? It has only just started happening on one of my durable function containers. I'll revert to the older version and if the Azure Function Core Tools runs OK on that will try and work out the difference.
The reason this error message was appearing for me, was that the durable functions storage settings were removed from the host.json file. Once I put it back this message went away and it deployed properly.
"extensions": { "durableTask": { "storageProvider": { "type": "mssql", "connectionStringName": "SQLDB_Connection", "taskEventLockTimeout": "00:02:00", "createDatabaseIfNotExists": true } }