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

fs.stat or fs.lstat throws unknown error on some files (reparse point) #33024

Closed
karthiknadig opened this issue Apr 23, 2020 · 4 comments
Closed
Labels
confirmed-bug Issues with confirmed bugs. libuv Issues and PRs related to the libuv dependency or the uv binding. windows Issues and PRs related to the Windows platform.

Comments

@karthiknadig
Copy link

  • Version: v12.16.2
  • Platform: 64 bit Microsoft Windows 10 [Version 10.0.18362.778]
  • Subsystem: fs

What steps will reproduce the bug?

  1. Check if %USERPROFILE%\AppData\Local\Microsoft\WindowsApps exists.
  2. Install https://www.microsoft.com/en-us/p/python-38/9mssztt1n39l
  3. Call fs.statSync("c:\\Users\\kanadig\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe")

How often does it reproduce? Is there a required condition?

This repros 100%, make sure you are calling it on the files under %USERPROFILE%\AppData\Local\Microsoft\WindowsApps\ with 0 size.

What is the expected behavior?

Should not throw exception.

What do you see instead?

> fs.statSync("c:\\Users\\bpasero\\AppData\\Local\\Microsoft\\WindowsApps\\GameBarElevatedFT_Alias.exe")                 
Thrown:                                                                                                                  
{ Error: UNKNOWN: unknown error, stat 'c:\Users\bpasero\AppData\Local\Microsoft\WindowsApps\GameBarElevatedFT_Alias.exe' 
    at Object.statSync (fs.js:855:3)                                                                                     
  errno: -4094,                                                                                                          
  syscall: 'stat',                                                                                                       
  code: 'UNKNOWN',                                                                                                       
  path:                                                                                                                  
   'c:\\Users\\bpasero\\AppData\\Local\\Microsoft\\WindowsApps\\GameBarElevatedFT_Alias.exe' }                           
> fs.lstatSync("c:\\Users\\bpasero\\AppData\\Local\\Microsoft\\WindowsApps\\GameBarElevatedFT_Alias.exe")                
Thrown:                                                                                                                  
{ Error: UNKNOWN: unknown error, lstat 'c:\Users\bpasero\AppData\Local\Microsoft\WindowsApps\GameBarElevatedFT_Alias.exe'
    at Object.lstatSync (fs.js:845:3)                                                                                    
  errno: -4094,                                                                                                          
  syscall: 'lstat',                                                                                                      
  code: 'UNKNOWN',                                                                                                       
  path:                                                                                                                  
   'c:\\Users\\bpasero\\AppData\\Local\\Microsoft\\WindowsApps\\GameBarElevatedFT_Alias.exe' }                           
>     

Additional information

See microsoft/vscode#95828

@bzoz
Copy link
Contributor

bzoz commented Apr 23, 2020

Those are IO_REPARSE_TAG_APPEXECLINK reparse points and currently, libuv does not support those. Nothing we cannot fix 😉

@bzoz bzoz added libuv Issues and PRs related to the libuv dependency or the uv binding. windows Issues and PRs related to the Windows platform. confirmed-bug Issues with confirmed bugs. labels Apr 23, 2020
bzoz added a commit to JaneaSystems/libuv that referenced this issue Apr 24, 2020
Adds support for IO_REPARSE_TAG_APPEXECLINK reparse points, used by
Windows Store.

Ref: nodejs/node#33024
bzoz added a commit to JaneaSystems/libuv that referenced this issue Apr 28, 2020
Adds support for IO_REPARSE_TAG_APPEXECLINK reparse points, used by
Windows Store.

Ref: nodejs/node#33024
bzoz added a commit to JaneaSystems/libuv that referenced this issue Apr 29, 2020
Adds support for IO_REPARSE_TAG_APPEXECLINK reparse points, used by
Windows Store.

Ref: nodejs/node#33024
bzoz added a commit to libuv/libuv that referenced this issue Apr 29, 2020
Adds support for IO_REPARSE_TAG_APPEXECLINK reparse points, used by
Windows Store.

Ref: nodejs/node#33024

PR-URL: #2812
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@bzoz
Copy link
Contributor

bzoz commented Apr 29, 2020

A fix for this landed in libuv, it should make it way to Node rather soon.

The stat calls will probably still not work though. Those links usualy point to the C:\Program Files\WindowsApps folder that is not normally accessible, even after elevating. lstat should be fine, the added libuv test lstats the%LOCALAPPDATA%\Microsoft\WindowsApps folder.

@bzoz
Copy link
Contributor

bzoz commented May 22, 2020

Fixed by #33446

@karthiknadig
Copy link
Author

This is not fixed. I can repro it with the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. libuv Issues and PRs related to the libuv dependency or the uv binding. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

2 participants