Azure / Azure/data-api-builder
DataApiBuilderException: Cannot obtain Schema for entity with underlying database object source: due to: Connection Timeout Expired.
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 8
Description
### What happened?
Single Web Aapp - hosted Blazor WASM
DAB - hosted on Container App - one container, one single revision.
1. Everything connected and setup, scaled to 1 revision running.
2. Wait some time until scaled back to 0 - no traffic.
3. Make call from SWA - revision failed to scale to 1 - timeout error.
4. After next few calls from SWA, revision scaled to 1 and response received.
### Version
0.10.21
### What database are you using?
Azure SQL
### What hosting model are you using?
Container Apps
### Which API approach are you accessing DAB through?
REST
### Relevant log output
```Text
[41m[30mfail[39m[22m[49m: Azure.DataApiBuilder.Service.Startup[0]
12.04.2024, 12:49:51.964
Unable to complete runtime initialization. Refer to exception for error details.
12.04.2024, 12:49:51.964
Azure.DataApiBuilder.Service.Exceptions.DataApiBuilderException: Cannot obtain Schema for entity Customer with underlying database object source: SalesLT.Customer due to: Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=114; handshake=575; [Login] initialization=1; authentication=6; [Post-Login] complete=14231;
12.04.2024, 12:49:51.964
at Azure.DataApiBuilder.Core.Services.SqlMetadataProvider`3.HandleOrRecordException(Exception e) in /src/src/Core/Services/MetadataProviders/SqlMetadataProvider.cs:line 90
12.04.2024, 12:49:51.964
at Azure.DataApiBuilder.Core.Services.SqlMetadataProvider`3.PopulateObjectDefinitionForEntities() in /src/src/Core/Services/MetadataProviders/SqlMetadataProvider.cs:line 919
12.04.2024, 12:49:51.964
at Azure.DataApiBuilder.Core.Services.SqlMetadataProvider`3.InitializeAsync() in /src/src/Core/Services/MetadataProviders/SqlMetadataProvider.cs:line 273
12.04.2024, 12:49:51.964
at Azure.DataApiBuilder.Core.Services.MetadataProviders.MetadataProviderFactory.InitializeAsync() in /src/src/Core/Services/MetadataProviders/MetadataProviderFactory.cs:line 64
12.04.2024, 12:49:51.964
at Azure.DataApiBuilder.Service.Startup.PerformOnConfigChangeAsync(IApplicationBuilder app) in /src/src/Service/Startup.cs:line 599
12.04.2024, 12:49:51.964
[41m[30mfail[39m[22m[49m: Azure.DataApiBuilder.Service.Startup[0]
12.04.2024, 12:49:51.964
Could not initialize the engine with the runtime config file: ./swa-db-connections/dab.config.json
12.04.2024, 12:49:51.964
[40m[32minfo[39m[22m[49m: Microsoft.Hosting.Lifetime[0]
12.04.2024, 12:49:51.964
Application is shutting down...
```
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Contributor guide
Assessment
This issue has not been assessed yet.