Randomly getting System.Net.Http.HttpRequestException: hostname nor servname provided, or not known (prd-services-apim.xcbsystems.com:443)

Open
#111,058 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp

Research direction

Start with the HttpClient stack trace, especially TLM.MobileApp.Data.Core.ApiClient.ProcessApiGatewayRequestAsync, and review the .NET 8 MAUI Android configuration. There are no reproduction steps or named tests; progress would require identifying the intermittent hostname-resolution failure and validating a fix without the reported socket exception.

Written by the indexing model from the issue text.

Description

area-System.Net os-android
Description

Randomly getting System.Net.Http.HttpRequestException: hostname nor servname provided, or not known (prd-services-apim.xcbsystems.com:443)

System.Net.Http.HttpRequestException: hostname nor servname provided, or not known (prd-tlmservices-apim.epaysystems.com:443)
 ---> System.Net.Sockets.SocketException (0xFFFDFFFF): hostname nor servname provided, or not known
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError , CancellationToken )
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 )
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs , ValueTask , CancellationToken )
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String , Int32 , HttpRequestMessage , Boolean , CancellationToken )
   Exception_EndOfInnerExceptionStack
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String , Int32 , HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.HttpConnectionPool.AddHttp2ConnectionAsync(QueueItem )
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.<WaitWithCancellationAsync>d__1[[System.Net.Http.Http2Connection, System.Net.Http, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].MoveNext()
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage , Boolean , Boolean , CancellationToken )
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage , Boolean , CancellationToken )
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage , HttpCompletionOption , CancellationTokenSource , Boolean , CancellationTokenSource , CancellationToken )
   at TLM.MobileApp.Data.Core.ApiClient.ProcessApiGatewayRequestAsync(IRequest request, Int32 retryCount)
Reproduction Steps

No Reproduction steps, Its a random exception in httpclient

Expected behavior

Should work without exceptions

Actual behavior

Socket Exceptions are coming sometimes

Regression?

No response

Known Workarounds

No

Configuration

Which version of .NET is the code running on? : .NET 8 MAUI
What OS and version, and what distro if applicable? : Android

Other information

No response

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.