microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.95k stars 29.53k forks source link

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

Closed netjune closed 8 years ago

netjune commented 8 years ago

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 commented 8 years ago

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

joaomoreno commented 8 years ago

Which folder do you have open in VS Code?

netjune commented 8 years ago

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 commented 8 years ago

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

joaomoreno commented 8 years ago

Can you show me a screenshot of the error?

netjune commented 8 years ago

vscode_error2

vscode_error

netjune commented 8 years ago

No git process in task manager then.

joaomoreno commented 8 years ago

Do you have any extensions installed?

netjune commented 8 years ago

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

joaomoreno commented 8 years ago

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

netjune commented 8 years ago

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

joaomoreno commented 8 years ago

@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 commented 8 years ago

@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.

joaomoreno commented 8 years ago

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 commented 8 years ago

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

netjune commented 8 years ago

@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 commented 8 years ago

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

joaomoreno commented 8 years ago

@netjune What git version do you have installed?

netjune commented 8 years ago

git version: 2.8.2

joaomoreno commented 8 years ago

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

netjune commented 8 years ago

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 commented 8 years ago

Which folder did you try to open?

netjune commented 8 years ago

C:\ti\0730

joaomoreno commented 8 years ago

Can you open some folder in your User home? For example C:\Users\joao\Desktop?

netjune commented 8 years ago

Can you open some folder in your User home? For example C:\Users\joao\Desktop?

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

joaomoreno commented 8 years ago

Does it reproduce with the latest Insiders release?

netjune commented 8 years ago

Does it reproduce with the latest Insiders release?

No. Same error as 1.4.0.

joaomoreno commented 8 years ago

Do you have another machine you can try VS Code on?

Also, if you go to the command line and run git status from your folder, does it work?

I have a feeling your machine has a very strange setup somehow.

netjune commented 8 years ago

Yes, I use git in command line everyday. And git works well in visual studio 2015. Both on the same computer.

Maybe it is because I installed vscode of a new version upon a very old version. But I have removed and reinstalled it then, and it didn't help.

How to remove vscode cleanly?

joaomoreno commented 8 years ago

Run the uninstaller, then also check for Visual Studio Code folders in %APPDATA%. And in your home directory, check for .vscode-* folders.

joaomoreno commented 8 years ago

Also are you willing to do a live screen sharing chat where we can debug this together?

netjune commented 8 years ago

Run the uninstaller, then also check for Visual Studio Code folders in %APPDATA%. And in your home directory, check for .vscode-* folders.

I just found "Code - Insiders" in %APPDATA% and delete it. No .vscode-* in my home directory. Then I reinstalled vscode and the error is the same.

netjune commented 8 years ago

Also are you willing to do a live screen sharing chat where we can debug this together?

Yes. Then what should I do?

joaomoreno commented 8 years ago

Let me know your availability and I'll see when I can fit. We'll set up a time and I'll send you a conference call link.

netjune commented 8 years ago

Too busy the last saveral days. Sorry for the delayed reply. I am available the the next 1~2 hours today. What about you?

joaomoreno commented 8 years ago

Me too: https://hangouts.google.com/hangouts/_/joaomoreno.com/vscode10281

joaomoreno commented 8 years ago

I saw you joined but left right after.

netjune commented 8 years ago

Network problem. Google is hardly accessed in China.

netjune commented 8 years ago

Maybe I can make a screencast, and upload it to some place like www.youku.com. Is it usefull?

joaomoreno commented 8 years ago

Please, yes.

netjune commented 8 years ago

Finally upload the screencast here: https://drive.google.com/file/d/0B3c99U0nm3QXUjJJaEU4TkJLbWM/view?usp=sharing

A picture of gif format.

netjune commented 8 years ago

I can create a git repo and use git function for the first time in vscode. After reopenning the git repo folder, git function is not usable in vscode.

screencast: https://drive.google.com/file/d/0B3c99U0nm3QXcUtXUmZzWlV2Qjg/view?usp=sharing

Maybe vscode lost something of the project(folder) between saving and loading it?

joaomoreno commented 8 years ago

Can you search your whole machine for all git.exe files? Maybe you have more than one git installed. What are the ones you find?

netjune commented 8 years ago

I searched my whole machine and found 2. C:\msys64\usr\bin\git.exe C:\msys64\usr\lib\git-core\git.exe

I compared the two files. They have the same content.

netjune commented 8 years ago

In the vscode, a new git repo can always be created, and all git functions work well just BEFORE reopenning the same git repo folder.

When git function is not usable, I can close the current folder and create another git repo in the same vscode instance.

So git.exe can be found and properly used by vscode.

joaomoreno commented 8 years ago

Hm... Can you try using the official git release and see whether it reproduces there? We don't support msys git.

joaomoreno commented 8 years ago

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

tapir commented 8 years ago

@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 commented 8 years ago

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 commented 8 years ago

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.