Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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." #42

Open
v-sherryfan opened this issue Nov 6, 2023 · 2 comments

Comments

@v-sherryfan
Copy link

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.

@karolz-ms
Copy link
Member

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.

@v-sherryfan
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants