Open dynamicdeploy opened 4 years ago
Tagging subscribers to this area: @dotnet/ncl Notify danmosemsft if you want to be subscribed.
do you use windows or Linux containers? Also did you verify general network connectivity and name resolution in the container? You can run Wireshark on on the host to see if you see ICMP message going out and back. This can possibly be also caused by your firewall.
I am using Linux containers. Actually if you see the dockerfile in the message, I am not specifying any container but downloading the base image from Microsoft. I check network connectivity to other containers and outside world before starting the application. dotnet core System.Net.Dns functions fail so I had to use an open source resolver which works. I feel the dns resolution problem and this one seems to be somewhat related because both are pointing to the dotnet core network library. Here are the things that work 1) Calling url using httpclient to https://www.microsoft.com and more 2) Database connection to other container and database running in the cloud 3) Calling Named url to a web service running on Azure container using HttpClient Things that don’t work 1) System.Net.Dns resolution functions 2) System.Net.NetworkInformation.Ping functions as copied in the original message. The ipaddress returned here is 0.0.0.0 Hope this helps Thanks Tej
Get Outlook for iOShttps://aka.ms/o0ukef
From: Tomas Weinfurt notifications@github.com Sent: Wednesday, June 10, 2020 10:43:28 PM To: dotnet/runtime runtime@noreply.github.com Cc: Tejaswi Redkar dynamicdeploy@live.com; Author author@noreply.github.com Subject: Re: [dotnet/runtime] System.Net.NetworkInformation.Ping.Send not working on docker (#37734)
do you use windows or Linux containers? Also did you verify general network connectivity and name resolution in the container? You can run Wireshark on on the host to see if you see ICMP message going out and back. This can possibly be also caused by your firewall.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fruntime%2Fissues%2F37734%23issuecomment-642421403&data=02%7C01%7C%7C7229dd25bb8640319c9a08d80dca5f72%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637274510115673788&sdata=YnxxoMd%2Bo07PCvEKmZapkFzFJrzlElDGfdGivNkVtzc%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAKUGTPU66ZVJQVFQ35LQ63RWBVIBANCNFSM4N3CSJNA&data=02%7C01%7C%7C7229dd25bb8640319c9a08d80dca5f72%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637274510115683780&sdata=zGwUxPoe8ZlnfXUMUD2WwXdmRFdJLHTPWbhjad5llWs%3D&reserved=0.
There is something wrong without your docker setup. I did run ping from your code as well as tried name resolution and that both work with the sdk:3.1 image.
I am using all default and there are other services like Postgres, Neo4j, etc all work well without a glitch. Did you run the traceroute code I sent? Anything you want me to try?
Get Outlook for iOShttps://aka.ms/o0ukef
From: Tomas Weinfurt notifications@github.com Sent: Thursday, June 11, 2020 11:52:29 AM To: dotnet/runtime runtime@noreply.github.com Cc: Tejaswi Redkar dynamicdeploy@live.com; Author author@noreply.github.com Subject: Re: [dotnet/runtime] System.Net.NetworkInformation.Ping.Send not working on docker (#37734)
There is something wrong without your docker setup. I did run ping from your code as well as tried name resolution and that both work with the sdk:3.1 image.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fruntime%2Fissues%2F37734%23issuecomment-642867410&data=02%7C01%7C%7C6e5f5a03f65446aca12308d80e3897ad%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637274983502923838&sdata=NG5M2Uee4ceYMcUOUTivlN%2Fv%2BMyJVZZMPYkb5yMGJms%3D&reserved=0, or unsubscribehttps://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAKUGTID4YTSYRSSOYJ7CP3RWERW3ANCNFSM4N3CSJNA&data=02%7C01%7C%7C6e5f5a03f65446aca12308d80e3897ad%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637274983502933831&sdata=Xe%2BJDqbgb%2FYe9BKuHja%2F2pNuBNXF5r81UMC5mrV3N7s%3D&reserved=0.
no, since that is not complete app. I put the ping fragment to simple console app. You can drop to the shell and try ping/traceroute from there. You can check if /etc/resolv.conf looks reasonable and nslookup works. You can run Wireshark on the host to see what traffic comes out and back.
Here is a simple test source code with the docker file https://github.com/dynamicdeploy/dotnetcoredocker It does the following: 1) Dns Resolution - Working 2) Ping - Working 3) Traceroute - Not working The same Traceroute should work fine on the desktop without any change. Output from running the program on the PC dotnet onerowcollector.dll www.microsoft.com
Resolving host.... Resolved www.microsoft.com to e13678.dspb.akamaiedge.net and ipaddress 2600:1406:3c:4af::356e Running ping... Address: 2600:1406:3c:4af::356e RoundTrip time: 16 Address: 2600:1406:3c:4af::356e RoundTrip time: 15 Address: 2600:1406:3c:4af::356e RoundTrip time: 13 Address: 2600:1406:3c:4af::356e RoundTrip time: 13 Address: 2600:1406:3c:4af::356e RoundTrip time: 13 Address: 2600:1406:3c:4af::356e RoundTrip time: 14 Address: 2600:1406:3c:4af::356e RoundTrip time: 13 Address: 2600:1406:3c:4af::356e RoundTrip time: 13 Address: 2600:1406:3c:4af::356e RoundTrip time: 12 Running traceroute... traceroute to www.microsoft.com, 15 hops max, 25 byte packets 1 64 ms 2001:558:4000:76::1 2 48 ms 2001:558:4000:76::1 3 35 ms 2001:558:82:d004::1 4 47 ms 2001:558:80:105a::1 5 61 ms 2001:558:80:1d1::1 6 68 ms 2001:558:80:197::1 7 68 ms 2001:558:0:f697::1 8 Request timed out. 9 Request timed out. 10 67 ms 2001:559:0:2d::26 11 50 ms 2600:1406:3c:4af::356e
Output from the container - Observe the traceroute results at the bottom.
C:\src\datarobo\Xintel\Xintel\onerowcollector\bin\Release\netcoreapp3.1\publish>docker run -it --rm tredkar/onerowcollector:1.0 Resolving host.... Resolved www.microsoft.com to e13678.dspb.akamaiedge.net and ipaddress 184.26.130.117 Running ping... Address: 184.26.130.117 RoundTrip time: 44 Address: 184.26.130.117 RoundTrip time: 103 Address: 184.26.130.117 RoundTrip time: 30 Address: 184.26.130.117 RoundTrip time: 46 Address: 184.26.130.117 RoundTrip time: 31 Address: 184.26.130.117 RoundTrip time: 18 Address: 184.26.130.117 RoundTrip time: 17 Address: 184.26.130.117 RoundTrip time: 30 Address: 184.26.130.117 RoundTrip time: 53 Running traceroute... *traceroute to www.microsoft.com, 15 hops max, 25 byte packets 1 Request timed out. 2 Request timed out. 3 Request timed out. 4 Request timed out. 5 Request timed out. 6 Request timed out. 7 Request timed out. 8 Request timed out. 9 Request timed out. 10 Request timed out. 11 Request timed out. 12 359 ms 184.26.130.117**
did you try system traceroute? (apt install traceroute)
I found someone else facing a similar issue. I could reproduce the same on my container https://stackoverflow.com/questions/60960067/cant-traceroute-from-linux-docker-in-windows-host Also, seems like there is a fix on Docker for Mac but still fails on Windows https://github.com/docker/for-mac/issues/1381 I just ran the following and even that didn't work on Docker for Windows docker run -it alpine traceroute -n www.google.com Unable to find image 'alpine:latest' locally latest: Pulling from library/alpine df20fa9351a1: Pull complete Digest: sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321 Status: Downloaded newer image for alpine:latest traceroute to www.google.com (172.217.5.100), 30 hops max, 46 byte packets 1 172.17.0.1 0.013 ms 0.006 ms 0.006 ms 2 3 4 5 6 7 8 *
goes on..
Triage: Does not seem to be critical for 5.0.
for clarity, this seems to be specific to Docker on Windows and may not be .NET issue. I think Triage: is right.
Environment
I have a program that does traceroute. Program copied below. Docker file also copied below. Problem 1) Traceroute returns 0.0.0.0 as return ipaddress when run in docker and times out 2) Same program runs fine on the same desktop outside of docker
I am expecting the program to run fine on docker. Is this a defect?
Docker output traceroute to www.microsoft.com, 15 hops max, 25 byte packets 1 Request timed out. 2 Request timed out. 3 Request timed out. 4 Request timed out. 5 Request timed out. 6 Request timed out. 7 Request timed out. 8 Request timed out. 9 Request timed out. 10 Request timed out. 11 360 ms 23.73.130.110
Output from the same program on the same PC traceroute to www.microsoft.com, 15 hops max, 25 byte packets 1 47 ms 2601:644:8200:7b10:1256:11ff:feaf:67d4 2 49 ms 2001:558:4000:76::1 3 63 ms 2001:558:82:d004::1 4 63 ms 2001:558:80:105a::1 5 63 ms 2001:558:80:1d1::1 6 Request timed out. 7 Request timed out. 8 Request timed out. 9 Request timed out. 10 96 ms 2001:559::7fa 11 74 ms 2600:1488:a040:108::b 12 63 ms 2600:1406:3c:39b::356e
Dockerfile FROM mcr.microsoft.com/dotnet/core/sdk:3.1 COPY . App/ WORKDIR /App ENTRYPOINT ["dotnet", "xxxx.dll"]
Traceroute program