WSL: Problem renaming `reduxcache` while saving the redux cache
See original GitHub issueThis is split from https://github.com/gatsbyjs/gatsby/issues/21879
There appears to be a problem for a select number of users when Gatsby wants to save the cache. In particular, moving the temp folder to the main cache folder (through a rename) seems to fail. Reported by @talves, @davidalekna, @huy-nguyen, and maybe @wfendler (the source of their problem is probably caused by this).
It appears to affect a lot of WSL users, if not only them. (@wfendler’s log output shows a user path that indicates the actual Gatsby calls run on a Windows host as well)
Example logs
warn Error persisting state: EACCES: permission denied, rename '/mnt/d/Git/Tailwind/tailwind-gatsby-example/www/site/.cache/redux' ->
warn Error persisting state: EACCES: permission denied, rename 'reduxcachex3k3tg' ->
warn Error persisting state: EACCES: permission denied, rename 'reduxcacheN0NDd9' -> '/home/.../Development/.../.docz/.cache/redux'
Here’s output by @wfendler although I feel this might be a slightly different issue (still caused or leading to this problem):
ENOENT: no such file or directory, open '/Users/williamfendler/Sites/xxxxxx/.cache/app.js'
failed Re-building development bundle - 0.069s
warning Error persisting state: ENOENT: no such file or directory, rename 'reduxcachem7w4vQ' -> '/Users/williamfendler/Sites/xxxxxx/.cache/redux'
Bisect and workaround
As indicated in the original ticket, the problem started to occur with gatsby@2.19.22, downgrading to .21 is a viable workaround for them.
Another workaround seems to be to force clear (sudo) the ~/.npm
, node_modules
, public
, and .cache
folders and to run npm again. To me that indicates a permission problem. I expect that it’s sufficient to clear to the .cache
folder to resolve this problem, but have not confirmed this yet. Also don’t know whether the problem returns after doing so.
Need more input on this. Can anyone confirm this problem exists outside of WSL?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:11 (3 by maintainers)
This actually resolved the problem for me:
original post: https://code.visualstudio.com/docs/remote/wsl#_i-see-eaccess-permission-denied-error-trying-to-rename-a-folder-in-the-open-workspace
I’ve changed this flag in VSCode and all is working now. I think the other way is update Windows and upgrading WSL 1 for version 2
Excelent! Thank’s a lot. I’ve just read the issue and seems that is the problem. Currently I’m on WSL1, but I will only get WSL2 when is GA (cuz I don’t want to be In any ring in Windows Insider).
Will check the .cache clean option and let you know if works.
Awesome comunity.