System.IO.IOException: Unable to write data to the transport connection: Broken pipe.
See original GitHub issueWhen running a .NET Core 2.1 app in Docker, after a few minutes, the app exits with the following exception:
identity-api | Unhandled Exception: System.AggregateException: One or more errors occurred. (Unable to write data to the transport connection: Broken pipe.) ---> System.IO.IOException: Unable to write data to the transport connection: Broken pipe. ---> System.Net.Sockets.SocketException: Broken pipe
identity-api | at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
identity-api | --- End of inner exception stack trace ---
identity-api | at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
identity-api | at System.Data.SqlClient.SNI.SslOverTdsStream.WriteInternal(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token, Boolean async)
identity-api | --- End of inner exception stack trace ---
identity-api | at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
identity-api | at System.Threading.Tasks.Task.Wait()
identity-api | at System.Data.SqlClient.SNI.SslOverTdsStream.Write(Byte[] buffer, Int32 offset, Int32 count)
identity-api | at System.Net.Security.SslStreamInternal.WriteSingleChunk[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer)
identity-api | at System.Net.Security.SslStreamInternal.WriteAsyncInternal[TWriteAdapter](TWriteAdapter writeAdapter, ReadOnlyMemory`1 buffer)
identity-api | at System.Net.Security.SslStreamInternal.Write(Byte[] buffer, Int32 offset, Int32 count)
identity-api | at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count)
identity-api | at System.Data.SqlClient.SNI.SNITCPHandle.Send(SNIPacket packet)
identity-api | at System.Data.SqlClient.SNI.SNIMarsConnection.Send(SNIPacket packet)
identity-api | at System.Data.SqlClient.SNI.SNIMarsHandle.SendControlPacket(SNISMUXFlags flags)
identity-api | at System.Data.SqlClient.SNI.SNIMarsHandle.Dispose()
identity-api | at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.Dispose()
identity-api | at System.Data.SqlClient.TdsParserSessionPool.Dispose()
identity-api | at System.Data.SqlClient.TdsParser.Disconnect()
identity-api | at System.Data.SqlClient.SqlInternalConnectionTds.Dispose()
identity-api | at System.Data.ProviderBase.DbConnectionPool.DestroyObject(DbConnectionInternal obj)
identity-api | at System.Data.ProviderBase.DbConnectionPool.CleanupCallback(Object state)
identity-api | at System.Threading.TimerQueueTimer.CallCallback()
identity-api | at System.Threading.TimerQueueTimer.Fire()
identity-api | at System.Threading.TimerQueue.FireNextTimers()
There are two containers that access SQL, they both exit around the same time.
This happens consistently. I’ve tried Alpine and non-Alpine images. The apps are both MVC and the DataContexts have been unused other than running the migrations.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:54 (16 by maintainers)
Top Results From Across the Web
Unable to write data to the transport connection: Broken pipe
"Broken pipe" means you attempt to write using a connection that have been closed by the other end. – Some programmer dude. Jul...
Read more >IOException: Unable to write data to the transport connection
IO.IOException: Unable to write data to the transport connection: Broken pipe. dotnet/runtime/79976. github.com. System.IO.
Read more >Unable to write data to the transport connection
Too large data model may be a reason for your scenario, maybe you can try to cut down you data size and try...
Read more >Unit tests throws Unable to write data to the transport ...
System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host ...
Read more >BrokenPipe error. Mp3 Files only. : r/Readarr
System.IO.IOException: Unable to write data to the transport connection: Broken pipe. ... SocketException (32): Broken pipe at System.Net.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Getting the same error running the following:
Netcoreapp2.2 / Linux container (mcr.microsoft.com/dotnet/core/runtime:2.2) / Kubernetes 0.13.5 / SQL Azure ( Elastic Pools, Standard Plan )
This causes the pods to restart with a 139 exit code, and we can’t prevent it 😞
Currently, this is a show stopper for us, are there any workarounds?
I noticed a very suspicious throw introduced long ago that would easily cause this issue if disposing a broken, mars-enabled connection: https://github.com/dotnet/corefx/pull/4594/files#diff-a8e6146000f306b97ce4e48207f7cd9fR69 I plan to remove the throw for the next M.D.SqlClient preview.