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

Got 'Insufficient system resources exist to complete the requested service' while building Store version of application #10162

Open
0xNima opened this issue May 21, 2024 · 7 comments

Comments

@0xNima
Copy link

0xNima commented May 21, 2024

Issue Description

Hello folks, When I tried to build the Store (MSIX) version of Telegram Desktop application in VS 2022, my build failed with the following logs:

1>Child node "4" exited prematurely. Shutting down. Diagnostic information may be found in files in "C:\....\Temp\MSBuildTemp\" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.

1>C:\....\Temp\MSBuildTemp\MSBuild_pid-18684_d6ae519576884d319a97c37f0006ed4e.failure.txt:1>UNHANDLED EXCEPTIONS FROM PROCESS 18684:

1>=====================

1>5/20/2024 7:22:27 PM

1>System.IO.IOException: Insufficient system resources exist to complete the requested service.

1>

1>   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

1>   at System.IO.Pipes.PipeStream.BeginWriteCore(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)

1>   at System.IO.Pipes.PipeStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)

1>   at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)

1>===================

1>

1>

1>C:\Users\...\Temp\MSBuildTemp\MSBuild_pid-28480_31fcd563a2c9411192e8b7de35718108.failure.txt:

1>UNHANDLED EXCEPTIONS FROM PROCESS 28480:

1>=====================

1>5/20/2024 7:22:26 PM

1>System.IO.IOException: Insufficient system resources exist to complete the requested service.

1>

1>   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

1>   at System.IO.Pipes.PipeStream.BeginWriteCore(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)

1>   at System.IO.Pipes.PipeStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)

1>   at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)

1>===================
....

Steps to Reproduce

1- install and build the solution according to instructions

2- Add a new Windows Application Packaging Project to the solution named store-release and config package name, icons, and etc.

3- Right Click on store-release and select Publish -> Create App Packages...

4- set Version, Architecture (x64), and Solution Configuration (Release x64)

5- click on Create button

Actual Behavior

UNHANDLED EXCEPTIONS FROM PROCESS 18684:

=====================
5/20/2024 7:22:27 PM
System.IO.IOException: Insufficient system resources exist to complete the requested service.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   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 Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)
===================

Analysis

I'm not sure if this problem is merely related to resources, because CPU and RAM usage never hit the limits. I tried to stop some Event Trace Sessions in the Performance Monitoring window but it didn't help.

Note that I can build the solution successfully from Build -> Build Solution. The problem occurs when I try to build the app from Publish -> Create App Packages....

Versions & Configurations

the output of msbuild -version:
MSBuild version 17.9.8+b34f75857 for .NET Framework
17.9.8.16306

Machine's configurations:
Processor: 13th Gen Intel(R) Core(TM) i7-13650HX 2.60 GHz - 14 cores, 20 logical processors RAM: 32.0 GB
OS: Windows 11 Home

@JanKrivanek
Copy link
Member

@0xNima can you try adding -m:1 if it helps workaround the issue?

@JanKrivanek
Copy link
Member

@JaynieBai - let's try to repro in VS build with the repo given by customer

@JaynieBai
Copy link
Member

Repro that and get the following binlog

CentralNode_devenv_PID=8416_x64_BuildManager_Default_0.binlog.txt

Image

@0xNima
Copy link
Author

0xNima commented Aug 13, 2024

@0xNima can you try adding -m:1 if it helps workaround the issue?

Is it possible to pass this switch from Visual Studio? Because I don't build the solution from the command line. I added Windows Application Packaging Project to the solution and set the required fields through Package.appxmanifest.

@JanKrivanek
Copy link
Member

@0xNima can you try adding -m:1 if it helps workaround the issue?

Is it possible to pass this switch from Visual Studio? Because I don't build the solution from the command line. I added Windows Application Packaging Project to the solution and set the required fields through Package.appxmanifest.

Yes - set the following to 1:

image

@0xNima
Copy link
Author

0xNima commented Aug 15, 2024

@0xNima can you try adding -m:1 if it helps workaround the issue?

Is it possible to pass this switch from Visual Studio? Because I don't build the solution from the command line. I added Windows Application Packaging Project to the solution and set the required fields through Package.appxmanifest.

Yes - set the following to 1:

image

It works like a charm. It was set to 20 processors. Thank you, Jan

@JanKrivanek
Copy link
Member

Thanks @0xNima for confirming. By defult it uses number of available logical processors. In some specific cases it can stress the resources, but normally it should increase throughput of your build - so I'd suggest changing it back for other builds.

In any case we should still followup internally on the reason for this (@JaynieBai is looking into collecting memory analysis)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants