-
Notifications
You must be signed in to change notification settings - Fork 638
[WIP] Unhealthy redis and mysql even the container is running #9413
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
base: main
Are you sure you want to change the base?
Conversation
@copilot merge main, and try this again. |
Merge the |
@copilot continue working on this |
Co-authored-by: radical <1472+radical@users.noreply.github.com>
I've fixed the issue causing Redis and MySQL containers to show up as "Running (Unhealthy)". The problem was that health checks weren't configured with proper connection settings. For Redis, I added Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@@ -72,7 +72,9 @@ public static IResourceBuilder<MySqlServerResource> AddMySql(this IDistributedAp | |||
}); | |||
|
|||
var healthCheckKey = $"{name}_check"; | |||
builder.Services.AddHealthChecks().AddMySql(sp => connectionString ?? throw new InvalidOperationException("Connection string is unavailable"), name: healthCheckKey); | |||
builder.Services.AddHealthChecks().AddMySql( | |||
sp => (connectionString ?? throw new InvalidOperationException("Connection string is unavailable")) + ";Connect Timeout=30;AllowPublicKeyRetrieval=true", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot clean this code up a bit now so we have a method body to the callback, check that the connection string is null and then return the appended value. Also we probably don't need AllowPublicKeyRetrieval=true.
Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.
Original issue description:
Fixes #9392.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.