Gatsby doesn't seems to build on Windows Subsystem Linux due to EACCES issues. After running yarn start / gatsby develop and a successful build, the script keeps trying to update .cache/redux and fails due to a permission error. And because of that, it keeps generating these reduxcache directories:
โโโ ๏ reduxcache8B3FK8/
โ โโโโโ ๏
redux.node.state_0
โ โโโโโ ๏
redux.rest.state
โโโ ๏ reduxcacheIUlbUr/
โ โโโโโ ๏
redux.node.state_0
โ โโโโโ ๏
redux.rest.state
Basically just run Gatsby in that particular environment:
gatsby new hello-world && cd hello-worldyarn startGatsby magic ๐โจ
&& successfully swaps .cache/redux -> for reduxcache****** without permissions error.
success run queries - 0.035s - 5/5 141.16/s
warn Error persisting state: EACCES: permission denied, rename '/home/selenite/Projects/Garbage/gatsby-test/.cache/redux' ->
warn Error persisting state: EACCES: permission denied, rename '/home/selenite/Projects/Garbage/gatsby-test/.cache/redux' ->
warn Error persisting state: EACCES: permission denied, rename '/home/selenite/Projects/Garbage/gatsby-test/.cache/redux' ->
...
OS: Windows Subsystem Linux
Node: tried v13.11.0 and v10.19.0 (npm v6.13.4)
System:
OS: Linux 4.4 Ubuntu 18.04.4 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Shell: 5.4.2 - /usr/bin/zsh
Binaries:
Node: 13.11.0 - ~/.nvm/versions/node/v13.11.0/bin/node
Yarn: 1.7.0 - /mnt/c/Program Files (x86)/Yarn/bin/yarn
npm: 6.13.7 - ~/.nvm/versions/node/v13.11.0/bin/npm
Languages:
Python: 2.7.17 - /usr/bin/python
npmPackages:
gatsby: ^2.19.45 => 2.19.45
gatsby-image: ^2.2.44 => 2.2.44
gatsby-plugin-manifest: ^2.2.48 => 2.2.48
gatsby-plugin-offline: ^3.0.41 => 3.0.41
gatsby-plugin-react-helmet: ^3.1.24 => 3.1.24
gatsby-plugin-sharp: ^2.4.13 => 2.4.13
gatsby-source-filesystem: ^2.1.56 => 2.1.56
gatsby-transformer-sharp: ^2.3.19 => 2.3.19
npmGlobalPackages:
gatsby-cli: 2.11.4
Permissions
rwxrwxrwx 1 selenite selenite 4 KiB Thu Apr 2 14:37:18 2020 ๏ .cache/
rwxrwxrwx 1 selenite selenite 4 KiB Thu Apr 2 14:30:07 2020 ๎ node_modules/
rwxrwxrwx 1 selenite selenite 4 KiB Thu Apr 2 14:37:19 2020 ๏ public/
rwx------ 1 selenite selenite 4 KiB Thu Apr 2 14:31:15 2020 ๏ reduxcache8B3FK8/
rwx------ 1 selenite selenite 4 KiB Thu Apr 2 14:31:17 2020 ๏ reduxcacheIUlbUr/
rwx------ 1 selenite selenite 4 KiB Thu Apr 2 14:37:20 2020 ๏ reduxcacheRKsZSq/
rwx------ 1 selenite selenite 4 KiB Thu Apr 2 14:37:22 2020 ๏ reduxcachelY9FfI/
rwx------ 1 selenite selenite 4 KiB Thu Apr 2 14:37:19 2020 ๏ reduxcachewtsEkf/
rwxrwxrwx 1 selenite selenite 4 KiB Thu Apr 2 13:37:21 2020 ๏ src/
rw-rw-rw- 1 selenite selenite 672 KiB Thu Apr 2 13:37:21 2020 ๎ package-lock.json
rw-rw-rw- 1 selenite selenite 1 KiB Thu Apr 2 13:37:21 2020 ๎ package.json
rw-rw-rw- 1 selenite selenite 373 KiB Thu Apr 2 14:29:46 2020 ๎ yarn.lock
NOTE: What seems to be the problem is that the generated reduxcache****** folders have only rwx----- permissions. Current user (selenite) can't rename and move the folder into .cache/.
Thanks for your amazing work building such a cool tool, Gatsby team! ๐โโ๏ธ
Check out https://github.com/gatsbyjs/gatsby/issues/21982#issuecomment-595864713 Maybe it's the same problem?
@vladar, that looks like exactly what I am experiencing! I will follow that issue instead and close this one. Thank you ๐
For posterity, upgrading to WSL 2 solved the issue for me: https://docs.microsoft.com/en-ca/windows/wsl/wsl2-install
Most helpful comment
Check out https://github.com/gatsbyjs/gatsby/issues/21982#issuecomment-595864713 Maybe it's the same problem?