WSL: `yarn install` fails inside /mnt with EINVAL for lstat during step 3
-
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.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 38
- Comments: 107 (21 by maintainers)
Commits related to this issue
- Work around WSL access(2) EINVAL bug See Microsoft/BashOnWindows#2522, Microsoft/BashOnWindows#2448 — committed to fish-shell/fish-shell by mqudsi 9 years ago
- Work around WSL access(2) EINVAL bug See Microsoft/BashOnWindows#2522, Microsoft/BashOnWindows#2448 (cherry picked from commit 56c041b88979bcdc3cf0f995f47bba9393cdfbb3) — committed to fish-shell/fish-shell by mqudsi 9 years ago
- Add workaround for Microsoft/WSL/issues/2448 — committed to Log1x/dotfiles by Log1x 9 years ago
@SvenGroot you are our savior, thank you! I’ve added the workaround to my
~/.bashrcand it seems to work:We appreciate the pain some of you are feeling because of this issue. Please believe me: we take this very seriously and have been working very hard to get the fix to you as soon as possible.
Update! This issue is now fixed in Insider build 17035. If you are a Windows Insider, please update to build 17035 or later and do not use the workaround!
Update 2! This issue is now fixed in the Fall Creator’s Update. Please install the latest update (your build number should be 16299.98 or later) and do not use the workaround!
In the mean time, the following workaround should get around this issue. When starting bash, run the following commands:
sudo umount /mnt/xsudo mount -t drvfs -o noatime,fallback=1 X: /mnt/xReplace /mnt/x and X: with the mount point and drive letter for any affected drives. If you’ve done this correctly, you can run
mountand you’ll see a line like this:C: on /mnt/c type drvfs (rw,noatime,fallback=1)If the fallback option is shown, it has been mounted correctly. We believe that doing this will allow you to use the drvfs mount without hitting this issue.
You’ll have to do this every time you start a new WSL instance (so every time you open bash after all bash windows were closed).
Note! Doing this will disable all the performance improvements we’ve implemented since RS1 (version 1607, the Anniversary Update). Don’t use this workaround unless you’re hitting this issue.
I’ll update once the fix is released, at which point I strongly recommend you stop using this workaround.
Good news, everyone!
The November 30th, 2017 Cumulative Update (KB4051963) for the Fall Creator’s Update contains the fix for this issue. Please install this update, and let us know if you encounter any further issues.
To verify if you have installed the update, your OS build number should be 16299.98 or later.
Unfortunately, Insider build 17025 does not appear to have the fix for this yet. However, it looks like it will be in the next Insider preview build. We’re still working on getting this serviced on the Fall Creator’s Update as well.
Hi all. I’ve been pinged several times over the last 48 hours for an update on the fix for this issue.
Know that we appreciate and understand the enthusiasm for the fix for this issue, but we do ask for your patience as the fix makes its way up through our build and test systems, on its way to the Insider rings.
As @SvenGroot stated above, the fix has been checked in but it didn’t make it up to the Insider release branch in time for 17025 which was released on 11/1. It’s v. likely it’ll arrive in the next Insider build.
Sven is also working to backport this fix to Fall Creators Update (FCU), but since this isn’t a fix for a major security exploit, it’ll make its way through our normal servicing channels, passing through numerous review and testing gates before it’s formally released in an up-coming servicing release.
Please note…
While Microsoft is much more agile today than ever before (we now essentially ship Windows every week) there are still processes that churn behind the scenes to ensure that we catch as many bugs as we can before they’re released, and that fixes are tested & released in an organized manner.
Only fixes for the most high-risk, high-impact issues bypass these standard processes, but these exceptional fixes are themselves placed under the most exacting scrutiny possible, requiring HUGE deployment of humanpower & tooling to quadruple-check that the fix is good before its released. We reserve these rapid fix deployments only for the most important fixes for the most critical of issues, and while annoying, this fix does not qualify as ‘exceptional’.
No software is ever perfect or bug free, and when you’re delivering software used by more than a billion people every day, one has to take whatever steps possible to ensure the best outcome for the largest audience. The last thing we’d want is to release a fix that doesn’t resolve the issue, and that may even make things worse.
So, please bear with us while we process this fix through our release processes.
Thanks.
Thanks for all the input. We’ve been able to determine the root cause of this issue and are working on a fix.
For some of us this issue is a massive showstopper and causing more than a little frustration. Don’t forget that it’s also a regression (at least from a user perspective), so I would expect it to be very high-priority. It has been about 3 weeks since the FCU landed and we haven’t gotten much more than a vague “we’re working on it”, which doesn’t exactly inspire a whole lot of confidence that this will be addressed in a timely manner. We would greatly appreciate a little more information/assurance about when/how the fix is going to land, so we can at least make a better decision on how to mitigate the productivity loss caused in the meantime. Any insight into the process, even if it’s just a hypothetical worst-case scenario, is better than having a question mark hanging over the whole thing (if the fix isn’t going to be speedy).
I don’t want to sound ungrateful or anything - I’m very appreciative of the work that has gone into WSL, and from what I understand things like update timing are mostly outside the WSL team’s control - but a little more transparency/communication would go a long way towards alleviating some of our concern.
Build 17017 does not have the fix for this issue yet. The fix has been checked in and is making its way through our system, and will hopefully be in an insider build sooner rather than later, but it’s difficult for me to say when that will happen. We’ll keep you informed.
This sort of thing paints Windows + WSL as an unreliable setup for modern Web development where Linux or MacOS seem more robust and streamlined. I understand Microsoft’s interest in making something like WSL, especially with new hardware offerings such as the Surface Book 2 competing directly with Macbook Pros. They want to target professional users who use their laptops as their main work tool, but there doesn’t seem to be enough focus going into making WSL attractive/trustworthy enough with issues such as this persisting almost 2.5 months after being reported.
How can I, as a professional, justify purchasing Microsoft products when I can’t trust them to properly support them in a timely manner?
Sorry for the rant. I really want my next laptop to be a Surface Book 2, but it is not looking very likely.
We are working to get this bug serviced in the Fall Creator’s Update as soon as possible. Unfortunately, the timing of that depends on a lot of things besides just me, so I can’t give you any dates. We’ll keep you posted.
We’re still working on the fix, so it’s not available yet. I’ll update this thread once the fix becomes available.
This bug should be fixed in Insider build 17035, which was just released. Please stop using the workaround posted above, and let us know if you still encounter any issues.
Users on the official Fall Creator’s Update (build 16299) should continue to use the workaround (or update to the latest Insider build, if possible).
The above couldn’t explain the situation any better. I had been tempted to write something similar but wasn’t sure I could contain my anger and frustration in the process.
The amount of time (AND MONEY) I’ve lost the last 3 weeks trying to work around this bug has made me incredibly bitter after spending hours writing guides, resources, tutorials, etc. talking up WSL.
I have the number one result on Google for a majority of the keywords revolving around setting up development with WSL and it makes me incredibly tempted to just edit my post and tell people to stay the hell away.
If Microsoft can’t take this seriously, I’m afraid I can’t take them seriously either.
Is it possible that fixes like that will be patched with normal windows updates?
The rants might seem harsh, but maybe to reiterate the impact of this issue:
Right now it is not possible to work on any nodejs, webpack, etc. project since both npm and yarn fail to install. The workaround is very painful and costs too much time because it needs to be done on each dependency change or adjustment.
I’m actually quite pessimistic, there were no WSL updates between Creator’s Update and Fall Creator’s Update for users of the stable Windows version as far as I can remember, therefore it is somewhat sad to have an absolutely broken WSL for node users, especially with the big fanfare of blog posts announcing that WSL would no longer be beta?
My current workaround is to create a node_modules directory outside /mnt, then
ln -sit into my directory inside /mnt.@Log1x As we’ve pointed out before, a fix for the Fall Creator’s Update will be coming soon. Please be patient, and continue to use the workaround I posted above in the mean time. I will update here once the fix has been released.
I must say, my Vim skills have greatly increased due to this issue exclusively.
Being this issue has arisen from Yarn , its probably safe to assume the people most pained from this issue are ReactJS developers (and some Angular). This issue has really empowered the “nay-windows sayers” in my workplace when they argue “you cannot develop javascript on windows, in the same way you cannot really develop .NET applications without windows”.
I’m a big advocate for win10 and personally feel the new direction and innovations from Microsoft should be both acknowledged and enjoyed because really, its just a great OS! WSL makes it fantastic.
Please take this issue as a strong use-case to improve the release methodology for WSL, I don’t want to go onto Linux or Mac because I can’t safely rely on it.
Keep up the good work otherwise!
No the original issue has absolutely NOT been resolved in latest insider (non skip-ahead) build.
The fix for the Fall Creator’s Update should be coming very soon. We can’t comment on the timeline, because the patch could be delayed for any number of reasons beyond our control. In the meantime, the workaround posted above should prevent any issues.
We appreciate your patience and understanding.
I was able to reproduce this issue with strace on.
trace.zip
@SvenGroot I installed the official release today and encountered this problem. I understand this will go out to insiders, but what about those of us not in the insider program - will this be available as an update through Windows Update or the Microsoft Store?
We rely on Yarn Workspaces - so this effectively stopped me from being able to work on our project, unless I roll back Windows 10 (which I might do tonight).
Edit: I found that cloning the repository to my home directory (in the Linux file system) enabled me to complete a
yarn installkeep working.If you, like I did, see that all files are now marked as modified in git, try this:
Adding @SvenGroot who is taking a look at this. Also, marking it as a bug.
The update requires a computer reboot, but afterwards it works for me.
Or you can download a Linux ISO while you’re at it. I know I did, and the console works significanlty faster, by the way. Still boot to Windows, but not at work. It’s a shame; I like Windows and miss it a lot.
Seriously folks, I don’t want to sound bitter, but people got other things to do than downloading ISOs or installing insider builds. I know they’re pretty stable, but still.
I know the WSL team probably has very little influence on the release cycle, but I think those who have should reconsider the criticality of the fix. You risk losing people, people.
@bitcrazed @SvenGroot Please, tell me, in what not insider build will this bug be fixed?
@bitcrazed @SvenGroot Thanks so much for your work on this. As developers, we can all appreciate how tricky these things can be to solve and the effort required to backport a fix.
Is there currently an ETA on this? And if not, an approximation - one week, a month?
Great, thanks for testing and sharing your results. We (i.e. @svengroot 😉) continue to backport the fix through our release machinery.
@simonbuchan
Working with 2 filesystems at the same time is already hacky enough to be working with two redundant binaries for each OS simultaneously as well. Which to use when and how? I would rather just have everything inside the Linux context and have it work 100%. That should be the goal.
I should note that for many npm workflows, including the majority of webpack setups, you can simply use Windows yarn or npm, and that it’s possible to alias them such that you don’t even need to change your workflow.
That said https://blogs.msdn.microsoft.com/commandline/2017/07/28/windows-subsystem-for-linux-out-of-beta/ is pretty ironic 😓
I’m having the same issue when trying to use
yarn. It is blocking my environment. I might need to change OSes or use docker just because of this 😒Will an update for this be possible to push to non-insider or are those of us not on insider effectively screwed this update?
😿 This bug makes me want to claw my eyes out.
I upgraded to 17017.1000 and no longer observe this issue. Can someone confirm a fix?
Great thanks.
Closing for now since we have a few confirmations that the issue appears to be resolved.
You can download an ISO
This issue has annoyed me for a month, expecting fix it in the next release.
I am using Windows version 1803, build 17134.112 and still encountering this bug (the general, parallel building bug).
I upgrade my OS to newest insider preview(17025.10000),still have this problem
after applying the update, the error is no more.
but - was this always so slow?
create-react-app testtakes over 62 seconds in bash compared to 16 seconds in cmd on a decent i7 4.2Ghz workstation.@TomasHubelbauer The reason we ask you to primarily get your distros from the store is that this allows distro vendors to patch and service their releases, ensuring that when you install a distro, you’re always installing the latest supported version. This requires that you sign-in with your MSA, so that we know to push updates to your machines when they’re published.
@hoichi The distros that you download and install manually are identical to the distros you install via the Store so there’ll be no perf differential between the two.
@Stanzilla Let’s just say that the Windows servicing release mechanism is complex, for good reasons 😉
After updating the issue seems to be fixed for me!
hello,
The last insider build fixed the issue on my machine. Below is my environment:
sneakily ran
npm installworks as expected however it just made the office internet choked up a little bit but all good.thanks for all your hard work!
Workaround bei @Melatonin64 works fine as well as the workaround by @khuongduybui (symlink outside /mnt). Quick bugfix would be appreciated though! Thanks for the support here @ wsl team!
Thanks for this fix. Just to confirm my understanding of when this fix is necessary (for usage with Yarn), it’s only necessary when performing certain functionality of Yarn? Like when creating and updating dependencies?
I’ve wrapped the above code within a prompt so that my WSL is not always crippled back to version 1607.
@SvenGroot I was just hit by this when upgrading to the RTM fall update. Can you confirm if there’s an ETA for the fix and if it will be possible to get it without going through the insiders builds? The issue is also reproducible with
npm installalthough it doesn’t fail as badlyThis is working for me now after updating to 17017.rs_prerelease.171010-1400 with
yarn 1.0.2.@khuongduybui I also upgraded to 17017.1000 and the issue is no longer observed. Thanks!
@jingsam agree, this one is particularly painful.
You made my (our) day! Keep up the good work.
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>It’s a WSL issue with the recent file system later changes