Mike Cooper
Mike Cooper

Reputation: 1095

Git push over SSH fails with Broken pipe

I have a remote git repo on an internal server that I can no longer push to:

% git push
Broken pipe

This worked fine up until a few weeks ago (I just tried a push for the first time this month).

I'm able to ssh just fine:

% ssh sol date
Mon Jan 22 15:23:33 PST 2018

I enabled GIT_TRACE=2 and see this:

% git push
16:00:52.629043 git.c:344               trace: built-in: git 'push'
16:00:52.643399 run-command.c:626       trace: run_command: 'ssh' 'sol' 'git-receive-pack '\''/vol/git/cmb.git'\'''
16:00:52.991631 run-command.c:626       trace: run_command: 'pack-objects' '--all-progress-implied' '--revs' '--stdout' '--thin' '--delta-base-offset' '--progress'
Broken pipe

Does this mean it's trying to run "pack-objects" locally or on the remote host? Is "pack-objects" suppose to be an executable in the default $PATH? I don't see it:

% which pack-objects
pack-objects: Command not found.

Local system is Windows 10 + Cygwin + git 2.15.1 Remote system is RHEL 7 + git 2.15.1. The git install is from ius and uses default paths so /bin/git is in default $PATH.

I did try this even though I assume it only effects HTTP:

% git config http.postBuffer 52428800
16:00:49.671332 git.c:344               trace: built-in: git 'config' 'http.postBuffer' '52428800'

I also tried "git fetch" which gives an error:

% git fetch
10:08:37.458683 git.c:344               trace: built-in: git 'fetch'
10:08:37.756135 run-command.c:626       trace: run_command: 'ssh' 'sol' 'git-upload-pack '\''/vol/git/cmb.git'\'''
10:08:39.441934 run-command.c:626       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
10:08:39.737251 run-command.c:626       trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet'
error: sol:/vol/git/cmb.git did not send all necessary objects

10:08:40.226984 run-command.c:626       trace: run_command: 'gc' '--auto'

Upvotes: 2

Views: 747

Answers (3)

Mike Cooper
Mike Cooper

Reputation: 1095

The problem appears to be with my Cygwin git install on the client. If I install Git for Windows 2.16.1 as suggested (thank you VonC!) then that works fine. So it's something with Cygwin git that broke.

Upvotes: 0

ephemient
ephemient

Reputation: 204768

RHEL 7 ships with an older Git by default. Perhaps your 2.15.1 installation is not in the standard path, and it's added to $PATH using .profile or some other shell mechanism which is not invoked during non-interactive SSH? If that is the case, try using

git push --receive-pack=/path/to/git-receive-pack

after determining the correct path on the remote during an interactive SSH session.

Upvotes: 0

VonC
VonC

Reputation: 1324537

To rule out any client-side issue, try the same command with:

Upvotes: 1

Related Questions