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

Abierto
#2,260 7 comentarios 0 reacciones 1 asignado Reclamado por @abhishekkumams Ver en GitHub
🛠️troubleshooting bug cri
Lenguaje dominante
C#
Estrellas
1.5k
Forks
370
Merge medio
3 d 22 h
PR fusionados (30 d)
9

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.