Azure / Azure/data-api-builder
[Bug]: Error message 'Could not initialize the engine with the runtime config file: dab-config.json' isn't clear enough
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 8
Description
### What happened?
Running latest docker image with the provided example from here https://learn.microsoft.com/en-us/azure/data-api-builder/how-to-run-container
Only alteration I made was to the password in the file.
{
"$schema": "https://github.com/Azure/data-api-builder/releases/latest/download/dab.draft.schema.json",
"data-source": {
"database-type": "mssql",
"connection-string": "Server=host.docker.internal\\mssql,1433;Initial Catalog=Library;User Id=sa;Password=;TrustServerCertificate=true;"
},
"entities": {
"book": {
"source": "dbo.Books",
"permissions": [
{
"actions": [
"read"
],
"role": "anonymous"
}
]
}
}
}
Main issue is that the error message is too abstract in that it doesn't say anything useful to the 'end user' on what is the issue with the config file.
### Version
1.1.7
### What database are you using?
Azure SQL
### What hosting model are you using?
Container Apps, Custom Docker host
### Which API approach are you accessing DAB through?
REST, GraphQL
### Relevant log output
```Text
Starting the runtime engine...
Loading config file from dab-config.json.
warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {2abf94d1-f041-473a-9bbc-d440b03ca439} may be persisted to storage in unencrypted form.
fail: Azure.DataApiBuilder.Service.Startup[0]
Unable to complete runtime initialization. Refer to exception for error details.
System.NullReferenceException: Object reference not set to an instance of an object.
at Azure.DataApiBuilder.Core.Configurations.RuntimeConfigValidator.ValidateAppInsightsTelemetryConnectionString(RuntimeConfig runtimeConfig) in /_/src/Core/Configurations/RuntimeConfigValidator.cs:line 128
at Azure.DataApiBuilder.Core.Configurations.RuntimeConfigValidator.ValidateConfigProperties() in /_/src/Core/Configurations/RuntimeConfigValidator.cs:line 84
at Azure.DataApiBuilder.Service.Startup.PerformOnConfigChangeAsync(IApplicationBuilder app) in /_/src/Service/Startup.cs:line 602
fail: Azure.DataApiBuilder.Service.Startup[0]
Could not initialize the engine with the runtime config file: dab-config.json
info: Microsoft.Hosting.Lifetime[0]
Application is shutting down...
Unable to launch the Data API builder engine.
```
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Contributor guide
Assessment
This issue has not been assessed yet.