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

Error: UNKNOWN: unknown error, lstat on WSL symbolic links #161

Closed
bmewburn opened this issue Apr 1, 2019 · 6 comments
Closed

Error: UNKNOWN: unknown error, lstat on WSL symbolic links #161

bmewburn opened this issue Apr 1, 2019 · 6 comments
Assignees
Milestone

Comments

@bmewburn
Copy link

bmewburn commented Apr 1, 2019

Thanks for your effort on this project. I'm using fast-glob in a PHP language server and am getting reports from users about lstat errors. Most of these users are on Windows and are using WSL, though a minority appear not to be using WSL.

This is the issue containing most of the information:
bmewburn/vscode-intelephense#260

This may also be useful:
microsoft/WSL#1524

I'm not a Windows user myself but will try and add some further info later.

Environment

Windows

Actual behavior

Error: UNKNOWN: unknown error, lstat 'e:\firma\fbpopular\public\storage'

Expected behavior

No error.

Steps to reproduce

  1. Try and find files in a dir structure that contains symbolic links on windows WSL
@mrmlnc mrmlnc self-assigned this Apr 1, 2019
@mrmlnc
Copy link
Owner

mrmlnc commented Apr 1, 2019

Hello, @bmewburn,

Thanks for issue. I correctly understand that asymbolic link was created under WSL and trying to use it under Windows?

Also a few leading questions:

  1. How you create symbolic link under WSL? ln -s SOURCE TARGET?
  2. You can call fs.lstatSync under WSL in the Node.js REPL? Also under Windows (file output, please)?
  3. You can call (Get-Item PATH_TO_SYMBOLIC_LINK_IN_WSL_DIRECTORY).Target in the PowerShell?
  4. WSL is Ubuntu from lstat error when reading laravel project bmewburn/vscode-intelephense#260?

We need diagnostics from the user who has problems. Unfortunately, without lstat this package won't work.

@bmewburn
Copy link
Author

bmewburn commented May 1, 2019

Thanks @mrmlnc . Will try to find time to debug further. I dont think it's just WSL, this user is reporting that it's NTFS junction points bmewburn/vscode-intelephense#461 .

I guess this is more an issue with https://github.com/JS-DevTools/readdir-enhanced ? I dont see any lstat calls in this repo. Leaving the error aside, my main issue is that the file finding stops if an error is encountered. It would be nice if it continued. Looks like there's an issue for that here ? JS-DevTools/readdir-enhanced#20

@mrmlnc
Copy link
Owner

mrmlnc commented May 13, 2019

I think this behavior is not relevant to the readdir-enhanced package. You can provide any reproduce steps? Maybe git repository or just steps? :)

@mrmlnc
Copy link
Owner

mrmlnc commented May 17, 2019

Reproduce steps:

wsl
touch a.txt
ln -s a.txt b.txt
exit
node
require('../fast-glob').sync('*')

@mrmlnc
Copy link
Owner

mrmlnc commented May 17, 2019

So, after research: the node-glob package just ignore error from lstat call.

This is will be work correctly after #163, but only with Node.js 10.10+. I'll think about how to handle situation on Node.js below 10.10.

@mrmlnc
Copy link
Owner

mrmlnc commented May 29, 2019

Unfortunately, the correct behavior is only guaranteed for Node.js 10.10+. For the correct operation of the package requires information about what the file in front of us: symbolic link, file or something else. We cannot ignore the lstat error, otherwise, there will be inconsistency between modes: string, dirent and stat.

So, right now VS Code build with Node.js 10.2.0. The next update was delayed (microsoft/vscode#61787).

I will describe this behavior in the documentation.

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

No branches or pull requests

2 participants