[Exception Occurred: System.Runtime.InteropServices.COMException (0x80070296): Exception from HRESULT: 0x80070296

378 Views Asked by At

When I'm running prefview tool (https://github.com/microsoft/perfview) in the windows container, I encounter this exception:

[Exception Occurred: System.Runtime.InteropServices.COMException (0x80070296): Exception from HRESULT: 0x80070296
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.Diagnostics.Tracing.Extensions.ETWControl.EnableStackCaching(UInt64 traceHandle)
   at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.EnableKernelProvider(Keywords flags, Keywords stackCapture)
   at PerfView.CommandProcessor.Start(CommandLineArgs parsedArgs)
   at PerfView.CommandProcessor.Collect(CommandLineArgs parsedArgs)
   at PerfView.CommandProcessor.ExecuteCommand(CommandLineArgs parsedArgs)]

Here is my usage:

  1. Download the latest prefview from: https://github.com/microsoft/perfview/releases/download/v3.0.6/PerfView.exe
  2. Copy the PerfView.exe into the windows container
  3. use crictl exec <contianer id> powershell command to open a Powershell in the container
  4. Running the command
.\PerfView "/DataFile:PerfViewData.etl" /BufferSizeMB:256 /StackCompression /CircularMB:500 /logFile=log.txt /maxCollectSec=30 /NoGui collect

My windows container's base image is: mcr.microsoft.com/windows/nanoserver:1809

My isolation runtime is: runhcs-wcow-hypervisor

Anything I can do about it? Thanks in advance.

I have read this post: https://githublab.com/repository/issues/microsoft/perfview/1601. It said that we should use hyper-v isolation and that's exactly what I'm using.

1

There are 1 best solutions below

3
On

Have you tried to use the Server Core image? It might be the case that PerfView is trying to access OS APIs that are not present in Nano Server.