You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a stored named MasterStore and it creates a MasterStore.json files and everything works prefect. However, after sometime for some reason the .setCache function errors out because it is trying to access some MasterStore.json.temp file. below is the error log
Error: EPERM: operation not permitted, rename 'C:\Users\AppData\Roaming\neclient\MasterStore.json.tmp-900921090850e765' -> 'C:\Users\AppData\Roaming\neclient\MasterStore.json' at renameSync (node:fs:993:3) at attempt (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\utils\retryify.js:33:27) at attempt (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\utils\retryify.js:39:36) at attempt (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\utils\retryify.js:39:36) at Object.writeFileSync (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\index.js:160:50) at ElectronStore._write (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\conf\dist\source\index.js:375:28) at set store [as store] (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\conf\dist\source\index.js:296:14) at ElectronStore.set (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\conf\dist\source\index.js:189:20) at Object.setCacheValue (C:\Users\AppData\Local\Programs\neclient\resources\app\system_services\cache-service.js:59:21) at BeforeAppShutDown (C:\Users\AppData\Local\Programs\neclient\resources\app\main.js:352:23)
i crate the store using
const masterStore = new Store({ name: 'MasterStore' });
and set contents by masterStore.set(key, value);
can someone tell me what's the reason its doing this? and how i can fix it?
The text was updated successfully, but these errors were encountered:
conf is updating its stores synchronously (sindresorhus/electron-store#106), which doesn't give this library a lot of time to write the file to disk, as it can't just block the main thread for a long time, it should be writing asynchronously instead if possible, that would give it more time to retry operations.
Other than that Windows is a dumpster fire, if for whatever reason it just doesn't allow you to rename a file there's nothing the library can do to force it.
I guess this library could try to write non-atomically in those situations, but that's nonsense for a library that explicitly provides atomic writes.
Hi @fabiospampinato,
thanks for the explanation, no I do not have a public repo of my app that you can use. My application is in electron-js and I use a cache package called electron-store which uses your lib.
Hi,
I was asked to open a issue here by sindresorhus as he mentioned that you could help here (original request - sindresorhus/electron-store#261)
Issue:
I have a stored named MasterStore and it creates a MasterStore.json files and everything works prefect. However, after sometime for some reason the .setCache function errors out because it is trying to access some MasterStore.json.temp file. below is the error log
Error: EPERM: operation not permitted, rename 'C:\Users\AppData\Roaming\neclient\MasterStore.json.tmp-900921090850e765' -> 'C:\Users\AppData\Roaming\neclient\MasterStore.json' at renameSync (node:fs:993:3) at attempt (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\utils\retryify.js:33:27) at attempt (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\utils\retryify.js:39:36) at attempt (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\utils\retryify.js:39:36) at Object.writeFileSync (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\atomically\dist\index.js:160:50) at ElectronStore._write (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\conf\dist\source\index.js:375:28) at set store [as store] (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\conf\dist\source\index.js:296:14) at ElectronStore.set (C:\Users\AppData\Local\Programs\neclient\resources\app\node_modules\conf\dist\source\index.js:189:20) at Object.setCacheValue (C:\Users\AppData\Local\Programs\neclient\resources\app\system_services\cache-service.js:59:21) at BeforeAppShutDown (C:\Users\AppData\Local\Programs\neclient\resources\app\main.js:352:23)
i crate the store using
const masterStore = new Store({ name: 'MasterStore' });
and set contents by masterStore.set(key, value);
can someone tell me what's the reason its doing this? and how i can fix it?
The text was updated successfully, but these errors were encountered: