eShop
eShop copied to clipboard
[WebToolsE2E][Aspire] After running eshop.web solution, some error logs appear in structured logs: "An error occurred using the connection to database 'postgres' on server."
INSTALL STEPS
- Clean machine: Win11 x64 23h2 ENU
- Install VS 17.9 P1 from build [34303.117.d17.9]
- Install latest 8.0 SDK: 8.0.100
- Apply NuGet Feeds
- Install Docker Desktop
REPRO STEPS
- In the VS, clone the eShop repository and open eShop.Web.slnf
- F5 / Ctrl-F5
- There are some error logs 'an error occured using the connection to database 'postgres' on server' in Structured Logs
ACTUAL
Fatal error establishing database connection
An error occurred using the connection to database 'postgres' on server 'tcp://localhost:56882'.
EXPECTED
There are no errors in Structured Logs.
This might be similar to the issue we have encountered with Redis: because containers are proxied by DCP by default, the establishment of a connection to "Postgres" (actually the proxy in front of the Postgres container) succeeds, but then the proxy immediately drops it because the Postgres container is not ready.
We have post-preview work item on DCP side to stop using the proxy for singleton containers. This will still result in delayed start potentially (any container might be slow to start if an image download is necessary), but the clients will receive more ordinary connection failure error that should result in a connection retry.
For now this one is "by design" as long as the application recovers eventually (when the Postgres container runs). If the application never recovers, then it is a different issue and someone should investigate.
The error that failed to connect to the database "postgres" no longer appears.