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

GetAsync_IPv6LinkLocalAddressUri_Success consistently failing locally #27484

Closed
stephentoub opened this issue Sep 26, 2018 · 5 comments
Closed
Labels
area-System.Net.Http test-bug Problem in test source code (most likely) test-run-core Test failures in .NET Core test runs
Milestone

Comments

@stephentoub
Copy link
Member

When I run all System.Net.Http.Functional.Tests locally, the GetAsync_IPv6LinkLocalAddressUri_Success test consistently fails for me, on both WinHttpHandler and SocketsHttpHandler. Is this a known issue? Is my machine potentially configured in a way the test doesn't like?

System.Net.Http.Functional.Tests.PlatformHandler_HttpClientHandlerTest.GetAsync_IPv6LinkLocalAddressUri_Success [FAIL]
        System.Net.Http.HttpRequestException : An error occurred while sending the request.
        ---- System.Net.Http.WinHttpException : Error 12002 calling WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, 'The operation timed out'.
        Stack Trace:
          d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs(475,0): at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage req
  uest, CancellationTokenSource cts, Boolean disposeCts)
          d:\repos\corefx\src\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs(64,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
          d:\repos\corefx\src\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs(92,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
          d:\repos\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs(369,0): at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass34_0.
  <<GetAsync_IPv6LinkLocalAddressUri_Success>b__0>d.MoveNext()
          --- End of stack trace from previous location where exception was thrown ---
          d:\repos\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs(66,0): at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options)
          d:\repos\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs(366,0): at System.Net.Http.Functional.Tests.HttpClientHandlerTest.GetAsync_IPv6LinkLocal
  AddressUri_Success()
          --- End of stack trace from previous location where exception was thrown ---
          ----- Inner Stack Trace -----
          d:\repos\corefx\src\System.Runtime.Extensions\src\System\Environment.cs(146,0): at System.Environment.get_StackTrace()
          d:\repos\corefx\src\Common\src\System\Runtime\ExceptionServices\ExceptionStackTrace.cs(23,0): at System.Runtime.ExceptionServices.ExceptionStackTrace.AddCurrentStack(Excep
  tion exception)
          d:\repos\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpException.cs(57,0): at System.Net.Http.WinHttpException.CreateExceptionUsingError(Int32 error
  , String nameOfCalledFunction)
          d:\repos\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs(333,0): at System.Net.Http.WinHttpRequestCallback.OnRequestError(WinHttpRe
  questState state, WINHTTP_ASYNC_RESULT asyncResult)
          d:\repos\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs(104,0): at System.Net.Http.WinHttpRequestCallback.RequestCallback(IntPtr h
  andle, WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength)
          d:\repos\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs(47,0): at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr ha
  ndle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength)
          --- End of stack trace from AddCurrentStack ---
          d:\repos\corefx\src\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs(62,0): at System.Threading.Tasks.RendezvousAwaitable`1.GetResult()
          d:\repos\corefx\src\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpHandler.cs(878,0): at System.Net.Http.WinHttpHandler.StartRequest(WinHttpRequestState state)
        Output:
          http://[fe80::f188:5f13:aa00:ac29]:60833/


System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.GetAsync_IPv6LinkLocalAddressUri_Success [FAIL]
        System.Net.Http.HttpRequestException : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection fai
  led because connected host has failed to respond.
        ---- System.Net.Sockets.SocketException : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection
  failed because connected host has failed to respond.
        Stack Trace:
          d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs(84,0): at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, C
  ancellationToken cancellationToken)
          d:\repos\coreclr\src\System.Private.CoreLib\shared\System\Threading\Tasks\ValueTask.cs(854,0): at System.Threading.Tasks.ValueTask`1.get_Result()
          d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs(569,0): at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMess
  age request, Boolean allowHttp2, CancellationToken cancellationToken)
          d:\repos\coreclr\src\System.Private.CoreLib\shared\System\Threading\Tasks\ValueTask.cs(854,0): at System.Threading.Tasks.ValueTask`1.get_Result()
          d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs(607,0): at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(
  HttpRequestMessage request, CancellationToken cancellationToken)
          d:\repos\coreclr\src\System.Private.CoreLib\shared\System\Threading\Tasks\ValueTask.cs(854,0): at System.Threading.Tasks.ValueTask`1.get_Result()
          d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs(728,0): at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsyn
  c(ValueTask`1 creationTask)
          d:\repos\coreclr\src\System.Private.CoreLib\shared\System\Threading\Tasks\ValueTask.cs(854,0): at System.Threading.Tasks.ValueTask`1.get_Result()
          d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs(466,0): at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpReque
  stMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
          d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\RedirectHandler.cs(33,0): at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage reques
  t, CancellationToken cancellationToken)
          d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\HttpClient.cs(475,0): at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage req
  uest, CancellationTokenSource cts, Boolean disposeCts)
          d:\repos\corefx\src\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs(64,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
          d:\repos\corefx\src\Common\tests\System\Threading\Tasks\TaskTimeoutExtensions.cs(92,0): at System.Threading.Tasks.TaskTimeoutExtensions.WhenAllOrAnyFailed(Task[] tasks)
          d:\repos\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs(369,0): at System.Net.Http.Functional.Tests.HttpClientHandlerTest.<>c__DisplayClass34_0.
  <<GetAsync_IPv6LinkLocalAddressUri_Success>b__0>d.MoveNext()
          --- End of stack trace from previous location where exception was thrown ---
          d:\repos\corefx\src\Common\tests\System\Net\Http\LoopbackServer.cs(66,0): at System.Net.Test.Common.LoopbackServer.CreateServerAsync(Func`2 funcAsync, Options options)
          d:\repos\corefx\src\System.Net.Http\tests\FunctionalTests\HttpClientHandlerTest.cs(366,0): at System.Net.Http.Functional.Tests.HttpClientHandlerTest.GetAsync_IPv6LinkLocal
  AddressUri_Success()
          --- End of stack trace from previous location where exception was thrown ---
          ----- Inner Stack Trace -----
          d:\repos\corefx\src\System.Net.Http\src\System\Net\Http\SocketsHttpHandler\ConnectHelper.cs(65,0): at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, C
  ancellationToken cancellationToken)
        Output:
          http://[fe80::f188:5f13:aa00:ac29]:61206/
@davidsh
Copy link
Contributor

davidsh commented Sep 26, 2018

Is this a known issue? Is my machine potentially configured in a way the test doesn't like?

I think it might have something to do with VPN use. Is any VPN being used? I.e. to corpnet or something?

@stephentoub
Copy link
Member Author

I'm not VPN'd in, but I do have multiple VPN configurations (i.e. I can VPN in but I'm not currently connected to corpnet through them).

@davidsh
Copy link
Contributor

davidsh commented Sep 27, 2018

but I do have multiple VPN configurations

I think this generates additional IPv6 link-local addresses but some of those aren't connected maybe. We need to fix the tests to be smarter about this.

@wfurt
Copy link
Member

wfurt commented Sep 29, 2018

TestHelper.cs already does:

        public static IPAddress GetIPv6LinkLocalAddress() =>
            NetworkInterface
                .GetAllNetworkInterfaces()
                .Where(i => i.Description != "PANGP Virtual Ethernet Adapter")      // This is a VPN adapter, but is reported as a regular Ethernet interface with
                                                                                    // a valid link-local address, but the link-local address doesn't actually work.
                                                                                    // So just manually filter it out.
                .SelectMany(i => i.GetIPProperties().UnicastAddresses)
                .Select(a => a.Address)
                .Where(a => a.IsIPv6LinkLocal)
                .FirstOrDefault();

Maybe this should get more generalized. I don't think we would loose much at HTTP level if we skip all VPN interfaces. if anything that should be handled at socket level.

@geoffkizer
Copy link
Contributor

I'm seeing this again too. The description I see now is "PANGP Virtual Ethernet Adapter dotnet/corefx#3" which is not matching the check above.

@stephentoub Are you still seeing this? What's the description for the adapter with the IP that's causing this? (run "ipconfig all")

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 3.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Http test-bug Problem in test source code (most likely) test-run-core Test failures in .NET Core test runs
Projects
None yet
Development

No branches or pull requests

5 participants