question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WSL: Problem renaming `reduxcache` while saving the redux cache

See original GitHub issue

This 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

15reactions
pccassincommented, Mar 31, 2020

This actually resolved the problem for me:

That's a known problem with the WSL file system implementation (Microsoft/WSL#3395, Microsoft/WSL#1956) caused by the file watcher active by VSCode. The issue will only be fixed in WSL 2.

To avoid the issue, set remote.WSL.fileWatcher.polling to true. However, polling based file watching has a performance impact for large workspaces.

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

6reactions
julianruizsacommented, Mar 22, 2020

Hi! I’m experiencing this exact problem with Gatsby 2.20.2 (CLI 2.11.0) on Ubuntu WSL (with Windows Terminal) when I use VSCode 1.43.1 🙁

Seems related to https://code.visualstudio.com/docs/remote/wsl#_i-see-eaccess-permission-denied-error-trying-to-rename-a-folder-in-the-open-workspace

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby doesn't seem to build on Windows Subsystem Linux ...
Fix: Update to WSL2 by following the instructions here: https://learn.microsoft.com/en-us/windows/wsl/wsl2-kernel.
Read more >
Learning React and Gatsby by building a blog - dev
I think the problem isn't necessarily React and Gatsby, but the build ... WSL: Problem renaming `reduxcache` while saving the redux cache.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found