3

How can I configure plink.exe to be verbose when run by git?

The problem: on windows, using the command git.cmd clone git+ssh://user@host/repo folder when GIT_SSH=plink.exe intermittently fails across build slaves. I need to find the root cause, and make connections reliable, without retrying on some count.

I've narrowed down that sshd is running and terminating its processes without error. The server is running gitosis, so I only have command line output to go on. When the failure happens, gitosis doesn't get called (no gitosis prints), so I'm suspecting the windows ssh client.

I want to connect with verbose logging when plink.exe is invoked by git.

Setting GIT_SSH=plink.exe -v results in:

error: cannot spawn plink.exe -v: No such file or directory

Turns out, GIT_SSH must be an executable or wrapper script.

Creating such a batch file wrapper gets closer: GIT_SSH=C:\path\to\plink.cmd where plink cmd is plink.exe -v %* prints expected verbose logging to console, but terminates unsuccessfully with error code 128. The cloned folder is never created, and the last printed console output is:

Unable to write to standard output: The pipe is being closed.

How can I get the verbose client log at the time of failure from plink?

Epu
  • 211
  • 3
  • 8
  • I see that the source is available. I'm going to turn on verbose output by default and see if that just works without the cmd wrapper. – Epu Mar 04 '13 at 19:59

2 Answers2

1

Pull the source code from svn://svn.tartarus.org/sgt/putty, build the windows make files from a Visual Studio 2010 command prompt in the root dir using perl mkfiles.pl, and then build everything with nmake -f Makefile.vc.

Find a good place to make a local edit in winplink.c main() function. I put mine right before the arg processing loop.

flags |= FLAG_VERBOSE;
Epu
  • 211
  • 3
  • 8
  • Now I can see that git 1.8 + plink 0.62 on the client is failing intermittently with "fatal: protocol error: bad line length character: plin". But it's succeeding about 85% of the time. Keep hacking and logging to a file, I guess. :( – Epu Mar 08 '13 at 00:13
1

The "Plin" error is actually the first 4 characters of the returned error message from the Git server. Typically the account name passed in from 'echo %USERNAME%' when using plink.exe to provide the password.

We found the intermittent errors being related to inconsistent mapping of usernames to the GIT userlist. We ended up standardizing all the Git usernames in Uppercase. and the problem went away.

This problem affected many users across many Git branches.

  • This would make a good comment, but isn't a great answer, since it doesn't resolve how to make plink run verbosely. I'm glad you figured out your issue; but I'm not sure it was the same as mine. – Epu Aug 03 '16 at 21:25