self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

error sending the request ---> System.Net.WebException: NameResolutionFailure

Open ismeyueyue opened this issue 3 years ago • 4 comments

Self-Hosted Version

the lastest master branch

CPU Architecture

x86_64

Docker Version

20.10.8

Docker Compose Version

1.29.2

Steps to Reproduce

  1. installed self-hosted successfully in my owner server with all docker up healthy. image

  2. installed sentry unity sdk with upm. image

  3. started monitor my unity project with sentry unity sdk using follow test.

SentryUnity.Init(o =>
{
    o.Dsn = "http://b47cae695xxxxd7a46@host:9000/11";
    o.Debug = true;
    o.TracesSampleRate  = 1.0;
});

try
{
    throw new Exception("Test");
}
catch (Exception ex)
{
    SentrySdk.CaptureException(ex);
}

Expected Result

the self-hosted sentry should receive the Exception.

Actual Result

My unity project console came out the follow errors image

Sentry: (Error) Error while processing envelope (event ID: '4621cdxxxxxxx3b'). #1 in queue. System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.Net.WebException: Error: NameResolutionFailure
  at System.Net.WebConnection.Connect (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x00044] in <c7c32602e34d422f9c1a5e3ed52782b2>:0 
  at System.Net.WebConnection.InitConnection (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x000cc] in <c7c32602e34d422f9c1a5e3ed52782b2>:0 
  at System.Net.WebOperation.Run () [0x0009a] in <c7c32602e34d422f9c1a5e3ed52782b2>:0 
  at System.Net.WebCompletionSource`1[T].WaitForCompletion () [0x00094] in <c7c32602e34d422f9c1a5e3ed52782b2>:0 
  at System.Net.HttpWebRequest.RunWithTimeoutWorker[T] (System.Threading.Tasks.Task`1[TResult] workerTask, System.Int32 timeout, System.Action abort, System.Func`1[TResult] aborted, System.Threading.CancellationTokenSource cts) [0x000f8] in <c7c32602e34d422f9c1a5e3ed52782b2>:0 
  at System.Net.Http.MonoWebRequestHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00378] in <f0a1e2b28d5249f4a1d6ad1969e1daaf>:0 
   --- End of inner exception stack trace ---
  at System.Net.Http.MonoWebRequestHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x00509] in <f0a1e2b28d5249f4a1d6ad1969e1daaf>:0 
  at Sentry.Internal.Http.RetryAfterHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x0007f] in /sentry-unity/src/sentry-dotnet/src/Sentry/Internal/Http/RetryAfterHandler.cs:65 
  at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) [0x000e8] in <f0a1e2b28d5249f4a1d6ad1969e1daaf>:0 
  at Sentry.Internal.Http.HttpTransport.SendEnvelopeAsync (Sentry.Protocol.Envelopes.Envelope envelope, System.Threading.CancellationToken cancellationToken) [0x00080] in /sentry-unity/src/sentry-dotnet/src/Sentry/Internal/Http/HttpTransport.cs:46 
  at Sentry.Internal.BackgroundWorker.WorkerAsync () [0x001d8] in /sentry-unity/src/sentry-dotnet/src/Sentry/Internal/BackgroundWorker.cs:130 
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
Sentry.Unity.Integrations.UnityLogHandlerIntegration:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) (at /sentry-unity/src/Sentry.Unity/Integrations/UnityLogHandlerIntegration.cs:80)
UnityEngine.Debug:LogError (object)
Sentry.Unity.UnityLogger:Log (Sentry.SentryLevel,string,System.Exception,object[]) (at /sentry-unity/src/Sentry.Unity/UnityLogger.cs:47)
Sentry.Extensibility.DiagnosticLoggerExtensions:LogIfEnabled<System.Nullable`1<Sentry.SentryId>, int> (Sentry.Extensibility.IDiagnosticLogger,Sentry.SentryLevel,System.Exception,string,System.Nullable`1<Sentry.SentryId>,int) (at /sentry-unity/src/sentry-dotnet/src/Sentry/Extensibility/DiagnosticLoggerExtensions.cs:410)
Sentry.Extensibility.DiagnosticLoggerExtensions:LogError<System.Nullable`1<Sentry.SentryId>, int> (Sentry.SentryOptions,string,System.Exception,System.Nullable`1<Sentry.SentryId>,int) (at /sentry-unity/src/sentry-dotnet/src/Sentry/Extensibility/DiagnosticLoggerExtensions.cs:268)
Sentry.Internal.BackgroundWorker/<WorkerAsync>d__19:MoveNext () (at /sentry-unity/src/sentry-dotnet/src/Sentry/Internal/BackgroundWorker.cs:142)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder:SetException (System.Exception)
Sentry.Internal.Http.HttpTransport/<SendEnvelopeAsync>d__3:MoveNext () (at /sentry-unity/src/sentry-dotnet/src/Sentry/Internal/Http/HttpTransport.cs:48)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<System.Net.Http.HttpResponseMessage>:SetException (System.Exception)
Sentry.Internal.Http.RetryAfterHandler/<SendAsync>d__8:MoveNext () (at /sentry-unity/src/sentry-dotnet/src/Sentry/Internal/Http/RetryAfterHandler.cs:73)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()

And my self-hosted got nothing image

ismeyueyue avatar Jul 21 '22 04:07 ismeyueyue

AFAICS this is related to sentry unity sdk, do you have a reason to believe it's related to self-hosted? Does it work with Sentry SaaS ?

aminvakil avatar Jul 21 '22 11:07 aminvakil

@aminvakil thanks for your replay.

well, it worked on the sentry.io using the same code. image

I think the self-hosted is set up successfully which I can open the web link http://host:9000/, is there any other way to verify it, and help me to figure out this problem

ismeyueyue avatar Jul 22 '22 03:07 ismeyueyue

If you have a reverse proxy in front of your sentry (9000 port), try bypassing it and hit sentry on 9000 port directly.

Also try docker compose logs -f and send your request, then see if you can get a clue from logs.

aminvakil avatar Jul 24 '22 07:07 aminvakil

I believe this is really https://github.com/getsentry/sentry-dotnet/issues/1817, since the Unity SDK depends on the dotnet SDK.

@bruno-garcia, does that makes sense? If so, is the fix here a new sentry-unity release? Looks like the dependency was bumped yesterday: https://github.com/getsentry/sentry-unity/pull/911

emmatyping avatar Jul 27 '22 16:07 emmatyping

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Aug 18 '22 00:08 github-actions[bot]

The related sentry-unity issue is closed, so I think we are good here. @ishuyueyue if you run into further problems, feel free to open a new issue!

emmatyping avatar Aug 18 '22 17:08 emmatyping