Gatsby: Gatsby doesn't seem to build on Windows Subsystem Linux [Ubuntu]

Created on 2 Apr 2020  ยท  3Comments  ยท  Source: gatsbyjs/gatsby

Description

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  

Steps to reproduce

Basically just run Gatsby in that particular environment:

  1. gatsby new hello-world && cd hello-world
  2. yarn start

Expected result

Gatsby magic ๐Ÿ™โœจ

&& successfully swaps .cache/redux -> for reduxcache****** without permissions error.

Actual result

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' ->
...

Environment

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! ๐Ÿ™‡โ€โ™€๏ธ

bug

Most helpful comment

Check out https://github.com/gatsbyjs/gatsby/issues/21982#issuecomment-595864713 Maybe it's the same problem?

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings