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] ENOENT: no such file or directory, lstat 'C:\d' #10281

Closed
netjune opened this issue Aug 8, 2016 · 68 comments
Closed

[Error] ENOENT: no such file or directory, lstat 'C:\d' #10281

netjune opened this issue Aug 8, 2016 · 68 comments
Assignees
Milestone

Comments

@netjune
Copy link

netjune commented Aug 8, 2016

  • VSCode Version: Code 1.4.0 (6276dcb, 2016-08-04T16:45:31.680Z)
  • OS Version: Windows_NT ia32 6.1.7601

Steps to Reproduce:

  1. Yestoday I add a directory and use the git in vscode. Everything was OK.
  2. Today vscode reports this error after it is launched everytime.
@netjune
Copy link
Author

netjune commented Aug 8, 2016

And the git panel just shows a progress bar looping forever.

@joaomoreno
Copy link
Member

Which folder do you have open in VS Code?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Aug 8, 2016
@netjune
Copy link
Author

netjune commented Aug 9, 2016

The only folder opened in VS Code was D:\stm8\iar1 with about 10 files in it.

git commands is in c:\msys64\usr\bin.

@netjune
Copy link
Author

netjune commented Aug 9, 2016

I added c:\msys64\usr\bin to system PATH.

@joaomoreno
Copy link
Member

Can you show me a screenshot of the error?

@netjune
Copy link
Author

netjune commented Aug 10, 2016

vscode_error2

vscode_error

@netjune
Copy link
Author

netjune commented Aug 10, 2016

No git process in task manager then.

@joaomoreno
Copy link
Member

Do you have any extensions installed?

@netjune
Copy link
Author

netjune commented Aug 10, 2016

I have only installed the following two extensions:
(1) c/c++ (0.8.1)
(2) Toggle Header/Source (0.1.2)

@joaomoreno
Copy link
Member

And do you get the same error when running code --disable-extensions?

@netjune
Copy link
Author

netjune commented Aug 11, 2016

Yes. The same error even after I uninstall the two extensions.

@joaomoreno joaomoreno assigned joaomoreno and bpasero and unassigned joaomoreno Aug 11, 2016
@joaomoreno
Copy link
Member

@bpasero There seems to be some confusion in which the user's workspace (D:\stm8\iar1) seems to be parsed in some way to make FS calls into C:\d... any idea?

@bpasero
Copy link
Member

bpasero commented Aug 11, 2016

@netjune would you be able to run vs code out of its sources so that we can do some instrumentation in the places where we call lstat?

@joaomoreno I do not understand where we call lstat in the renderer that could produce such a message, a quick search I could not find such.

@bpasero bpasero added this to the Backlog milestone Aug 11, 2016
@joaomoreno
Copy link
Member

Yes that beats me too. But errors from the ext host and shared proc both get propagated back, so it could come from anywhere.

@bpasero
Copy link
Member

bpasero commented Aug 11, 2016

@netjune can you also open the developer console (from help menu) to see if something gets logged?

@netjune
Copy link
Author

netjune commented Aug 13, 2016

@netjune would you be able to run vs code out of its sources so that we can do some instrumentation in the places where we call lstat?
I don't have enough time to try this now.

@netjune can you also open the developer console (from help menu) to see if something gets logged?
vscode_error3

@bpasero
Copy link
Member

bpasero commented Aug 13, 2016

@joaomoreno funky, looks like gitApp.js???

@joaomoreno
Copy link
Member

@netjune What git version do you have installed?

@netjune
Copy link
Author

netjune commented Aug 16, 2016

git version: 2.8.2

@joaomoreno
Copy link
Member

Can you try opening another folder? Maybe one inside C:? Do you get the same error?

@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Aug 17, 2016
@netjune
Copy link
Author

netjune commented Aug 22, 2016

Can you try opening another folder? Maybe one inside C:? Do you get the same error?

ENOENT: no such file or directory, lstat 'C:\c'

@joaomoreno
Copy link
Member

Which folder did you try to open?

@netjune
Copy link
Author

netjune commented Aug 22, 2016

C:\ti\0730

@joaomoreno
Copy link
Member

@tapir Can you try with the official git instead of msys, which we don't support?

@tapir
Copy link

tapir commented Sep 29, 2016

@joaomoreno I'll do you one better.

I've tried with the official git.exe by appointing the git.path to C:\\Program Files\\Git\\bin\\git.exe and it worked. Then I copied the mingw git.exe over to C:\\Program Files\\Git\\bin\\git.exe, restarted VSCode and it still worked!

So the problem is somehow with the path itself. Not the exe. For some reason it just doesn't like C:\\msys64\\usr\\bin\\git.exe

@joaomoreno
Copy link
Member

Might be much more than that since git uses many other tools that live in that path.

Closing as we don't support msys git.

@tapir
Copy link

tapir commented Sep 29, 2016

I don't know what you mean. This is a VScode bug. Not MSYS2.
What if I were to install official Git in C:\msys64 ? Because that's what I just did and it doesn't work.

I also copied mingw git.exe to any other path and again it worked. So it's not the git it self. It only happens when it's in msys64. And if some other thing in that path make it not work that's VSCode's bug because VSCode should only use git.exe and nothing else.

@tapir
Copy link

tapir commented Sep 29, 2016

Also please stop with "we don't support msys git" thing. MSYS2 is the major player when it comes to C/C++ in Windows after Visual Studio. Not supporting it is not a great idea.

@joaomoreno joaomoreno reopened this Sep 29, 2016
@joaomoreno
Copy link
Member

Reopening due to:

What if I were to install official Git in C:\msys64 ? Because that's what I just did and it doesn't work.

I will install it in that path to confirm this.

We don't support msys git. But you are free to contribute a PR which makes it work.

@joaomoreno joaomoreno added this to the October 2016 milestone Sep 29, 2016
@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Sep 29, 2016
@tapir
Copy link

tapir commented Sep 29, 2016

If there is anything to support I will make a PR. But I really don't understand what you mean by that? How do you think both executables behave differently? To my understanding they work exactly the same way.

Also why should VSCode care about where the exe comes from?
It all seems pretty straight-forward to me. We have a "git.exe". Regardless of where it comes from if it works on terminal, it should work with VSCode.

@joaomoreno
Copy link
Member

joaomoreno commented Sep 29, 2016

I could not reproduce:

image

So it obviously doesn't have to do with where the exe comes from.

It is my understanding that they work the same way too. But clearly they don't. So someone needs to look into it. Since I don't even estimate 0.01% of our users using this version of git, I don't think it is wise to dedicate my time for it. So I suggest, if you feel passionate enough, to attempt to submit a PR.

Let's track that here: #13037

@ramya-rao-a ramya-rao-a removed the bug Issue identified by VS Code Team member as probable bug label Sep 29, 2016
@ItachiSan
Copy link

ItachiSan commented Nov 9, 2016

I have also this bug, but the git binary is the one bundled inside MSYS2.
It would be nice to use the MSYS2/MINGW64 Git executable instead of installing another MSYS2 instance.

@pthalacker
Copy link

I just opened Code and am experiencing exactly the same problem.

@at15
Copy link

at15 commented Nov 25, 2016

if you just don't want see the annoying warning and don't need the to use git inside vscode, just disable it.

// Place your settings in this file to overwrite the default settings
{
    "git.enabled": false
}

Also change git.path may also help, but I never find the git integration very useful (just personal taste) so I didn't give it a try.

And VSCode does not have any problem with both the old (msysgit) and new git for windows, which is a fork of msys2, and that's why they can't reproduce it. When you use the original msys2 and install git with pacman, VSCode will have trouble with git.

And if you just want to use git on windows, stick with git for windows, it has more friendly default settings and works well with most editor and IDEs, while for the raw msys2, sometimes you mess up with PATH and other environment variables.

@cjun714
Copy link

cjun714 commented Dec 23, 2016

I think vscode(or its dependant lib) has issue on handling code path, when using git from msys2 or cygwin.
For example:

  1. When project path is Z:\proj, and
  2. git.exe in D:\tool\msys64\bin,
    vscode will apear error of "ENOENT: no such file or directory, lstat 'D:\z'"

mklink /j "D:\z" z: can resolve this, and then any other projects in z:\ or sub directory in z:\ like z:\projects\proj1 will also benefit.

But if project path is in other partition, like E:\porj, issue will apear again:"ENOENT: no such file or directory, lstat 'D:\e'"
mklink /j "D:\e" e: can resolve this.

Hope it can be fixed soon, why:

  1. It has been reported again and again by msys2 and cygwin users.
  2. Lots of them use Sublime/Emacs based on msys and cygwin to create cross platform web/c++/go/rust projects, they use package manager like pacman in msys2 to install(or update) mingw+clang+gdb+lldb+git+make, which support VCS greatly if they can keep consistent.
  3. Git for window includes another mingw, also is not inclueded in msys/cygwin toolchain or shell PATH.
  4. Sublime/Eclipse and its git plugins work well on both msys git or window git, it's not a Git issue, its an editor issue.

@jamesqo
Copy link
Contributor

jamesqo commented Dec 25, 2016

I was also experiencing this issue! lstat C:\home: No such file or directory would constantly pop up in the top of the editor window, and would reappear whenever I closed it. (I, as well, use Git for Windows/msysgit from the command line.) I ended up following @at15's advice and disabled git within vscode.

@joaomoreno
Copy link
Member

Does this help anyone? #4651

@netjune
Copy link
Author

netjune commented Jan 4, 2017

I didn't use windows too much, and even more rarely now . So I can't feedback. Waiting for others.

PS: I don't like the file path style of windows. It will be good if windows support path like: /c/some_dir/some_file.txt

@rdcoe
Copy link

rdcoe commented Jan 10, 2017

Have the same bug and I don't use msysgit, I use cygwin64. If I have open in vscode my c:\cygwin64\home...\git folder and then restart vscode, I will, after several seconds of waiting, see the ENOENT: no such file or directory, lstat 'C:\home' error.

If I click on the "collapse" icon for the folder, I will see the same error message.
If I click on the Git icon on the left of vscode, I get the same error.

@joaomoreno
Copy link
Member

Cygwin is not yet supported #7998

@malluri19
Copy link

Make sure that the .json file doesnt have a path to an invalid directory under files:

I had path pointing to
"path": "scripts", "addressable": true
"path": "sdk/scripts", "addressable": true

which I copy/pasted from a tutoria.
In fact I do not have Scripts folder under Home. Removing it packaged the project without errors.

It took some time to figure out, but the error description states what is missing. Please read it clearly and you can resolve on your own.

@masaeedu
Copy link

@joaomoreno #4651 solves it for me, might want to stick it somewhere in the official docs where crawlers will find it.

@bviktor
Copy link

bviktor commented Apr 20, 2017

I'd like to add a few points.

  1. I'm pretty sure that "I don't know, therefore msysgit" is not the proper approach to this issue.

  2. This error is reproducible with zero Git involved. To me it occurs with go build.

Steps to reproduce:

  1. Get a VM image for win10 15.15063 from modern.ie

  2. start it up, install updates, restart

  3. install vs code with defaults

  4. install go runtime with defaults

  5. start vs code

  6. install go extension, restart vs code

  7. create a new .go file:

package main
import "fmt"
func main() {
	fmt.Println("foobar")
}
  1. ctrl+f5

Expected output: foobar printed

Actual output:

The program "${file}" does not exist: Error: ENOENT: no such file or directory, lstat 'C:\Program Files (x86)\Microsoft VS Code\${file}'

On the top the following appears:

Error: Failed to continue: "The program attribute must point to valid directory, .go file or executable."

Which you can either "close" or "open launch.json" but if you try the latter, nothing happens at all.

@joaomoreno
Copy link
Member

@bviktor This user's issue was indeed related to git. You have another issue, so can you please open a new issue? Ping me in it please.

@bviktor
Copy link

bviktor commented Apr 21, 2017

Alright, #25138 opened.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests