-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
fs.lstatSync doesn't handle specific Windows REPARSE POINTS #12737
Comments
@nodejs/platform-windows @nodejs/fs |
So windows likes to create these "Broken" junctions all over the place that have the equivalent of C:\> junction -nobanner "C:/Users/pabouwer/OneDrive"
C:\Users\pabouwer\OneDrive: UNKNOWN MICROSOFT REPARSE POINT Does anyone think we should handle them in a special manner? P.S. Just the first answer I found in Google https://goo.gl/Daj2vu (the jist: don't mess with them) P.P.S Every user home has these and none of them work. <JUNCTION> Application Data [C:\Users\refael\AppData\Roaming]
<JUNCTION> Cookies [C:\Users\refael\AppData\Roaming\Microsoft\Windows\Cookies]
<JUNCTION> Local Settings [C:\Users\refael\AppData\Local]
<JUNCTION> My Documents [C:\Users\refael\Documents]
<JUNCTION> NetHood [C:\Users\refael\AppData\Roaming\Microsoft\Windows\Network Shortcuts]
<JUNCTION> PrintHood [C:\Users\refael\AppData\Roaming\Microsoft\Windows\Printer Shortcuts]
<JUNCTION> Recent [C:\Users\refael\AppData\Roaming\Microsoft\Windows\Recent]
<JUNCTION> SendTo [C:\Users\refael\AppData\Roaming\Microsoft\Windows\SendTo]
<JUNCTION> Start Menu [C:\Users\refael\AppData\Roaming\Microsoft\Windows\Start Menu]
<JUNCTION> Templates [C:\Users\refael\AppData\Roaming\Microsoft\Windows\Templates] |
Sorry, I can't reproduce this. I've tried different machines, a fresh Win10 install, with OneDrive uninstalled, etc. Each time |
Someone is behaving better either the OS or |
@paulbouwer can you provide some more info about your setup? |
I was reading today about "OneDrive Files On-Demand", maybe that is the case, I'll try repro. |
@UsmanMohammad thank you for the info. |
@bzoz - I have this issue on Windows 10 that is pre the OneDrive Files On-Demand feature. I'll check what other additional info I can find. |
@paulbouwer Unfortunately, there're quite a lot of Windows features build on reparse points and have been since W2K, any of which can cause this error - mounting a volume on a folder, remote storage, distributed file system, junction points/symbolic links (which I believe lstat understands as equivalent to Unix-style symlinks, or at least it doesn't fail on them), single-instance storage, and that's not even counting the non-Microsoft stuff. Any of those other than junction points, I believe, will produce the same lstat()/lstatSync() error. (Edited for thinko.) |
Allow for running uv_fs_stat and uv_fs_lstat on all reparse points Ref: nodejs/node#12737
I've opened a PR to fix this in libuv: libuv/libuv#1419 |
Allow for running uv_fs_stat and uv_fs_lstat on all reparse points Ref: nodejs/node#12737
Allow for running uv_fs_stat and uv_fs_lstat on all reparse points Ref: nodejs/node#12737 PR-URL: #1419 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
So... uhhh... this is awkward. 4 months later and I still can't use OneDrive. :( |
The fix was added to libuv 1.14.0. A PR for updating libuv in Node.js is already open: #14866 |
Also for context, this is a pre-release feature (OneDrive Files On-Demand). If all goes smoothly @bzoz's fix will be in |
It's not only affecting the on demand feature but it has become a problem for the whole OneDrive as of couple of last Win Insider builds. One of my PCs I have not been using on-demand on became affected recently and giving me a hard time working. So I'm glad to see this finally come to an end. |
I somehow missed this issue and fix last week, so I independently developed and submitted a new PR to libuv - libuv/libuv#1522. Compared to e5024c5, my PR solves this issue and other issues, so it may still be worth integrating. The issue with the accepted change is that by preventing |
Fixes: nodejs#12737 Fixes: nodejs#13581 Fixes: nodejs#15117 PR-URL: nodejs#14866 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Referenced issues:
Issue
While tracking down an issue affecting hyper, it lead me to the use by gaze of
fs.lstatSync
.It seems that on Windows, there is something different about the reparse point on OneDrive local sync folders, that results in a
EINVAL
error fromfs.lstatSync
. Thefs.lstatSync
correctly handles other junctions, folders and files inHOME
with no error.Error example - OneDrive
Working example - My Documents
The text was updated successfully, but these errors were encountered: