masukomi
masukomi

Reputation: 10902

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

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 = [email protected]:some_repo.git
    fetch = +refs/heads/*:refs/remotes/origin/*

If I change the url to ssh://[email protected]/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?

Upvotes: 1

Views: 1426

Answers (1)

Mattias Wadman
Mattias Wadman

Reputation: 11425

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 [email protected] 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 [email protected] 'ldd $(which git-upload-pack)' and look for something fishy. Does git-upload-pack work from the shell?

Upvotes: 1

Related Questions