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

Bug: Git: ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory #32097

Closed
welljsjs opened this issue Aug 7, 2017 · 22 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Milestone

Comments

@welljsjs
Copy link

welljsjs commented Aug 7, 2017

  • VSCode Version: 1.14.2 (latest version)
  • OS Version: Mac OS Sierra (latest version)

Steps to Reproduce:

  1. Open up VSCode on OS X (Mac, ...)
  2. Configure a remote with password authentication (via terminal, f.ex. your own server with password ssh authentication)
  3. Click on "synchronize" button in VSCode in the lower left corner
  4. You will get an error message saying "Error: Git: ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory".
  5. There only exists a directory named X11, but not X11R6 on OS X Sierra, so you would have to change the path, unfortunately this is not possible within the settings
  6. Nobody is able to upload files (push) to any password-protected server now (if he's using an OS X device)

Updating brew, installing the ssh-akspass package and starting the service didn't help.

The problem / bug seems to be only on OS X devices, haven't seen any reports about Windows so far.

Reproduces without extensions: Yes

@vscodebot vscodebot bot added the git GIT issues label Aug 7, 2017
@rcliftonharvey
Copy link

rcliftonharvey commented Aug 8, 2017

Experiencing the same issue.
I have a git repository hosted on my own server runnig Debian v8.9 and git v2.13.2 on it.
I can access the repository with SourceTree without any issues, SSH-ing to server works, I have id_rsa.pub installed on the server, etc.

macOS Sierra 10.12.4 and VSCode Insiders installed yesterday.

screen shot 2017-08-08 at 02 39 52

@welljsjs welljsjs changed the title Git: ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory Bug: Git: ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory Aug 8, 2017
@joaomoreno joaomoreno added the bug Issue identified by VS Code Team member as probable bug label Aug 8, 2017
@joaomoreno joaomoreno added this to the Backlog milestone Aug 8, 2017
@christopherball
Copy link

I too can confirm this bug. Hosting my own internal git server on a Raspberry PI, which is configured to require a password on push. See this exact same error running OSX El Capitan and the latest version of VS Code, attempting to push from within the app.

@mandymozart
Copy link

Same error here trying to push from mac OS X 10.12.5 Sierra

Works via command line

@shunia
Copy link

shunia commented Aug 11, 2017

Same issue, after updating to mac OSX Sierra.

@shunia
Copy link

shunia commented Aug 11, 2017

Reinstall vscode fixed this.

@shunia
Copy link

shunia commented Aug 11, 2017

In my case, it's caused by updating of mac OS, makes git lose passphrase of my ssh key. After ssh-add ~/.ssh/id_rsa, and REINSTALL vscode, this problem is fixed.

@welljsjs
Copy link
Author

@shunia Thank you, though I don't think this can be the final solution, because it would mean that you would have to reinstall VSCode for every new ssh key. In my view, that's not acceptable. VSCode etc. should fix this.

@brianyoungblood
Copy link

In my case, I just downloaded and installed vscode and tried to use git pull from the vscode ui. I got the error Git: ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory. The fix was to follow @shunia comment and run ssh-add ~/.ssh/id_rsa and then restart vscode. All is well now.

@rcliftonharvey
Copy link

rcliftonharvey commented Aug 11, 2017

Wow, yes, this indeed seems to work. Which is pretty weird, because I set up everything beforehand to communicate between my computers and my server server through SSH via Terminal and also SourceTree, and that all worked a treat, no weird errors in SourceTree's "console" output.
Only VSCode has/had this issue here, but @shunia 's suggestion fixed this for me also, so thank you. 👍

@flipphillips
Copy link

flipphillips commented Aug 13, 2017

Same issue here w/ High Sierra. @shunia solution did not work in this case. Note that this is for a project with a new key added to gitlab. I've not logged this machine into gitlab before. Also, by default, macOS doesn't have ssh-askpass as part of its arsenal, so I'm guessing that this is 'left over' from some git/*nix logic in the vscode git packages?

Indeed, if I manually clone via terminal,

photon:GitHub> git clone git@gitlab.com:sleepyhead/sleepyhead-code.git
Cloning into 'sleepyhead-code'...
The authenticity of host 'gitlab.com (52.167.219.168)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitlab.com,52.167.219.168' (ECDSA) to the list of known hosts.

now, everything works.

So it seems that the authenticity check raises an exception to the git handler in VSCode and, in response, it tries to spawn an "Is this OK?" check that doesn't exist on macOS.

@shunia
Copy link

shunia commented Aug 14, 2017

@flipphillips I do think this is a bug or something goes wrong inside vscode, you pointed this out.
Hope vscode guys check this out quickly and fix it asap.

@stargriv
Copy link

I've used command below to fix it:

$ brew tap theseal/ssh-askpass
$ brew install ssh-askpass
$ sudo ln -s /usr/local/bin/ssh-askpass /usr/X11R6/bin/ssh-askpass

Hope it will be helpful workaround.

@welljsjs
Copy link
Author

@stargriv Do you use the latest Mac OS Sierra? I thought that there wouldn't exist such a folder named "X11R6". It should be renamed to "X11", I think (at least on my Mac that's the case).
Creating a directory named "X11R6" also didn't work for me; not even with sudo rights.

@peterlai-roboops
Copy link

yup, can't create that folder. Is there a way to specifiy a folder to look for ssh-askpass

@stargriv
Copy link

stargriv commented Aug 18, 2017

@welljsjs Yes, I'm using the Sierra too and I have /usr/X11R6, which points to /opt/X11.
I believe that /usr/X11R6 and /opt/X11 was created by XQuartz package, which I already had before.
Another solution which works for me is to manually add ssh keys with $ ssh-add command.

@welljsjs
Copy link
Author

welljsjs commented Aug 18, 2017

@stargriv Hmm, I just installed the latest XQuartz version and see - there now is a directory named "X11R6", but still no ssh-askpass although I installed it via homebrew.
I also found sth here:
https://support.apple.com/en-us/HT201341

Seems to work now - still not very as the user shouldn't have to do something like that.

@stargriv
Copy link

@welljsjs Did you linked ssh-askpass with: $ sudo ln -s /usr/local/bin/ssh-askpass /usr/X11R6/bin/ssh-askpass after XQaurtz installation?

@welljsjs
Copy link
Author

My steps that worked for me:

  1. Download xQuartz latest version : https://www.xquartz.org
  2. update and upgrade home-brew via 'brew update && brew upgrade'
  3. link: $ sudo ln -s /usr/local/bin/ssh-askpass /usr/X11R6/bin/ssh-askpass as @stargriv described above :-)
  4. Start VSCode, should work now
  5. You still have to type in your password every time when you connect to the server; if you don't want that, create a ssh-key file.

@peterlai-roboops
Copy link

I think the issue that we can't seem to create the X11R6 folder, even with root, so we can't create the symlink in the folder.

@welljsjs
Copy link
Author

welljsjs commented Aug 18, 2017

@tiny-cababge That's partly correct; see my comment above; the X11R6 folder definitely is created when you install the latest version of XQuartz. Then you're also able to create the symbolic link.

@stargriv
Copy link

Another addition for those who are using ssh keys:
To avoid recurring password prompt asking your private key's password you can create .ssh/config in your home directory and add lines below:

Host *
	UseKeychain yes
	AddKeysToAgent yes

More information regarding Sierra and ssh agent here

@joaomoreno
Copy link
Member

To keep the number of issues in our inbox on a manageable level, we're closing issues that have been on the backlog for a long time but haven't gained traction: We look at the number of votes the issue has received and the number of duplicates issues filed.

It appears this issue already has a lot of workarounds, so let's rely on those!

Thanks for your understanding. Happy coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Projects
None yet
Development

No branches or pull requests

10 participants