Home | Edit | New

Guides: 'percent_expand: NULL replacement' Bug feed

If you’re experiencing this problem on OSX, it’s likely caused by your MacPorts version of git. Macports compiles its packages’ source code after downloading standard source tarballs and running a MacPorts-specific patch against them. The git binary has been patched to use MacPorts’ own version of ssh (irrespective of your $PATH matching the OSX binaries) which, in turn, blows up git with the “fatal error”.

The solution is to simply rename the /opt/local/bin/ssh and /opt/local/bin/scp binaries and then replace them with a symlink which points to the OSX-supplied version.

Here’s how:

$ sudo -s # To get a root prompt
$ cd /opt/local/bin
$ mv ssh{,_macports}
$ mv scp{,_macports}
$ ln -s /usr/bin/ssh ssh
$ ln -s /usr/bin/scp scp
This should fix it. Thanks to Jay Phillips for figuring this out. Note that this can also be fixed by specifying the IdentifyFile in your .ssh/config (see here)

The "openssh 5.0p1_0+darwin_9" macport should solve the problem. Use the following commands to update OpenSSH:

$ sudo port selfupdate
$ sudo port upgrade openssh
Last edited by djwonk, 2 months ago
Versions: