Azure / Azure/data-api-builder
[Bug]: When Hot-Reload fails the entities are not re-populated
- Lenguaje dominante
- C#
- Estrellas
- 1.5k
- Forks
- 370
- Merge medio
- 3 d 22 h
- PR fusionados (30 d)
- 9
Descripción
### What happened?
After updating the config file and the hot-reload fails after the `ValidateConfig` function inside the `RuntimeConfigProvider.cs` DAB doesn't repopulate the entities as they were previously set up before the hot-reload. At first I thought it was a problem specifically related to autoentities, but after doing some more testing this is an issue related to entities in general. Which means that after hot-reload fails we cannot access any entity at all.
### Version
2.0.0
### What database are you using?
Azure SQL
### What hosting model are you using?
_No response_
### Which API approach are you accessing DAB through?
REST
### Relevant log output
```Text
Loading config file from C:\Users\rcernaserna\DAB\data-api-builder\src\Service\dab-config.MsSql.json.
Validating hot-reloaded configuration file.
Unable to hot reload configuration file due to One or more errors occurred. (One or more errors occurred. (Object reference not set to an instance of an object.))
fail: Azure.DataApiBuilder.Service.Controllers.RestController[0]
7beb312f-3dda-464b-8ddf-395cf9cbb46d Error handling REST request.
Azure.DataApiBuilder.Service.Exceptions.DataApiBuilderException: Invalid Entity path: Booksbooks.
at Azure.DataApiBuilder.Core.Services.RestService.GetEntityNameAndPrimaryKeyRouteFromRoute(String routeAfterPathBase) in C:\Users\rcernaserna\DAB\data-api-builder\src\Core\Services\RestService.cs:line 493
at Azure.DataApiBuilder.Service.Controllers.RestController.HandleOperation(String route, EntityActionOperation operationType) in C:\Users\rcernaserna\DAB\data-api-builder\src\Service\Controllers\RestController.cs:line 263
fail: Azure.DataApiBuilder.Service.Controllers.RestController[0]
9f3fe501-298f-4259-97e1-f020063b8c7b Error handling REST request.
Azure.DataApiBuilder.Service.Exceptions.DataApiBuilderException: Invalid Entity path: publisher.
at Azure.DataApiBuilder.Core.Services.RestService.GetEntityNameAndPrimaryKeyRouteFromRoute(String routeAfterPathBase) in C:\Users\rcernaserna\DAB\data-api-builder\src\Core\Services\RestService.cs:line 493
at Azure.DataApiBuilder.Service.Controllers.RestController.HandleOperation(String route, EntityActionOperation operationType) in C:\Users\rcernaserna\DAB\data-api-builder\src\Service\Controllers\RestController.cs:line 263
```
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Guía de contribución
Línea de trabajo
Comienza con RuntimeConfigProvider.cs, especialmente con ValidateConfig, y reproduce el hot-reload fallido usando dab-config.MsSql.json. Sigue el fallo de búsqueda de entidades resultante a través de RestService.cs en la línea 493 y la ruta de la solicitud REST. Se considera completado cuando las entidades siguen disponibles después de un hot-reload no válido y las solicitudes REST ya no informan de rutas de entidad no válidas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- azure, csharp, sql
- Área
- api, backend, database
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100