Azure / Azure/data-api-builder

[Bug]: When Hot-Reload fails the entities are not re-populated

Offen
#3,296 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug triage
Vorherrschende Sprache
C#
Sterne
1.5k
Forks
370
Ø Merge
3 T. 22 Std.
Gemergte PRs (30 T.)
9

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit RuntimeConfigProvider.cs, insbesondere mit ValidateConfig, und reproduziere das fehlgeschlagene Hot-Reload mit dab-config.MsSql.json. Verfolge den daraus resultierenden Fehler bei der Entitätssuche durch RestService.cs in Zeile 493 und den REST-Anfragepfad. Fertig ist die Aufgabe, wenn Entitäten nach einem ungültigen Hot-Reload weiterhin verfügbar sind und REST-Anfragen keine ungültigen Entitätspfade mehr melden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, csharp, sql
Bereich
api, backend, database
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.