the file <FILE_NAME>.PML was not closed cleanly during capture and is corrupt

1.3k Views Asked by At

I'm using procmon to save logs while running some tests on VM. I'm using python and pytest but I think is irrelevant here. For every test I'm running to start procmon with:

psexec.exe -accepteula -s -d -i 1 procmon.exe /AcceptEula /Quiet /BackingFile c:\temp\logs.pml

If a test failed, I'm terminating the procmon with:

psexec.exe -accepteula -s -d -i 1 procmon.exe /Terminate

and then I'm saving the snapshot of the VM. To open the logs.pml to be readable, I'm running after I entered to the VM's snapshot:

procmon.exe \openlog c:\temp\logs.pml

But sometimes I get the error:

the file logs.PML was not closed cleanly during capture and is corrupt.

Error pic in the VM

  1. Why do I get this error? I can see the procmon ran and then terminated by my code (I can enter to the VM and see the test running, executing the procmon, and terminating it).
  2. How do I solve this problem? Note: it happens sometimes, most of the time it works and creates for me the logs as readable PML files.
0

There are 0 best solutions below