-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Operation not permitted #103
Comments
This might be a case of npm/write-file-atomic#28. |
I'm currently having this problem too... The bug doens't always show, but it do occurs from time to time though. According to the issue you mentioned, the problem seems already solved, but it seems that this problem is still with this module with the newest 5.1.x series. |
Would the problem vanishes if we could disable all the errors thrown? Though it doesn't seems very safe and dev-friendly. |
store.set("last-recorded-state", {
workTime: workTime / 60000,
restTime: restTime / 60000,
loop: loop,
title: title,
note: note,
isWorkTimeFocused: store.get("fullscreen-work"),
isRestTimeFocused: store.get("fullscreen")
});
store.set("last-recorded-method", methodFromStart); The problem occurred again. This is the code that caused bugs this time. Or, should I just discard this kind of code? If so, what is better? Thanks. |
I am having the same problem. This problem occurs intermittently. OS: Windows 7 sp1 |
Seems that it's a hard-to-solve question... I suggest using trycatches for backporting or prevent 2 processes from modifying the stored content at the same time though it's a bit of uncomfortable to do so and could make your code not so strong... |
Also experiencing this same thing, I initially thought it was due to an antivirus issue, but I realized that I am calling two store.set() at the same time. I then added a setTimeout(function(){store.set()},1000); and I thought I had it fixed but I still get the same issue. the timeout was to try and allow for the first store.set() to complete. Maybe this was the wrong approach? |
I've once again read the doc of this proj, and this time I found something may be good for you (and for me, too). Haven't tested myself, though I'm thinking that by using this, your code may need to be complex. Anyway, I think for using this lib, try-catches are necessary (and it also seems to be the most convenient and least costly solution to partially fix this?) to make your code stronger... |
A user of my app also just reported the same error mifi/lossless-cut#312 I don’t know what’s causing it. I asked the users some questions about what he was doing. Maybe we need to solve it the same way as the EXDEV error by catching and trying again with a normal write? |
I've been doing some research. I think it boils down to the fact that Windows API for rename is very unstable and depends on a lot of factors like anti-virus, any open file handles, and the moon phase.
One problem is that even with And I don't think the So I think either electron-store needs to either:
|
Actually as of now, the developer needs to also wrap the the call to |
I'm fine with either 2 or 3, but I would prefer 3. |
@sindresorhus Here we go (hopefully): https://github.com/fabiospampinato/atomically I'm basically on your same boat and I couldn't find anything better than On the code quality I can't comment too much being the author of this one, but at least when putting the async and sync version of the provided functions side by side the implementation is basically identical, in Happy to work on any eventual issue you guys can find, I'm going to use this library in an Electron app too so any issue you can find I'll be interested in fixing it. |
Ok, so we also noticed these problems. I followed @fabiospampinato's advice and integrated atomically into https://github.com/jurepetrovic/electron-store-atomically Thanks, |
PR welcome to switch to this library. |
@jurepetrovic please make a PR, I've been hoping for this fix for months :p |
I have made PR #130 , but it requires some more testing for real production. I had to change some project data, since I published separate npm package on npmjs for our own use. Thanks and Rgds, |
https://www.npmjs.com/package/electron-store-atomically If we merge this successfully and it works under windows, I'd be very happy to use this original package! |
Side note: this increases the minimum supported Node.js version to 12.12.0. However, electron 9 ships with Node.js 10. This seems like a problem...? |
@lights0123 Electron v9.1.0 ships with v12.14.1. Actually you highlighted a bit of an issue with |
Yep, I was thinking this issue was about Node.js 11 so I was thinking one less. |
User told me, that when application starts from .exe file, this error occurs. If the app is started from console, no problem appeared until now. Maybe this information could be useful to somebody. |
@bad2Dbone which version of the library are you using? The one with |
currently the template given for new version: "electron-store-atomically": "^0.0.2", |
@bad2Dbone It sounds like you are using a version with |
Ok, so we know 2 things:
Am I uderstanding this correctly? |
@jurepetrovic Yeah. Switching to async reads and writes is more about them having a higher default timeout in |
There is another observation which seems important.
All ideas seriously appreciated ! (beer) |
@jurepetrovic There are all sorts of factors that have an impact on this, including if the sun is shining outside or not, and we can't really do much about them, maybe in your case just having all files packages in an |
Ok :) We'll try with this timeout first and then let you know here ;-) Well - despite everything that is going on here and the number of libs included - I still believe computers are exact |
@sindresorhus Can we reopen this issue? I'm still getting the same error reports from client machines. |
We ar now using https://github.com/jurepetrovic/electron-store-atomically which has higher timeout for writing. There were no problems detected so far. |
@bad2Dbone Is it a drop-in replacement for electron-store? |
Yes, you can replace it as-is. But only thing changed is the timeout (from 100ms to 500ms) that is given to the operating system for finishing the write operation. In other words, we allow the operating system more time to do the write operation before aborting. |
I still have this problem electron-store:6.0.1 |
Does my brother still have this problem? |
IMHO pretty much the only lever that can be pulled is giving |
I have this problem in production. Not everytime, but often enough to be disturbing. |
I have the same problem ... |
这个问题你已经解决了嘛? |
Got the following error from Sentry produced by our production app. Could this be due to some odd permissions that the user has changed on their system?
OS: Windows 10.0.17763
Electron: 8.0.0
electron-store: 3.3.0
The text was updated successfully, but these errors were encountered: