%3CLINGO-SUB%20id%3D%22lingo-sub-1592024%22%20slang%3D%22en-US%22%3ESolve%20MSIX%20packaging%20failure%20-%20%22Error%20starting%20the%20MSIX%20packaging%20tool%20driver%200x80131500%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1592024%22%20slang%3D%22en-US%22%3E%3CP%3ERecently%20I%20work%20on%20one%20MSIX%20packaging%20task%20to%20convert%20a%20traditional%20Win32%20installer%20to%20.msix%20package%20with%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fpackaging-tool%2Ftool-overview%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EMSIX%20packaging%20tool%3C%2FA%3E%2C%20however%20always%20faced%20this%20kind%20of%20error%20message%20once%20start%20the%20packaging%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22freistli_0-1597634328435.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F212674iD0FEAF814BAF1ED9%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22freistli_0-1597634328435.png%22%20alt%3D%22freistli_0-1597634328435.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBy%20checking%20the%20error%20log%2C%20it%20shows%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%5B8%2F14%2F2020%2010%3A29%3A06%20AM%5D%20%5BError%5D%20Error%20monitoring%3A%20%3CSTRONG%3EInsufficient%20system%20resources%20exist%20to%20complete%20the%20requested%20service%3C%2FSTRONG%3E%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%5B8%2F14%2F2020%2010%3A29%3A06%20AM%5D%20%5BDebug%5D%20Getting%20environment%20object%20from%20%25UserProfile%25%5CAppData%5CLocal%5CPackages%5CMicrosoft.MsixPackagingTool_8wekyb3d8bbwe%5CLocalState%5CMsixGenerator.ConversionState.xml%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%5B8%2F14%2F2020%2010%3A29%3A06%20AM%5D%20%5BError%5D%20Error%20Occurred%3A%20Microsoft.ApplicationVirtualization.Packaging.Sequencing.SequencerException%3A%20Insufficient%20system%20resources%20exist%20to%20complete%20the%20requested%20service%20---%26gt%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%20Microsoft.ApplicationVirtualization.Packaging.MonitorException%3A%20Insufficient%20system%20resources%20exist%20to%20complete%20the%20requested%20service%20---%26gt%3B%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ESystem.ComponentModel.Win32Exception%3A%20Insufficient%20system%20resources%20exist%20to%20complete%20the%20requested%20service%20at%20Microsoft.ApplicationVirtualization.Packaging.Tracing.TraceController.Start(String%20logfilePath)%20at%20Microsoft.ApplicationVirtualization.Packaging.TracingSubsystem.%26lt%3B%26gt%3Bc__DisplayClass6_0.%26lt%3B.ctor%26gt%3Bb__0()%20at%20System.EventHandler%601.Invoke(Object%20sender%2C%20TEventArgs%20e)%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHowever%20my%20PC%20has%20enough%20RAM%20(free%2020GB)%2C%20with%20latest%20Windows%2010%20update.%20I%20tried%20restarting%20PC%20and%20it%20doesn't%20help%20as%20well.%20Don't%20think%20it%20is%20a%20resource%20limit%20issue.%20With%20this%20question%2C%20I%20used%20Windows%20Feedback%20%5BWindows%20%2B%20F%5D%20to%20raised%20a%20feedback.%20The%20response%20from%20Window%20team%20was%20quick%20and%20quite%20helpful.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20error%20indeed%20failed%20when%20start%20new%20system%20event%20tracing%20sessions.%20These%20sessions%20can%20only%20be%20a%20limited%20amount%20of%20them%20system-wide%2C%20this%20limit%20is%20%3CSTRONG%3E64%3C%2FSTRONG%3E%20by%20default%2C%20otherwise%20we%20will%20hit%20this%26nbsp%3B%3CSTRONG%3EERROR_NO_SYSTEM_RESOURCES%20%3C%2FSTRONG%3Eerror.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20article%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fapi%2Fevntrace%2Fnf-evntrace-starttracew%23return-value%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fapi%2Fevntrace%2Fnf-evntrace-starttracew%23return-value%3C%2FA%3E%26nbsp%3Bgave%20two%20suggestions%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Reboot%20machine%3C%2FP%3E%0A%3CP%3E2.%20E%3CSPAN%3Editing%20the%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EREG_DWORD%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3Bkey%20at%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EHKEY_LOCAL_MACHINE%5CSYSTEM%5CCurrentControlSet%5CControl%5CWMI%5CEtwMaxLoggers%3C%2FSTRONG%3E%3CSPAN%3E.%20Permissible%20values%20are%2032%20through%20256%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EI%20didn't%20take%20the%20steps%20as%20some%20system%20trace%20sessions%20can%20start%20when%20machine%20is%20starting%20up%2C%20and%20some%20traces%20should%20be%20stopped%20if%20they%20are%20not%20necessary.%20I%20used%20commands%20%22%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fadministration%2Fwindows-commands%2Flogman%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Elogman%3C%2FA%3E%20query%20-etc%22%2C%20%22%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-hardware%2Fdrivers%2Fdevtest%2Ftracelog%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Etracelog%3C%2FA%3E%20-l%22%2C%20the%20result%20shows%20a%20lot%20of%20running%20trace%20sessions%20(up%20to%2050).%20Although%20they%20are%20not%20hit%2064%20limits%2C%20I%20thought%20reducing%20them%20will%20be%20definitely%20worth%20trying.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAfter%20some%20quick%20research%2C%20I%20can%20see%20the%20%3CSTRONG%3EPerfmon%20Monitor%3C%2FSTRONG%3E%20will%20be%20helpful%20to%20manage%20the%20running%20system%20trace%20session%20easily.%20After%20taking%20below%20steps%2C%20the%20MSIX%20error%20is%20resolved%20immediately%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E1.%20In%20Start%20command%2C%20type%20%22Performance%20Monitor%22%2C%20start%20it%20as%20Admin%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E2.%20Choose%20%3CSTRONG%3EData%20Collector%20Sets%3C%2FSTRONG%3E%20-%26gt%3B%20%3CSTRONG%3EEvent%20Trace%20Sessions%3C%2FSTRONG%3E%2C%20right%20click%20to%20stop%20some%20sessions%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22freistli_1-1597638741569.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F212677i10E9D90DED0211DF%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22freistli_1-1597638741569.png%22%20alt%3D%22freistli_1-1597638741569.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20To%20avoid%20this%20issue%20from%20next%20rebooting%2C%20can%20%3CSTRONG%3Edisable%3C%2FSTRONG%3E%20some%20of%20them%20in%26nbsp%3B%3CSTRONG%3EData%20Collector%20Sets%3C%2FSTRONG%3E%20-%26gt%3B%20%3CSTRONG%3EStartup%26nbsp%3BEvent%20Trace%20Sessions%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3BHope%20this%20helps!%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1592024%22%20slang%3D%22en-US%22%3E%3CP%3EExplained%20general%20steps%20on%20how%20to%20solve%20%22Error%20starting%20the%20MSIX%20packaging%20tool%20driver%200x80131500%22%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

Recently I work on one MSIX packaging task to convert a traditional Win32 installer to .msix package with MSIX packaging tool, however always faced this kind of error message once start the packaging:

 

freistli_0-1597634328435.png

 

By checking the error log, it shows:

 

[8/14/2020 10:29:06 AM] [Error] Error monitoring: Insufficient system resources exist to complete the requested service

[8/14/2020 10:29:06 AM] [Debug] Getting environment object from %UserProfile%\AppData\Local\Packages\Microsoft.MsixPackagingTool_8wekyb3d8bbwe\LocalState\MsixGenerator.ConversionState.xml

[8/14/2020 10:29:06 AM] [Error] Error Occurred: Microsoft.ApplicationVirtualization.Packaging.Sequencing.SequencerException: Insufficient system resources exist to complete the requested service --->

Microsoft.ApplicationVirtualization.Packaging.MonitorException: Insufficient system resources exist to complete the requested service --->

System.ComponentModel.Win32Exception: Insufficient system resources exist to complete the requested service at Microsoft.ApplicationVirtualization.Packaging.Tracing.TraceController.Start(String logfilePath) at Microsoft.ApplicationVirtualization.Packaging.TracingSubsystem.<>c__DisplayClass6_0.<.ctor>b__0() at System.EventHandler`1.Invoke(Object sender, TEventArgs e)

 

However my PC has enough RAM (free 20GB), with latest Windows 10 update. I tried restarting PC and it doesn't help as well. Don't think it is a resource limit issue. With this question, I used Windows Feedback [Windows + F] to raised a feedback. The response from Window team was quick and quite helpful.

 

The error indeed failed when start new system event tracing sessions. These sessions can only be a limited amount of them system-wide, this limit is 64 by default, otherwise we will hit this ERROR_NO_SYSTEM_RESOURCES error.

 

This article https://docs.microsoft.com/en-us/windows/win32/api/evntrace/nf-evntrace-starttracew#return-value gave two suggestions:

 

1. Reboot machine

2. Editing the REG_DWORD key at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WMI\EtwMaxLoggers. Permissible values are 32 through 256

 

I didn't take the steps as some system trace sessions can start when machine is starting up, and some traces should be stopped if they are not necessary. I used commands "logman query -etc", "tracelog -l", the result shows a lot of running trace sessions (up to 50). Although they are not hit 64 limits, I thought reducing them will be definitely worth trying.

 

After some quick research, I can see the Perfmon Monitor will be helpful to manage the running system trace session easily. After taking below steps, the MSIX error is resolved immediately:

 

1. In Start command, type "Performance Monitor", start it as Admin

 

2. Choose Data Collector Sets -> Event Trace Sessions, right click to stop some sessions

 

freistli_1-1597638741569.png

 

3. To avoid this issue from next rebooting, can disable some of them in Data Collector Sets -> Startup Event Trace Sessions

   

 Hope this helps!