New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`yarn install` fails inside /mnt with EINVAL for lstat during step 3 #2448

Closed
khuongduybui opened this Issue Aug 24, 2017 · 107 comments

Comments

Projects
None yet
@khuongduybui

khuongduybui commented Aug 24, 2017

  • Your Windows build number: Version 10.0.16273.1000

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)

Running yarn (install) in a directory inside /mnt/c/Users/foo/bar

$ pwd
/mnt/c/Users/duybui/code/web/old
$ yarn
yarn install v0.27.5
warning package.json: No license field
info No lockfile found.
warning aurelia-web@1.0.0: No license field
[1/4] Resolving packages...
warning aurelia-cli > npm > request > node-uuid@1.4.8: Use uuid module instead
warning browser-sync > browser-sync-ui > weinre > express@2.5.11: express 2.x series is deprecated
warning browser-sync > browser-sync-ui > weinre > express > connect@1.9.2: connect 1.x series is deprecated
[2/4] Fetching packages...
warning fsevents@1.1.2: The platform "linux" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "muicss@0.9.22" has unmet peer dependency "react@^0.14.0 || ^15.0.0".
error An unexpected error occurred: "EINVAL: invalid argument, lstat '/mnt/c/Users/duybui/code/web/old/node_modules/accord/node_modules/cliui/README.md'".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/c/Users/duybui/code/web/old/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
  • What's wrong / what should be happening instead:
    Note that every time I run the command it may fail while lstat'ing a different file.
@khuongduybui

This comment has been minimized.

Show comment
Hide comment
@khuongduybui

khuongduybui Aug 24, 2017

My current workaround is to create a node_modules directory outside /mnt, then ln -s it into my directory inside /mnt.

khuongduybui commented Aug 24, 2017

My current workaround is to create a node_modules directory outside /mnt, then ln -s it into my directory inside /mnt.

@suitupalex

This comment has been minimized.

Show comment
Hide comment
@suitupalex

suitupalex Aug 24, 2017

Related issue in the Yarn repo: yarnpkg/yarn#4188

suitupalex commented Aug 24, 2017

Related issue in the Yarn repo: yarnpkg/yarn#4188

@hikurangi

This comment has been minimized.

Show comment
Hide comment
@hikurangi

hikurangi Sep 3, 2017

Also getting this when adding a dependency from the command line. I can install packages successfully using npm, so am I correct in thinking that this is a Yarn issue, not a WSL one?

I'm on 16281.rs3 fwiw.

hikurangi commented Sep 3, 2017

Also getting this when adding a dependency from the command line. I can install packages successfully using npm, so am I correct in thinking that this is a Yarn issue, not a WSL one?

I'm on 16281.rs3 fwiw.

@khuongduybui

This comment has been minimized.

Show comment
Hide comment
@khuongduybui

khuongduybui Sep 4, 2017

It's a WSL issue with the recent file system later changes

khuongduybui commented Sep 4, 2017

It's a WSL issue with the recent file system later changes

@tjmonsi

This comment has been minimized.

Show comment
Hide comment
@tjmonsi

tjmonsi Sep 4, 2017

It fails on the new build of windows. I reverted back to 16251.rs3 and yarn works fine again

tjmonsi commented Sep 4, 2017

It fails on the new build of windows. I reverted back to 16251.rs3 and yarn works fine again

@sunilmut

This comment has been minimized.

Show comment
Hide comment
@sunilmut

sunilmut Sep 5, 2017

Member

Adding @SvenGroot who is taking a look at this. Also, marking it as a bug.

Member

sunilmut commented Sep 5, 2017

Adding @SvenGroot who is taking a look at this. Also, marking it as a bug.

@sunilmut sunilmut added the bug label Sep 5, 2017

@treebeard

This comment has been minimized.

Show comment
Hide comment
@treebeard

treebeard Sep 10, 2017

Also fails on 16278.rs3, npm works fine

treebeard commented Sep 10, 2017

Also fails on 16278.rs3, npm works fine

@simonbuchan

This comment has been minimized.

Show comment
Hide comment
@simonbuchan

simonbuchan Sep 11, 2017

This looks like it's the same error in React Native's packager (roughly equivalent to webpack --watch):

✘130 ➜ yarn start
yarn start v1.0.1
$ node node_modules/react-native/local-cli/cli.js start
Scanning 723 folders for symlinks in /mnt/c/code/learning-hub/mobile-app/node_modules (80ms)
 ┌────────────────────────────────────────────────────────────────────────────┐
 │  Running packager on port 8081.                                            │
 │                                                                            │
 │  Keep this packager running while developing on any JS projects. Feel      │
 │  free to close this tab and run your own packager instance if you          │
 │  prefer.                                                                   │
 │                                                                            │
 │  https://github.com/facebook/react-native                                  │
 │                                                                            │
 └────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
   /mnt/c/code/learning-hub/mobile-app

Loading dependency graph...
React packager ready.

Loading dependency graph, done.
Bundling `index.android.js`
  Transforming modules  100.0% (913/913), done.
 ERROR  EINVAL: invalid argument, lstat '/mnt/c/code/learning-hub/mobile-app/.git/index.lock'
{"errno":-22,"code":"EINVAL","syscall":"lstat","path":"/mnt/c/code/learning-hub/mobile-app/.git/index.lock"}
Error: EINVAL: invalid argument, lstat '/mnt/c/code/learning-hub/mobile-app/.git/index.lock'
    at Error (native)

See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
error Command failed with exit code 11.

This one is pretty intermittent though.

simonbuchan commented Sep 11, 2017

This looks like it's the same error in React Native's packager (roughly equivalent to webpack --watch):

✘130 ➜ yarn start
yarn start v1.0.1
$ node node_modules/react-native/local-cli/cli.js start
Scanning 723 folders for symlinks in /mnt/c/code/learning-hub/mobile-app/node_modules (80ms)
 ┌────────────────────────────────────────────────────────────────────────────┐
 │  Running packager on port 8081.                                            │
 │                                                                            │
 │  Keep this packager running while developing on any JS projects. Feel      │
 │  free to close this tab and run your own packager instance if you          │
 │  prefer.                                                                   │
 │                                                                            │
 │  https://github.com/facebook/react-native                                  │
 │                                                                            │
 └────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
   /mnt/c/code/learning-hub/mobile-app

Loading dependency graph...
React packager ready.

Loading dependency graph, done.
Bundling `index.android.js`
  Transforming modules  100.0% (913/913), done.
 ERROR  EINVAL: invalid argument, lstat '/mnt/c/code/learning-hub/mobile-app/.git/index.lock'
{"errno":-22,"code":"EINVAL","syscall":"lstat","path":"/mnt/c/code/learning-hub/mobile-app/.git/index.lock"}
Error: EINVAL: invalid argument, lstat '/mnt/c/code/learning-hub/mobile-app/.git/index.lock'
    at Error (native)

See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
error Command failed with exit code 11.

This one is pretty intermittent though.

@sunilmut

This comment has been minimized.

Show comment
Hide comment
@sunilmut

sunilmut Sep 14, 2017

Member

We have been trying to get to the bottom of this issue, but the bug seems very evasive. Every time we try to gather an strace or put it under the debugger, it does not repro. Seems like some kind of race condition. If someone is able to get a strace of the failing command, that might shed some light. strace -o <trace_file> -ff <failing_cmd>

Member

sunilmut commented Sep 14, 2017

We have been trying to get to the bottom of this issue, but the bug seems very evasive. Every time we try to gather an strace or put it under the debugger, it does not repro. Seems like some kind of race condition. If someone is able to get a strace of the failing command, that might shed some light. strace -o <trace_file> -ff <failing_cmd>

@AndyGauge

This comment has been minimized.

Show comment
Hide comment
@AndyGauge

AndyGauge Sep 14, 2017

I attempted to create a react app using yarn create-react-app hello-api and ran it through the strace recommended. I zipped up the output.

https://github.com/AndyGauge/yarn-debug/blob/master/yarn-fail.zip

AndyGauge commented Sep 14, 2017

I attempted to create a react app using yarn create-react-app hello-api and ran it through the strace recommended. I zipped up the output.

https://github.com/AndyGauge/yarn-debug/blob/master/yarn-fail.zip

@khuongduybui

This comment has been minimized.

Show comment
Hide comment
@khuongduybui

khuongduybui Sep 15, 2017

