Azure / Azure/data-api-builder
[Bug]: When Hot-Reload fails the entities are not re-populated
- 主要言語
- C#
- スター
- 1.5k
- フォーク
- 370
- 平均マージ
- 3日 22時間
- マージ済み PR(30日)
- 9
説明
### 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
コントリビューションガイド
調査の方向性
RuntimeConfigProvider.cs、特に ValidateConfig から始め、dab-config.MsSql.json を使用して失敗した hot-reload を再現します。その結果発生するエンティティ検索の失敗を、RestService.cs の 493 行目から REST リクエストパスまで追跡します。無効な hot-reload の後もエンティティが利用可能なままであり、REST リクエストで無効なエンティティパスが報告されなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- azure, csharp, sql
- 領域
- api, backend, database
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100