Azure / Azure/data-api-builder

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

Open
#3,296 0 comments 0 reactions 0 assignees View on GitHub
bug triage
Dominant language
C#
Stars
1.5k
Forks
370
Avg merge
3d 17h
Merged PRs (30d)
8

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.