electron-log icon indicating copy to clipboard operation
electron-log copied to clipboard

On Windows (no bug on Mac) sometimes see JavaScript error when app starts using log.

Open kmackey1 opened this issue 1 year ago • 2 comments

Sometimes when my Windows app starts, I will see 5 JavaScript errors with "EBUSY: resource busy or locked, open 'C:\Users\kmackey\product\logs\main.log'"

Using Process Monitor, usually, but not always, I see MsSense.exe (the main service executable for Defender for Endpoint, the service is running as a service with the name SENSE) accessing the file. I tried adding the log file as an exception to Defender, but I still see the errors.

Also in Process Monitor, I see some of my app's operations resulting in sharing violations, though they don't always result in the JavaScript errors. Here are the operations that seem to result in the errors (from different app runs):

Desired Access: Generic Read/Write, Disposition: OverwriteIf, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: 0

Desired Access: Append Data/Add Subdirectory/Create Pipe Instance, Write EA, Read Attributes, Write Attributes, Read Control, Synchronize, Disposition: OpenIf, Options: Synchronous IO Non-Alert, Attributes: N, ShareMode: Read, Write, Delete, AllocationSize: 0

kmackey1 avatar Feb 06 '24 22:02 kmackey1

It looks like you have a few different instances of your app running. For such a case, it's better to use a different log file name for each instance.

megahertz avatar Feb 07 '24 09:02 megahertz

I should have added that this problem is not happening on the macOS version of the app. Only Windows.

kmackey1 avatar Feb 07 '24 19:02 kmackey1