When I run strace -o ~/trace.log yarn install the error does NOT show up.
When I run strace -o /dev/null yarn install the error DOES show up.

khuongduybui commented Sep 15, 2017

When I run strace -o ~/trace.log yarn install the error does NOT show up.
When I run strace -o /dev/null yarn install the error DOES show up.

@AndyGauge

This comment has been minimized.

Show comment
Hide comment
@AndyGauge

AndyGauge Sep 15, 2017

rails webpack:install fails with the same message. The trace.log file: https://github.com/AndyGauge/yarn-debug/blob/master/trace.log

AndyGauge commented Sep 15, 2017

rails webpack:install fails with the same message. The trace.log file: https://github.com/AndyGauge/yarn-debug/blob/master/trace.log

@CrshOverride

This comment has been minimized.

Show comment
Hide comment
@CrshOverride

CrshOverride Sep 15, 2017

I was able to reproduce locally. You can download a zip of all of the trace files at https://www.dropbox.com/s/oy78n0qvtqqyxwb/yarn_trace.zip?dl=0

CrshOverride commented Sep 15, 2017

I was able to reproduce locally. You can download a zip of all of the trace files at https://www.dropbox.com/s/oy78n0qvtqqyxwb/yarn_trace.zip?dl=0

@hikurangi

This comment has been minimized.

Show comment
Hide comment
@hikurangi

hikurangi Sep 16, 2017

If it helps, for me the problem seems to be resolved in 16288.1.

hikurangi commented Sep 16, 2017

If it helps, for me the problem seems to be resolved in 16288.1.

@khuongduybui

This comment has been minimized.

Show comment
Hide comment
@khuongduybui

khuongduybui Sep 16, 2017

No the original issue has absolutely NOT been resolved in latest insider (non skip-ahead) build.

khuongduybui commented Sep 16, 2017

No the original issue has absolutely NOT been resolved in latest insider (non skip-ahead) build.

@wycats

This comment has been minimized.

Show comment
Hide comment
@wycats

wycats Sep 19, 2017

I was able to reproduce this issue with strace on.

trace.zip

wycats commented Sep 19, 2017

I was able to reproduce this issue with strace on.

trace.zip

@SvenGroot

This comment has been minimized.

Show comment
Hide comment
@SvenGroot

SvenGroot Sep 21, 2017

Member

Thanks for all the input. We've been able to determine the root cause of this issue and are working on a fix.

Member

SvenGroot commented Sep 21, 2017

Thanks for all the input. We've been able to determine the root cause of this issue and are working on a fix.

@khuongduybui

This comment has been minimized.

Show comment
Hide comment
@khuongduybui

khuongduybui Sep 21, 2017

You made my (our) day! Keep up the good work.

khuongduybui commented Sep 21, 2017

You made my (our) day! Keep up the good work.

mqudsi added a commit to fish-shell/fish-shell that referenced this issue Sep 24, 2017

mqudsi added a commit to fish-shell/fish-shell that referenced this issue Sep 24, 2017

@Warblefly

This comment has been minimized.

Show comment
Hide comment
@Warblefly

Warblefly Sep 26, 2017

The news of the cause being determined is very, very welcome. I shall be glad to test it. Maybe the fix is in build 16296, which just landed here?

Warblefly commented Sep 26, 2017

The news of the cause being determined is very, very welcome. I shall be glad to test it. Maybe the fix is in build 16296, which just landed here?

@AndyGauge

This comment has been minimized.

Show comment
Hide comment
@AndyGauge

AndyGauge Sep 26, 2017

I was upgraded to 16296 yesterday and still had to work around the issue by moving across file systems to run yarn add I'm sure it still affects yarn install.

AndyGauge commented Sep 26, 2017

I was upgraded to 16296 yesterday and still had to work around the issue by moving across file systems to run yarn add I'm sure it still affects yarn install.

@SvenGroot

This comment has been minimized.

Show comment
Hide comment
@SvenGroot

SvenGroot Sep 26, 2017

Member

We're still working on the fix, so it's not available yet. I'll update this thread once the fix becomes available.

Member

SvenGroot commented Sep 26, 2017

We're still working on the fix, so it's not available yet. I'll update this thread once the fix becomes available.

@jingsam

This comment has been minimized.

Show comment
Hide comment
@jingsam

jingsam Sep 30, 2017

This issue has annoyed me for a month, expecting fix it in the next release.

jingsam commented Sep 30, 2017

This issue has annoyed me for a month, expecting fix it in the next release.

@Verikon

This comment has been minimized.

Show comment
Hide comment
@Verikon

Verikon Sep 30, 2017

@jingsam agree, this one is particularly painful.

Verikon commented Sep 30, 2017

@jingsam agree, this one is particularly painful.

@sisou

This comment has been minimized.

Show comment
Hide comment
@sisou

sisou Dec 1, 2017

The update requires a computer reboot, but afterwards it works for me.

sisou commented Dec 1, 2017

The update requires a computer reboot, but afterwards it works for me.

@Warblefly

This comment has been minimized.

Show comment
Hide comment
@Warblefly

Warblefly Dec 2, 2017

A quick summary of #2712: the files that intermittently go missing are simply "not found". This isn't an EINVAL error. Not sure if it's exactly related to #2448.

Warblefly commented Dec 2, 2017

A quick summary of #2712: the files that intermittently go missing are simply "not found". This isn't an EINVAL error. Not sure if it's exactly related to #2448.

@codeart1st

This comment has been minimized.

Show comment
Hide comment
@codeart1st

codeart1st Dec 2, 2017

Works for me too, no issues anymore

codeart1st commented Dec 2, 2017

Works for me too, no issues anymore

@mindhaq

This comment has been minimized.

Show comment
Hide comment
@mindhaq

mindhaq Dec 2, 2017

after applying the update, the error is no more.

but - was this always so slow? create-react-app test takes over 62 seconds in bash compared to 16 seconds in cmd on a decent i7 4.2Ghz workstation.

mindhaq commented Dec 2, 2017

after applying the update, the error is no more.

but - was this always so slow? create-react-app test takes over 62 seconds in bash compared to 16 seconds in cmd on a decent i7 4.2Ghz workstation.

@rhyek

This comment has been minimized.

Show comment
Hide comment
@rhyek

rhyek Dec 4, 2017

Yeah, I hadn't used WSL for months. Trying it now and adding packages using yarn is incredibly slow for my project. I usually work on it on my dual booted Ubuntu install and it is definitely quicker there.

rhyek commented Dec 4, 2017

Yeah, I hadn't used WSL for months. Trying it now and adding packages using yarn is incredibly slow for my project. I usually work on it on my dual booted Ubuntu install and it is definitely quicker there.

@bitcrazed

This comment has been minimized.

Show comment
Hide comment
@bitcrazed

bitcrazed Dec 6, 2017

Collaborator

@rhyek @mindhaq Disk IO perf is a well known WSL issue that Sven is working with the storage team to address in future WSL releases.

However, while WSL disk perf is slower right now, it should work correctly. Can you confirm?

Collaborator

bitcrazed commented Dec 6, 2017

@rhyek @mindhaq Disk IO perf is a well known WSL issue that Sven is working with the storage team to address in future WSL releases.

However, while WSL disk perf is slower right now, it should work correctly. Can you confirm?

@rhyek

This comment has been minimized.

Show comment
Hide comment
@rhyek

rhyek Dec 6, 2017

@bitcrazed Yes, everything is functional.

rhyek commented Dec 6, 2017

@bitcrazed Yes, everything is functional.

@bitcrazed

This comment has been minimized.

Show comment
Hide comment
@bitcrazed

bitcrazed Dec 6, 2017

Collaborator

Great thanks.

Closing for now since we have a few confirmations that the issue appears to be resolved.

Collaborator

bitcrazed commented Dec 6, 2017

Great thanks.

Closing for now since we have a few confirmations that the issue appears to be resolved.

@bitcrazed bitcrazed closed this Dec 6, 2017

@mindhaq

This comment has been minimized.

Show comment
Hide comment
@mindhaq

mindhaq Dec 7, 2017

@bitcrazed Apart from slow IO it is working fine now, thank you!

It's good to hear that disk perf is being addressed. Is there an Issue to follow on?

mindhaq commented Dec 7, 2017

@bitcrazed Apart from slow IO it is working fine now, thank you!

It's good to hear that disk perf is being addressed. Is there an Issue to follow on?

@bitcrazed

This comment has been minimized.

Show comment
Hide comment
@bitcrazed

bitcrazed Dec 7, 2017

Collaborator

Thanks for letting us know.

The larger disk perf issue is primarily being tracked in issue #873

Collaborator

bitcrazed commented Dec 7, 2017

Thanks for letting us know.

The larger disk perf issue is primarily being tracked in issue #873

@shjyh

This comment has been minimized.

Show comment
Hide comment
@shjyh

shjyh Dec 11, 2017

I upgrade my OS to newest insider preview(17025.10000),still have this problem

shjyh commented Dec 11, 2017

I upgrade my OS to newest insider preview(17025.10000),still have this problem

@therealkenc

This comment has been minimized.

Show comment
Hide comment
@therealkenc

therealkenc Dec 11, 2017

Collaborator

newest insider preview(17025.10000)

this

Collaborator

therealkenc commented Dec 11, 2017

newest insider preview(17025.10000)

this

@Nadav-Ruskin

This comment has been minimized.

Show comment
Hide comment
@Nadav-Ruskin

Nadav-Ruskin Jul 15, 2018

I am using Windows version 1803, build 17134.112 and still encountering this bug (the general, parallel building bug).

Nadav-Ruskin commented Jul 15, 2018

I am using Windows version 1803, build 17134.112 and still encountering this bug (the general, parallel building bug).

@muyu66

This comment has been minimized.

Show comment
Hide comment
@muyu66

muyu66 Jul 17, 2018

@Nadav-Ruskin NPM 6.0 is recommended, It is no worse than yarn now

muyu66 commented Jul 17, 2018

@Nadav-Ruskin NPM 6.0 is recommended, It is no worse than yarn now

@mrmckeb

This comment has been minimized.

Show comment
Hide comment
@mrmckeb

mrmckeb Jul 17, 2018

That's not really a fair answer, @muyu66. First, it's not true that npm@6 matches Yarn in terms of functionality. More importantly, WSL is not meant to be limited to a subset of tools, and you can't expect development teams to drop Yarn because none is "recommended".

mrmckeb commented Jul 17, 2018

That's not really a fair answer, @muyu66. First, it's not true that npm@6 matches Yarn in terms of functionality. More importantly, WSL is not meant to be limited to a subset of tools, and you can't expect development teams to drop Yarn because none is "recommended".

@Nadav-Ruskin

This comment has been minimized.

Show comment
Hide comment
@Nadav-Ruskin

Nadav-Ruskin Jul 17, 2018

Sorry if I haven't made myself clear: The error I'm experiencing is more related to #2606, that is, I can't build (my own projects) using make -j<anything larger than 1>. I've posted about it here because this thread contains the workaround and claims that the issue has been fixed.
I'll make a new issue to avoid further confusion.

Nadav-Ruskin commented Jul 17, 2018

Sorry if I haven't made myself clear: The error I'm experiencing is more related to #2606, that is, I can't build (my own projects) using make -j<anything larger than 1>. I've posted about it here because this thread contains the workaround and claims that the issue has been fixed.
I'll make a new issue to avoid further confusion.

@tomitrescak

This comment has been minimized.

Show comment
Hide comment
@tomitrescak

tomitrescak Aug 6, 2018

I am receiving this bug still on the Creators Edition and having the "EINVAL: invalid argument, lstat" I can provide the package.json

tomitrescak commented Aug 6, 2018

I am receiving this bug still on the Creators Edition and having the "EINVAL: invalid argument, lstat" I can provide the package.json

@onomatopellan

This comment has been minimized.

Show comment
Hide comment
@onomatopellan

onomatopellan Aug 6, 2018

@tomitrescak what build? (Win+R -> type winver)
Your OS build number should be 16299.98 or later to get this fix.

onomatopellan commented Aug 6, 2018

@tomitrescak what build? (Win+R -> type winver)
Your OS build number should be 16299.98 or later to get this fix.

@tomitrescak

This comment has been minimized.

Show comment
Hide comment
@tomitrescak

tomitrescak Aug 6, 2018

Ah, ok, I got 16299.64, installing update now.

tomitrescak commented Aug 6, 2018

Ah, ok, I got 16299.64, installing update now.

@therealkenc therealkenc removed the bug label Aug 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment