os x lion: git can't find libcrypto.so.0.9.7 - macos

Background:
I've just replaced my hard drive, and done a fresh install of Lion. I installed git from source and make test seemed fine. SSH keys are loaded and I can ssh into the remote box without problem.
Problem:
I get the following error when trying to pull over ssh when using scp style syntax:
$ git pull origin master
git-upload-pack: error while loading shared libraries: libcrypto.so.0.9.7: cannot open shared object file: No such file or directory
My .git/config for origin looks like this:
[remote "origin"]
url = me#example.com:some_repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
If I change the url to ssh://me#example.com/path/to/some/repo.git it works fine.
I recognize that I could just change all my urls to that format, but I'd rather have a system that works correctly without having to work around setup issues every time.
I was able to push and pull to this repo just fine before reinstalling lion, and I still can with the different syntax. I suspect I symlinked something to work around this on the old hard drive way back in the snow-leopard days, but I'm having a hell of a time googling what it was. I found one post that suggested the problem was a missing library server-side and the error message was misleading, but this can't be the case because it worked just fine on the old hard-drive, and it works just fine with the ssh:// syntax
Anyone know how to address this?

Try to use dtrace to figure out what git it up to. Run this in another terminal and then run git pull as usual.
$ sudo dtrace -qn 'syscall::execve:entry { printf("%s\n", copyinstr(arg0)); }'
/usr/bin/uname
/usr/libexec/git-core/git
... Cut ...
/usr/libexec/git-core/git-pull
/usr/libexec/git-core/ssh
/usr/bin/ssh
Use otool -L /usr/bin/ssh to see if some library is missing.
But while writing this it think your problem might be on the server side. If you instead of my dtrace one-liner run sudo newproc.d while running git pull you will see something like this:
58694 64b ssh me#example.com git-upload-pack 'some_repo.git'
Which indicates that the error might be from git-upload-pack when it is executed on the server side. So take a look at the dynamic libraries used by git-upload-pack on the server.
Try to run ssh me#example.com 'ldd $(which git-upload-pack)' and look for something fishy. Does git-upload-pack work from the shell?

Related

git ssh authentication fails with ssh_askpass: posix_spawn: Unknown error

I am using a setup on Windows 10 x64 where I install and manage git via scoop, rather downloading and executing the installer myself. Via the PowerShell, I ran
scoop install git
scoop install openssh
[environment]::setenvironmentvariable('GIT_SSH', (resolve-path (scoop which ssh)), 'USER')
However, now when I try to run commands in the Git Bash like
git clone git#example.org:vendor/repository.git
or a simple
git push/pull
I only get
CreateProcessW failed error:193
ssh_askpass: posix_spawn: Unknown error
instead of the Git Bash asking me for my SSH key's passphrase.
I am using the same setup (git installed via scoop) on many other Windows 10 x64 and no problems occur there. So I am not sure what is going wrong on this one. I previously had git installed without scoop on the same machine and the Git Bash was working fine. I uninstalled git completely (and also restarted the machine, just to be sure) before re-installing it via scoop instead.
The SSH_ASKPASS environment variable contains the following, in case this is relevant:
$ echo ${SSH_ASKPASS}
/mingw64/libexec/git-core/git-gui--askpass
Not sure what that folder refers to (something internal to the Git Bash presumably?), since it obviously does not exist like that on my machine.
Update
When using git-with-openssh instead of just git and openssh separately it works. However, I don't use that on my other machines, so I'd still like to know why it's not working here.
I'm pretty sure my answer does not address the OP's original case. But as of 2020, there seems to be a similar issue with a different way of solving it, and that's how I did in my case.
Part of the problem is, now Windows 10 has its own version of OpenSSH available, and at least in the case of my work's machine it seems that option is enabled by default.
This bundled OpenSSH is not compatible with Git bash though, so if you wants to use it, you must force git use scoop's provided OpenSSH (either from openssh or git-with-openssh packages). That means overwriting GIT_SSH environment variable, e.g. by adding a line similar to this to your .bashrc:
export GIT_SSH='C:\Users\rogs\scoop\apps\git-with-openssh\current\usr\bin\ssh.exe'
Hope it helps.
Even if this topic is already very old, the problem persists. I found out that its enough to simply unset the environment variable to get rid of this error.
unset SSH_ASKPASS
Just put this in your .bash_profile and/or your .bashrc.

Cannot Clone GIT Repository from windows server but can SSH

I have a seen a lot of posts related to the error I am getting but can't find anything that seems like a potential fix I would like to try without getting feedback from some people who know better.
The Setup: I recently built a Windows 7 PC and installed Apache, PHP and MySQL. Everything is working great with my setup and I opened the server up to other devices on the LAN. When I go to a browser and navigate to IPADDRESS:PORT (Installed Apache to listen on a custom port to avoid potential conflicts (Skype, future IIS install?, etc) I get my htdocs index.php page. Great so far.
The last thing I wanted to do was setup Git so that I can do work for my server on my Macbook Pro and push changes to the server. To get this up and running I installed msysgit on my server and was able to create a Git repository for a Media directory I created at the root of my server. When I open this directory up in Explorer I can see the .git directory. The next thing I did was install OpenSSH on the server and I got that up and running. I also changed the default home directory of an SSH connection to the htdocs folder of my Apache server.
Now when I move over to my Macbook pro to test the setup and I am getting problems.
SSH seems to be functioning as expected. When I am on my laptop and run ssh USERNAME#IPADDRESS I get the message to enter my password, I enter my login password and awesome I am in the shell of my server at the htdocs directory.
Git does not seem to be functioning as easily though. I have Git on my Macbook Pro and was able to create a repository in a local directory no problem. When I navigate to a new directory in Terminal that I would like to work with the Media folder project I created on the server and run the following Git commands:
git clone USERNAME#IPADDRESS:/Media
git clone USERNAME#IPADDRESS:\Media
git clone USERNAME#IPADDRESS:/Media.git
git clone USERNAME#IPADDRESS:/Media/.git
etc
(Not sure what exact command I'm supposed to be running. Do I need .git at the end of this command? I see a hidden .git directory in the Media directory but I don't see a Media.git file.)
I get the following error:
Received disconnect from IPADDRESS: 2: fork failed: Resource temporarily unavailable
fatal: The remote end hung up unexpectedly
Based on my searching I can't tell if this error is coming from my client (Macbook Pro) or server. I read that it could be a threading limit set on my Macbook so I entered the following commands and upped my maxprocperuid:
sudo sysctl -a|grep maxprocperuid (which outputted 709)
sudo sysctl -w kern.maxprocperuid=3000 (upped it to ridiculous number to see if it was the problem)
But I am still getting the error when trying to clone the repository.
If you've gotten to the end of this thanks, just trying to provide as much info as possible and any help would really be appreciated.
Thanks.
Try uninstalling OpenSSH and then installing WinSSHD again. Check out this link which suggests the same.
Also, this question might be of some help to you while you are at it.
Git doesn't use ssh by default so you have to specify it when cloning
git clone ssh://[username]#[ip-address]:[port][/path/to/repo]

error: cannot run ssh: No such file or directory when trying to clone on windows

I am trying to clone a remote repository on Windows, but when I did this:
git clone git#github.com:organization/xxx.git
I got this error:
error: cannot run ssh: No such file or directory
fatal: unable to fork
Am I missing something?
Check if you have installed ssh-client. This solves the problem on docker machines, even when ssh keys are present:
apt-get install openssh-client
You don't have ssh installed (or don't have it within your search path).
You can clone from github via http, too:
git clone http://github.com/organization/xxx
Most likely your GIT_SSH_COMMAND is referencing the incorrect public key.
Try:
export GIT_SSH_COMMAND="ssh -i /home/murphyslaw/.ssh/your-key.id_rsa
then
git clone git#github.com:organization/xxx.git
I am aware that it is an old topic, but having this problem recently, I want to bring here what I resolve my issue.
You might have this error on these conditions :
You use a URL like this : git#github.com:organization/repo.git
And you run a kind of command like this directly : git clone git#github.com/xxxxx.git whereas you don't have ssh client (or it is not present on path)
Or you have an ssh client installed (and git clone xxx.git work fine on direct command line) but when you run the same kind of command through a shell script file
Here, I assume that you don't want to change protocol ssh git# to http://
(git#github.com:organization/repo.git -> http://github.com/organization/repo.git), like my case, cause I needed the ssh format.
So,
If you do not have ssh client, first of all, you need to install it
If you have this error only when you execute it through a script, then you need to set GIT_SSH_COMMAND variable with your public ssh key, in front of your git command, like this :
GIT_SSH_COMMAND="/usr/bin/ssh -i ~/.ssh/id_rsa" git pull
(Feel free to change it depending on your context)
I had this issue right after my antivirus moved the cygwin ssh binary to virus vault, and restored it after.
Symptoms:
SSH seems properly installed
SSH can be run from command line without problem
Another option before reinstalling ssh in this particular case: check the ssh command permissions
$ ls -al /usr/bin/ssh.exe
----rwxrwx+
$ chmod 770 /usr/bin/ssh.exe
You can try these as well
ssh-add ~/.ssh/identity_file
chmod 400 ~/.ssh/identity_file
It so happened in my case that the new pair of ssh keys linked with my git account were not accessible.
I had to sudo chmod 777 ~/.ssh/id_rsa.* to resolve the issue.

I can push with Git Bash, but I cannot with MINGW

I use MINGW32 under Windows 7 and I want to configure Git for that.
I know that there is the Git bash but I would like to use my MINGW32 installation
Right now my problem is that I cannot push my code.
After issuing "git push origin master" it simply stops waiting for something.
Probably is an ssh configuration issue (maybe is not finding the ssh agent?), but I can't figure out what it is.
This is what I see
$ git push origin master --verbose
Pushing to git#github.com:mottalrd/myprj.git
Then nothing happens
Notice that the ssh connection works, in fact if I issue ssh -T git#github.com I get this
$ ssh -T git#github.com
Enter passphrase for key '/home/motta/.ssh/id_dsa':
Hi mottalrd! You've successfully authenticated, but GitHub does not provide shell access.
Thank you
I discovered that this is a very well know problem and that it is related with mintty, which I had installed on top of MINGW
It is called the pty problem. You can browser the MINGW community to find people having this exact problem. I switched to console2 that is a replacement to mintty. This solved my problem

Git fatal: remote end hung up

So I thought I had finally got everything setup on Windows ... then ran into this issue.
Current setup
URL: ssh://user#host:port/myapp.git
Already run Putty - and can connect using valid .ppk keys through the ~/.ssh/authorized_keys direct. In Git and TortoiseGIT - I set both to use "plink.exe".
Putty works fine - no issues - but when I run that URL into bash I get for a git clone (url)
fatal: the remote end hung up expectedly
In a cygwin bash terminal - running "ssh user#host" - works no probs at all.
Anyone suggest anything?
I found out that using ssh.exe from the Git package works every time, as opposed to the ssh that comes with cygwin (the default).
Using this exported variable seems to help; it's slower (2x or more) but it's more stable. Take it as another workaround.
$ export GIT_SSH=/cygdrive/c/Program\ Files/Git/bin/ssh.exe
FYI:
This version of Msysgit comes with OpenSSH 4.6p1, OpenSSL 0.9.8e. [works]
Cygwin's SSH is OpenSSH 5.5p1, OpenSSL 0.9.8n. [doesn't work]
I had the same problem with plink for git under windows.
On run of plink.exe -v xxx#host.com it started to show
Pageant is running. Requesting keys.
Pageant has 1 SSH-2 keys
login as: <<< trouble
Instead of
Pageant is running. Requesting keys.
Pageant has 1 SSH-2 keys
Using user "xxx"
To resolve this problem I cleaned up the putty registry records and sessions by
putty.exe -cleanup
After that plink starts afresh and asks to trust and store the host again and it is getting connected with no problem !
Try following steps, maybe something will give you a hint on your problem:
1. Run putty and after setting up server name/user name/keys etc. save those settings.
2. Run plink.exe or plinkw.exe like plink.exe user_name#server, (it'll throw some info at you) just to see if plink can connect to the server.
3. Check again that git knows that it should use plink, I'd say with all VCSs, that's the problem people have most often, apart from their keys not being set up properly.
Normally by now most of your ssh problems would be revealed. Now just fix them. :)
Update:
I think the problem you have is caused by several gits you've got installed. For the msysgit and cygwin git you'd need to set the GIT_SSH variable. That's done via either 'set GIT_SSH=c:\path\putty\plink.exe' or 'export GIT_SSH=/your/path/putty/putty.exe' respectively. If you're also using tortoise git, you'd need to locate 'properties' (or is it settings?) in it's menu, and set the ssh client there.
Apart from all that, when specifying git clone URL, use your login name and the server name in there, e.g. 'git clone ssh://user#server/your/path/repo.git User and server names should be used by plink, and plink should be able to connect to the server with those arguments, when all of those requirements are met, you'll be all set.
Good luck.
If you want to try the cygwin openssh 5.4p1-1, which does seem to work for this, unlike 5.5 or 5.6, you can use the cygwin time machine mirrors. Start setup.exe with -X and add a mirror Url, such as:
ftp://www.fruitbat.org/pub/cygwin/circa/2010/05/20/230133
Be careful not to install too much, i.e. base packages, from an older mirror than the rest of your install.
We had same problem and here is solution how we solved the problem:
at first we got:
zajdan#cyberFuture:~$ git clone ssh://nette#19X.16X.14X.7X/~repos/erotika.git/ erotika
Initialized empty Git repository in /home/zajdan/erotika/.git/
Password:
fatal: '/repos/erotika.git': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
zajdan#cyberFuture:~$
solution:
zajdan#cyberFuture:~$ git clone ssh://nette#19X.16X.14X.7X/~/repos/erotika.git/ erotika
after tilde there must be a slash!
I have exactly the same issue.
I don't use Putty (just Cygwin).
I use Windows 7 Ultimate (fully patched as of this moment).
I just installed Cygwin yesterday.
I made sure binary mounts were being used.
If I copy a git repo to the machine (via samba mount), I can clone it, but when I "git diff" after the clone, there are a bunch of "different" files with no diffs. After a "git status" there was no output from "git diff". It seems like a newline thing, but I can't figure out how that would be happening. (I have igncr in SHELLOPTS, but removing that doesn't fix it.)
I'm completely stumped.
Check the openssh version you're using in CygWin. Version 5.5p1-1 (which is the latest at this time) gave me the same error. Downgrading to 5.4p1-1 fixed the problem.
Another solution would be to use putty/plink instead of openssh.
For more details, see this thread: http://www.mail-archive.com/cygwin#cygwin.com/msg103752.html
I get message: "remote end gung-up, unexpected EOFs, index-pack failed" while cloning git repo but was able to workaround this issue with copssh http://sourceforge.net/projects/sereds/files/Copssh
The root cause is Cygwin openssh package.
I removed original openssh from Cygwin, installed copssh and set GIT_SSH variable to point copssh binaries. After this I simply added copssh binaries in the PATH and now I'm using copssh instead of openssh - there is no difference.
Everything works fine and issue does not appear any more.
The other solution is to use mSysGit package.
I believe the real problem is that cygwin's ssh looks for .ssh in /home/name/.ssh and mingw's git ssh looks for .ssh in c:/user/name/.ssh
Chances are your keys are in one and only one of these directories.
You can trying telling cygwin's .ssh to use a different identity file using the -i switch, or move the keys into both directories, or create an ssh config file in /home/name/.ssh/config.
I created a config that contains:
Host github.com
User jerryasher
Hostname github.com
IdentityFile c:/Users/jerry/.ssh/id_rsa
And given that I can use either the mingw git from git bash or cygwin's git from an rxvt to interact with github.
To correct this issue, run "plink -agent github.com"
Press y when prompted to cache the key. Login as git. You'll automatically be disconnected. And it sould work.
Source: http://devlicio.us/blogs/sergio_pereira/archive/2009/05/06/git-ssh-putty-github-unfuddle-the-kitchen-sink.aspx
Try to use absolute path to repo in a URL, that worked for me.
Instead of:
git ssh://user#host:port/myapp.git
Write:
git ssh://user#host:port//home/user/repo/myapp.git
Notice the double slash!

Resources