-
Notifications
You must be signed in to change notification settings - Fork 80
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
Error: EPERM: operation not permitted, open #116
Comments
Hi @SirWaddles , Thanks for the report! Do you have a whole stack trace I can take a look at? I'm basically trying to find out if this problem happens when locking or unlocking. Is this happening on other OSes, or just Windows? |
Hi, @jviotti my app is installed on more than 1k Windows and 400 Mac computers and 5-10% Windows users are facing the same issue. Everything is fine on the Mac. |
@valhalla13 @SirWaddles Do you mean it comes on any It'd really help if you can share a stack trace with me. |
@jviotti Hi, sorry about taking this long. I don't think this is the trace you're after, but it seems to be the only one I'm able to print.
I don't have any anti-virus, apart from Microsoft Defender and this is happening in my environment. |
See: #116 Signed-off-by: Juan Cruz Viotti <[email protected]>
See: #116 Signed-off-by: Juan Cruz Viotti <[email protected]>
See: #116 Signed-off-by: Juan Cruz Viotti <[email protected]>
@SirWaddles Thanks a lot for the stack-trace; that helps a lot! Can you try v4.1.3 and see if the issue is gone? Windows Defender can definitely be the cause. It gave us a lot of head-aches on https://etcher.io :D |
I have the same exact problem with v4.1.3. For example: Now, I am not using these methods directly. I have made service wrappers and call functions which return promises that resolve the data returned from the storage.get() method. Even in this case, when I chain the promises (This is some badly written code. It is just an example.): `promiseFunctionCall()
|
Hey @zankooh , Hm, that's very interesting. Do you have a stack trace you can share? |
I upgraded our app to 4.1.4 from 4.1.3 in hopes to get the bug fixed, but I can confirm that 4.1.4 still has the issue. I myself am unable to reproduce it, but it happens on about 5-10% of our windows users. There are very few OSX and Linux installs, so I can't rule them out completely, but no incidents there so far... |
I think I managed to solve the problem. It might not the electron-json-storage itself. The problem might be file system related. Whenever I read a .json file with electron-json-storage, the file gets temporarily locked (by the file system I assume?) and then it gets unlocked, being free to read without any problems. Now, if I try to read the same file while it's locked, I get the error. In order to avoid the problem, I store the data with electron-json-storage (for permanent storage) and localStorage at the same time, but read data from localStorage only. In case localStorage gets cleared, I read all data stored with electron-json-storage and write it to localStorage. I haven't had the problem since. |
I solved it similarly: |
Very interesting! Presumably this is a Windows only issue, right? I think we could add logic to I might at least draft a patch and we can see how it goes. |
See: #116 Signed-off-by: Juan Cruz Viotti <[email protected]>
I just sent #122. Let me know how it goes! |
See: #116 Signed-off-by: Juan Cruz Viotti <[email protected]>
See: #116 Signed-off-by: Juan Cruz Viotti <[email protected]>
I published the possible fix as v4.1.5 |
I have a similar issue. I can´t edit the config.json from the electron store. I get this error. If I try to change the file in the explorer or if I try to change the file with the set method. I manually changed the path inside the electron-store module. Now I can access the File and modify it. My operating system is Windows 10 //const defaultCwd = (electron.app || electron.remote.app).getPath('userData'); |
Hey @kevintravels93
Do you mean you can reproduce the I googled around and I found out that this tool allows you to inspect what processes are opening what files in Windows. Can you revert back the directory setting, and once you reproduce the issue, try to see what processes and locking this file? See more instructions here: https://serverfault.com/a/1980. This is supposedly the standard place in Windows to store application data, so sounds worth figuring out what in your system is causing problems there. |
I'm getting the above error on Windows while using
electron-json-storage:4.1.2
I'm building an import procedure which does a large number of requests inside of a single
Promise.all
, andstorage.get
is being used inside of electron'ssession.webRequest.onBeforeSendHeaders
(as an authentication mechanism)I think this has to do with the concurrency in the event loop. There's a lot of calls on
storage.get
that stack up before getting resolved.Only solution I can think of is that I implement a lazy cache somewhere, which I will probably end up doing. But I was wondering if this is a known limitation/issue of
electron-json-storage
.Thanks,
Waddles
The text was updated successfully, but these errors were encountered: