Azure / Azure/data-api-builder
[Bug]: When Hot-Reload fails the entities are not re-populated
- Lingua principale
- C#
- Stelle
- 1.5k
- Fork
- 370
- Merge medio
- 3g 17h
- PR unite (30g)
- 8
Descrizione
### 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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da RuntimeConfigProvider.cs, in particolare da ValidateConfig, e riproduci il hot-reload non riuscito usando dab-config.MsSql.json. Traccia l'errore di ricerca dell'entità risultante attraverso RestService.cs alla riga 493 e il percorso della richiesta REST. Il lavoro è completato quando le entità rimangono disponibili dopo un hot-reload non valido e le richieste REST non segnalano più percorsi di entità non validi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, csharp, sql
- Ambito
- api, backend, database
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100