Skip to content
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
Closed

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

khuongduybui opened this issue Aug 24, 2017 · 107 comments

Comments

@khuongduybui
Copy link

  • 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
Copy link
Author

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

@umamialex
Copy link

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

@hikurangi
Copy link

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
Copy link
Author

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

@tjmonsi
Copy link

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
Copy link
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
Copy link

Also fails on 16278.rs3, npm works fine

@simonbuchan
Copy link

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
Copy link
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>

@AndyGauge
Copy link

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
Copy link
Author

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
Copy link

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

@CrshOverride
Copy link

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
Copy link

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

@khuongduybui
Copy link
Author

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

@wycats
Copy link

wycats commented Sep 19, 2017

I was able to reproduce this issue with strace on.

trace.zip

@SvenGroot
Copy link
Member

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

@khuongduybui
Copy link
Author

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
Copy link

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
Copy link

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
Copy link
Member

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

@jingsam
Copy link

jingsam commented Sep 30, 2017

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

@Verikon
Copy link

Verikon commented Sep 30, 2017

@jingsam agree, this one is particularly painful.

@codeart1st
Copy link

Works for me too, no issues anymore

@mindhaq
Copy link

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
Copy link

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
Copy link
Contributor

@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
Copy link

rhyek commented Dec 6, 2017

@bitcrazed Yes, everything is functional.

@bitcrazed
Copy link
Contributor

Great thanks.

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

@mindhaq
Copy link

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
Copy link
Contributor

Thanks for letting us know.

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

@shjyh
Copy link

shjyh commented Dec 11, 2017

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

@therealkenc
Copy link
Collaborator

newest insider preview(17025.10000)

this

@Nadav-Ruskin
Copy link

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
Copy link

muyu66 commented Jul 17, 2018

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

@mrmckeb
Copy link

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
Copy link

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
Copy link

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

@onomatopellan
Copy link

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

@tomitrescak
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests