eShop icon indicating copy to clipboard operation
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."

Open v-sherryfan opened this issue 9 months ago • 2 comments

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.9 P1 from build [34303.117.d17.9]
  3. Install latest 8.0 SDK: 8.0.100
  4. Apply NuGet Feeds
  5. Install Docker Desktop

REPRO STEPS

  1. In the VS, clone the eShop repository and open eShop.Web.slnf
  2. F5 / Ctrl-F5
  3. 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'. image

EXPECTED

There are no errors in Structured Logs.

v-sherryfan avatar Nov 06 '23 08:11 v-sherryfan

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.

karolz-ms avatar Nov 06 '23 23:11 karolz-ms

The error that failed to connect to the database "postgres" no longer appears.

v-sherryfan avatar Nov 14 '23 05:11 v-sherryfan