self-hosted
self-hosted copied to clipboard
error sending the request ---> System.Net.WebException: NameResolutionFailure
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
-
installed self-hosted successfully in my owner server with all docker up healthy.

-
installed sentry unity sdk with upm.

-
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

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

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 thanks for your replay.
well, it worked on the sentry.io using the same code.

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
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.
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
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 🥀
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!