Runtime: ConnectAsync throws No such device or address exception

Created on 18 Aug 2019  路  10Comments  路  Source: dotnet/runtime

I have 2 .net core 2.2 applications running in Kubernetes cluster. The services use HttpClient.SendAsync to communicate with one another through Kubernetes services. The applications work well on bare-metals. However, the communication with HttpClient throws No such device or address exception. Here is one of the URLs used: http://svc-biz4xbackend:5002/api/v1/Identity/SessionValidate. I kubectl exec into the pod and curl the url and it works fine. Does this indicate that this could be a bug with .Net Core framework? Where should I start to debug?

area-System.Net

Most helpful comment

I don't see this error since I switched to HttpClientFactory by using services.AddHttpClient<>(). I am upgrading to .net core 3.0 now and will see if this happens.

All 10 comments

@khteh do you know if this happens in 3.0?

@khteh What OS is the container running on?

# cat /etc/os-release 
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
# uname -a
Linux biz4x-frontend-0 4.14.128-112.105.amzn2.x86_64 dotnet/corefx#1 SMP Wed Jun 19 16:53:40 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

also such error can be transient. it may be worth of collecting packet captures with `port 53' filter. You can also try to fetch data via using IP address instead of name to see if that makes difference,

No response in 3 weeks, closing.

@karelz why was this closed? Nobody asked a question that would merit a response? Also experiencing this issue.

I don't see this error since I switched to HttpClientFactory by using services.AddHttpClient<>(). I am upgrading to .net core 3.0 now and will see if this happens.

My issue appears to be a CoreDNS issue. Bouncing the pods fixed the issue.

@lfshr we "asked" for packet capture (see https://github.com/dotnet/corefx/issues/40396#issuecomment-522892189). It might have been formulated better as a clear question/ask.
Either way, even after closing the issue, nobody spoke up for 4 weeks ... sounds like it was a good decision to close it.

I don't see this error since I switched to HttpClientFactory by using services.AddHttpClient<>(). I am upgrading to .net core 3.0 now and will see if this happens.

Was upgrading helped?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omajid picture omajid  路  3Comments

chunseoklee picture chunseoklee  路  3Comments

GitAntoinee picture GitAntoinee  路  3Comments

jkotas picture jkotas  路  3Comments

bencz picture bencz  路  3Comments