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 on windows only #31

Closed
helenburns opened this issue Nov 25, 2017 · 9 comments
Closed

EPERM operation not permitted, rename on windows only #31

helenburns opened this issue Nov 25, 2017 · 9 comments

Comments

@helenburns
Copy link

Have been using electron store in mac perfectly, but when packaged for windows it randomly throws this error:

capture

When you click ok it carries on absolutely fine.

It seems windows doesn't let you store.set anything new during some processes... it looks to coincide with writing files with node.js but I can't be sure, does it 'lock' the config.json file at any point for any reason? Does this make sense to anyone? I'm really stuck on this and don't want to replace electron.store as a last resort as it's perfect otherwise!

@sindresorhus
Copy link
Owner

Duplicate of #30

@helenburns
Copy link
Author

Thank you for your prompt reply... they do look like the same issues, apologies for not noticing, I am quite new to all things Electron! Can I ask a question though... @bampakoa seems to suggest here that it's related to new specific version of electron-store...

After some digging I found out that electron-store has been updated to the latest version of conf which now introduces an atomic writing feature

...and I'm wondering if I can use an older version of electron-store to temporarily get around this issues until a fix is released by asar? Would I lose any functionality... I am literally only storing about 15 key/value pairs. My app is due for release pretty soon!

@helenburns
Copy link
Author

...And if so, which version number please? Sorry, and thanks!

@bampakoa
Copy link

bampakoa commented Nov 26, 2017

@helenburns You should use electron-store 1.2.0 but lock conf module to version 1.1.2

"dependencies": {
    "conf": "1.1.2",
    "electron-store": "1.2.0"
  }

@helenburns
Copy link
Author

@bampakoa ahhh thanks... I've installed both those exact versions, but the ^ is still there in my package.json, so I've just manually removed it for both... is this ok? Thanks for your help! I'm am still learning!

@ahallicks
Copy link

I don't think this is the same issue as #31 as I get it in an unpackaged app too. I have an app that stores settings to disk every 5 seconds or so and I get this error a couple of times a day. It looks like somewhere along the line the file is being locked by something preventing it being written.

I have had this corrupt the JSON file in the past though I have not seen that particular issue for a while now. I'll keep an eye on it and if I can pin it down at all I'll comment back here.

On another note I did try to downgrade versions to the ones suggested but this caused other, even worse issues!

@aceimnorstuvwxz
Copy link

same problem on a few windows clients

@julienma
Copy link

julienma commented Oct 8, 2018

Had the same EPERM issue in our exception reporting.
I don't know if the user saw an error dialog.

It happened on Windows 10, on a packaged app, using:

electron-store@^1.3.0:
  version "1.3.0"
  resolved "https://registry.yarnpkg.com/electron-store/-/electron-store-1.3.0.tgz#ee488a28a61fb982fd35b658fb9cb6331eb201f8"
  dependencies:
    conf "^1.3.0"

@batnyu
Copy link

batnyu commented Dec 7, 2018

I had the same error and I fixed it thanks to @zankooh with his post :
electron-userland/electron-json-storage#116 (comment)

The issue is related to the file system. I had too much store.get() close to each other in my code which causes the EPERM error. The electron app tries to read the file too fast compared to the file system lock mechanism I guess.

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

7 participants