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

OTLP exporter Exception: System.Net.Http.HttpRequestException: Error while copying content to a stream. #4212

Closed
muhaook opened this issue Feb 21, 2023 · 6 comments
Labels
bug Something isn't working pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package Stale Issues and pull requests which have been flagged for closing due to inactivity

Comments

@muhaook
Copy link

muhaook commented Feb 21, 2023

Bug Report

Symptom

hit a bunch of OTLP exporter exceptions during load-test:

[2023-02-21T09:52:49.5020419Z] [Error] EventSource=OpenTelemetry-Exporter-OpenTelemetryProtocol, Message=Exporter failed send data to collector to https://<hostname>:5679/<path> endpoint. Data will not be sent. 

Exception: System.Net.Http.HttpRequestException: Error while copying content to a stream. 
---> System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. 
---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine

   at System.Net.Sockets.Socket.BeginSend(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state)
   at System.Net.Sockets.NetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at System.Net.Security._SslStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback asyncCallback, Object asyncState)
   at System.Net.TlsStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback asyncCallback, Object asyncState)
   at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at System.Net.ConnectStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)
   at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
   at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.Http.HttpContent.CopyToAsync(Stream stream, TransportContext context)
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ExportClient.BaseOtlpHttpExportClient`1.SendHttpRequest(HttpRequestMessage request, CancellationToken cancellationToken)
   at OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ExportClient.BaseOtlpHttpExportClient`1.SendExportRequest(TRequest request, CancellationToken cancellationToken) 

Runtime environment (please complete the following information):

  • OpenTelemetry Automatic Instrumentation version: v0.5.1-beta.2
  • OS: Windows Server 2012r2
  • .NET version: .NET Framework 4.6.2
@pellared
Copy link
Member

Thanks a lot for reporting the issue 👍

OpenTelemetry Automatic Instrumentation version: v0.5.1-beta.2 uses https://www.nuget.org/packages/OpenTelemetry.Exporter.OpenTelemetryProtocol/1.4.0-rc.2

Can you please try using https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/tag/v0.6.0-beta.2 which uses https://www.nuget.org/packages/OpenTelemetry.Exporter.OpenTelemetryProtocol/1.4.0-rc.4 ?

If you will be able to reproduce it then we will probably have to escalate it to @open-telemetry/dotnet-maintainers becasue AFAIK they plan to make a 1.4.0 by end of this week.

It would be great to have something some artifacts that would help to reproduce the issue, but first it would be great if you just retest with the latest OTel .NET Auto-Instrumentation version.

@muhaook
Copy link
Author

muhaook commented Feb 21, 2023

Thanks @pellared , we are targeting v0.5.1-beta.2 at the moment. load test is running by another team. so it may not be straight forward to upgrade. I'll see if we can switch to v0.6.0-beta.2 as soon as possible.

for info, I did a quick search and found it may be the other side that aborted the connection. https://stackoverflow.com/questions/14304658/c-sharp-an-established-connection-was-aborted-by-the-software-in-your-host-machi

@pellared pellared transferred this issue from open-telemetry/opentelemetry-dotnet-instrumentation Feb 21, 2023
@pellared pellared added bug Something isn't working pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package labels Feb 21, 2023
@Kielek
Copy link
Contributor

Kielek commented Feb 21, 2023

Ref link: #4115

Copy link
Contributor

github-actions bot commented Oct 8, 2024

This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Oct 8, 2024
Copy link
Contributor

Closed as inactive. Feel free to reopen if this issue is still a concern.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package Stale Issues and pull requests which have been flagged for closing due to inactivity
Projects
None yet
Development

No branches or pull requests

3 participants