msbuild: MSB4166: Pipe is broken when building with .net core SDK 3.0 preview 7
Steps to reproduce
Not quite sure, this issue occurs randomly when building netcoreapp3.0 projects with .net core 3.0 SDK preview 7.
Expected behavior
Build correctly.
Actual behavior
On a big solution (ours has 70+ projects), it’s not uncommon to see one or two projects (and tens of projects depending on them) being failed to build due to a node of msbuild crashes. However, the problem occurs randomly. By random I mean how many of these errors and on which projects they occur is totally unpredictable. The build process simply stops when a node crashes, fails the projects currently being built.
The error message complains:
Child node “node-id” exited prematurely. Shutting down. Diagnostic information may be found in files in "%APPDATA%\Local\Temp" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.
The MSBuild_*.failure.txt
files has either content of the following two:
UNHANDLED EXCEPTIONS FROM PROCESS process-id: date-time System.IO.IOException: Pipe is broken. at System.IO.Pipes.PipeStream.CheckWriteOperations() at System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count) at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)
or
UNHANDLED EXCEPTIONS FROM PROCESS process-id: date-time System.IO.IOException: Pipe is broken. at System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode) at System.IO.Pipes.PipeStream.BeginWriteCore(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state) at System.IO.Pipes.PipeStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count) at System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count) at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)
It’s worth noting that these failure log files, with the same content, are also generated by SDK preview 6, they just weren’t shown as errors.
Environment data
msbuild /version
output: 16.200.19.32702
OS info: Windows 10 Version 1903
If applicable, version of the tool that invokes MSBuild (Visual Studio, dotnet CLI, etc): .NET Core SDK (reflecting any global.json): Version: 3.0.100-preview7-012821 Commit: 6348f1068a
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 16 (5 by maintainers)
I’m closing this issue. @StefanOssendorf @alexandredsimoes Feel free to ask me to reopen it if you were in a different scenario.
Thanks @rainersigwald ! That’s exactly the problem, and the workaround worked for me.
@hillin that sounds a lot like you might be hitting aspnet/AspNetCore#12693. Can you try adding the ASP.NET project back to your solution and applying the workaround mentioned in that bug to confirm?
I’m glad you fixed your problem. But I still want to know how to reproduce the failure.
MSB4166 should never happen. It is always a bug in MSBuild. I’d like to fix that bug, so I’d like to get more information about your case if we can.