Replies: 1 comment 4 replies
-
@ericmqt I'm running into this exact issue... Did you ever resolve it? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary: My container consistently cannot resolve
login.microsoftonline.com
, although rarely it will succeed, while I am unable to replicate the issue running the app outside of the container.Base: mcr.microsoft.com/dotnet/aspnet:5.0
Build: mcr.microsoft.com/dotnet/sdk:5.0
Yesterday, I containerized one of our web apps, and I immediately ran into a head-scratcher.
This web app uses client certificates to authenticate to a back-end service. The web app obtains the client cert from KeyVault at application start-up using the
Azure.Security.KeyVault.Certificates
andAzure.Security.KeyVault.Secrets
packages (both version 4.2.0). This worked perfectly fine up until I containerized the app, where it consistently (but not always!) fails with the following:My initial thought was (being inexperienced with Docker) that I had a network configuration problem, and that the internet was not accessible to my containers or that they needed DNS configuration.
However, I can ping google.com just fine, I can use a System.Net.Http.HttpClient to pull the HTML from the google home page too. When the call to KeyVault fails, so too will an HttpClient attempt to pull HTML from login.microsoftonline.com. Container DNS and internet connectivity seems to be okay outside of this one hostname.
After much frustration yesterday, it finally started working before I was done for the day, and I thought I had fixed the problem (I changed the network defined in my docker-compose to a user-defined bridge, and magically it started working. Today I realized I defined the network incorrectly and that my change had not in fact connected the containers to my bridge). Worse, it was broken again this morning, having changed nothing since it had started working last night.
Then around 12PM ET today, it worked again. Briefly. My smoke-testing HttpClient pulled the HTML from login.microsoftonline.com and the KeyVault call succeeded! Then it failed again. Then it worked again! And now it has done nothing but fail.
Meanwhile I cannot replicate the error by running the app outside of the container at all, seemingly ruling out a problem with my internet connection or a widespread issue with
login.microsoftonline.com
.I'm at my wits' end here and I'm out of ideas for further diagnosis. The issue seems to be limited exclusively to this one hostname, exclusively to my containers, and not the host.
I'm not even sure this is the right place to be asking, I sort of doubt the images I'm using have anything special in them that would cause this problem, but it doesn't appear to be a bug in the Azure SDK and it doesn't appear to be an issue with my internet, DNS, or container networking configuration. I don't see any service alerts on Microsoft's end either.
Any ideas?
UPDATE:
I changed from WSL2 back-end to Hyper-V and the issue persists. Changed back to WSL2 and it worked once, then back to failing endlessly.
Running
host
from the container CLI resolveslogin.microsoftonline.com
just fine. So doesdig
.Quite infuriatingly, the below code with a breakpoint in each exception handler only breaks on the
login.microsoftonline.com
block:googleEntry
is returned as expected. "Name or service not known" thrown formsLoginEntry
.Beta Was this translation helpful? Give feedback.
All reactions