You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug]: data-source-files report Unhandled exception. System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
#2480
Open
1 task done
crushonme opened this issue
Nov 27, 2024
· 0 comments
When I use data-source-files to reference two configuration file, it report Unhandled exception. System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
top level configuration file is as below. I have used "dab validate" command to validate these two child configuration and there is no error. And I have confirmed that Entity names are unique across all configuration files.
dab validate -c dab-config-multi.json
Information: Microsoft.DataApiBuilder 1.2.14
Information: User provided config file: dab-config-multi.json
Information: Validating config file: dab-config-multi.json
Loading config file from dab-config-multi.json.
Unhandled exception. System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Azure.DataApiBuilder.Config.ObjectModel.RuntimeConfig..ctor(String Schema, DataSource DataSource, RuntimeEntities Entities, RuntimeOptions Runtime, DataSourceFiles DataSourceFiles) in /_/src/Config/ObjectModel/RuntimeConfig.cs:line 195
at .ctor(Object[])
at System.Text.Json.Serialization.Converters.LargeObjectWithParameterizedConstructorConverter`1.CreateObject(ReadStackFrame& frame)
at System.Text.Json.Serialization.Converters.ObjectWithParameterizedConstructorConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 utf8Json, JsonTypeInfo`1 jsonTypeInfo, Nullable`1 actualByteCount)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at Azure.DataApiBuilder.Config.RuntimeConfigLoader.TryParseConfig(String json, RuntimeConfig& config, ILogger logger, String connectionString, Boolean replaceEnvVar, String dataSourceName, Dictionary`2 datasourceNameToConnectionString, EnvironmentVariableReplacementFailureMode replacementFailureMode) in /_/src/Config/RuntimeConfigLoader.cs:line 73
at Azure.DataApiBuilder.Config.FileSystemRuntimeConfigLoader.TryLoadConfig(String path, RuntimeConfig& config, Boolean replaceEnvVar, String dataSourceName) in /_/src/Config/FileSystemRuntimeConfigLoader.cs:line 108
at Azure.DataApiBuilder.Config.FileSystemRuntimeConfigLoader.TryLoadKnownConfig(RuntimeConfig& config, Boolean replaceEnvVar, String dataSourceName) in /_/src/Config/FileSystemRuntimeConfigLoader.cs:line 145
at Azure.DataApiBuilder.Core.Configurations.RuntimeConfigProvider.TryGetConfig(RuntimeConfig& runtimeConfig) in /_/src/Core/Configurations/RuntimeConfigProvider.cs:line 125
at Azure.DataApiBuilder.Core.Configurations.RuntimeConfigValidator.TryValidateConfig(String configFilePath, ILoggerFactory loggerFactory) in /_/src/Core/Configurations/RuntimeConfigValidator.cs:line 155
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Cli.ConfigGenerator.IsConfigValid(ValidateOptions options, FileSystemRuntimeConfigLoader loader, IFileSystem fileSystem) in /_/src/Cli/ConfigGenerator.cs:line 1199
at Cli.Commands.ValidateOptions.Handler(ILogger logger, FileSystemRuntimeConfigLoader loader, IFileSystem fileSystem) in /_/src/Cli/Commands/ValidateOptions.cs:line 31
at Cli.Program.<>c__DisplayClass2_0.<Execute>b__5(ValidateOptions options) in /_/src/Cli/Program.cs:line 67
at CommandLine.ParserResultExtensions.MapResult[T1,T2,T3,T4,T5,T6,T7,T8,TResult](ParserResult`1 result, Func`2 parsedFunc1, Func`2 parsedFunc2, Func`2 parsedFunc3, Func`2 parsedFunc4, Func`2 parsedFunc5, Func`2 parsedFunc6, Func`2 parsedFunc7, Func`2 parsedFunc8, Func`2 notParsedFunc)
at Cli.Program.Execute(String[] args, ILogger cliLogger, IFileSystem fileSystem, FileSystemRuntimeConfigLoader loader) in /_/src/Cli/Program.cs:line 61
at Cli.Program.Main(String[] args) in /_/src/Cli/Program.cs:line 41
Version
1.2.14+c7ca8db8558a63919c530e454c8f18b45d5b931c
What database are you using?
Azure SQL
What hosting model are you using?
Local (including CLI)
Which API approach are you accessing DAB through?
GraphQL, REST
Relevant log output
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
What happened?
When I use data-source-files to reference two configuration file, it report Unhandled exception. System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
top level configuration file is as below. I have used "dab validate" command to validate these two child configuration and there is no error. And I have confirmed that Entity names are unique across all configuration files.
Full error log
Version
1.2.14+c7ca8db8558a63919c530e454c8f18b45d5b931c
What database are you using?
Azure SQL
What hosting model are you using?
Local (including CLI)
Which API approach are you accessing DAB through?
GraphQL, REST
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: