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

EPERM: operation not permitted, rename #125

Open
paulius005 opened this issue Feb 19, 2019 · 5 comments
Open

EPERM: operation not permitted, rename #125

paulius005 opened this issue Feb 19, 2019 · 5 comments

Comments

@paulius005
Copy link

paulius005 commented Feb 19, 2019

We have recently released an update of our app to production with a switch to electron-json-storage over https://www.npmjs.com/package/electron-store because I saw #122 and #124 implemented.

We have started to get a lot of EPERM: operation not permitted, rename 'HOME\AppData\Roaming\Loom\storage\preferences.json.3783979581' -> 'C:\Users\[USER_NAME]\AppData\Roaming\Loom\storage\preferences.json'

and

Error: EBUSY: resource busy or locked, rename 'C:\Users\[USER_NAME]\AppData\Roaming\Loom\storage\selected_audio_device.json.747280505' -> 'C:\Users\[USER_NAME]\AppData\Roaming\Loom\storage\selected_audio_device.json'

What could be the cause here? We also to make sure to always await every set and get that we do

Happy to contribute if you could point me in the right direction as well :)

@paulius005
Copy link
Author

We are on 4.1.6

@vhmth
Copy link

vhmth commented Mar 19, 2019

We are also getting EBUSY. Presumably same issue bubbled up as a different FS error.

@NickPepper
Copy link

NickPepper commented Jan 14, 2020

The same issue with "EPERM ... rename..." using version 4.1.8 - on Windows and on release build of my Electron app only (on 'development' environment all is OK as well as on all *nixes).
Any hints or news?

@jviotti
Copy link
Member

jviotti commented Mar 19, 2020

I believe the rename operations are due the atomic write features, but there must be an underlying issue with Windows that prevents them from happening.

How reliably can you reproduce this errors? Does it happen every time or rarely?

Do you have any anti-virus software installed on those machines?

on Windows and on release build of my Electron app only (on 'development' environment all is OK as well as on all *nixes). Any hints or news?

I heard about some anti-virus softwares that attempt to automatically quarantine files in certain locations by moving them away, scanning them in a safe place, and putting them back in (which could be causing EBUSY and EPERM as electron-json-storage is kept waiting on the file, or loses permissions to it).

These programs usually don't scan the whole hard drive, but certain system locations. It could be that the path you use for local development is not included in these quarantine paths, but it is once you globally install it in the system?

Can you confirm you are using one of these programs (I guess Windows Defender counts) and that it works if you try to whitelist the paths where the Electron app is installed?

@mifi
Copy link

mifi commented Apr 17, 2020

All Node.js database modules using write-file-atomic are suffering from this. See sindresorhus/electron-store#103
Windows rename function tends to fail a lot, especially due to antivirus. workaround is to retry.

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

No branches or pull requests

5 participants