0

I'm trying to push a git repo from my local machine to a gitlab server that's behind a firewall. I can ssh to a machine that's behind the firewall so I have configured ~/.ssh/config so that connections to gitlab go through the second machine as a "jump host".

The very first time I pushed this local repo, after creating the project on gitlab's web UI, the push worked. Now, every time I try it seems to do the push but at the end it gives me:

Write failed: Broken pipe
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

I've tried with the following ~/.ssh/config:

host jumphost
hostname <jumphost_ip>
user userA

host gitlab
hostname <gitlab_ip>
user git
#ProxyCommand ssh -v jumphost nc %h %p
proxycommand ssh -v -W %h:%p jumphost
#proxyjump jumphost

host *
#controlmaster auto
#controlpath ~/.ssh/%r@%h:%p
#controlpersist 1m
tcpkeepalive yes
serveraliveinterval 120

I've tried the 3 options of "jump host" that I've found online. I've tried from WSL(Bash on Windows), with ssh version 6.6.1p1 and git 1.9.1. I've also tried from git's windows installer, with ssh 7.3p1 and git 2.12.2.

With the -v command added in, I get a lot of normal looking output, but at the end it shows:

...
debug1: Authentication succeeded (publickey).
Authenticated to <jumphost_ip> ([<jumphost_ip>]:22).
debug1: channel_connect_stdio_fwd <gitlab_ip>:22
debug1: channel 0: new [stdio-forward]
debug1: getpeername failed: Bad file descriptor
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
Counting objects: 55, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (17/17), done.
Writing objects: 100% (20/20), 711.75 KiB | 0 bytes/s, done.
Total 20 (delta 10), reused 11 (delta 1)
debug1: channel 0: FORCE input drain
debug1: stdio forwarding: done
Connection to <gitlab_ip> closed by remote host.
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

The newer versions show the same except 'packet_write_wait: Connection to UNKNOWN port 65535: Broken pipe' instead of 'Connection to closed by remote host.'.

I tried turning on controlmaster thinking that maybe the connections were closing early and that would keep them open. I kept getting the same error on the older versions and the newer versions wouldn't even initiate a connection.

The push does not show up on the server.

Has anyone seen this issue before? It doesn't seem like it would be that uncommon of a setup.

EDIT With LogLevel debug3, the output at the end looks like:

Authenticated to <gitlab_ip> (via proxy).
debug2: fd 3 setting O_NONBLOCK
debug2: fd 6 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug2: callback start
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug3: Ignored env SHELL
debug3: Ignored env TERM
debug3: Ignored env USER
debug3: Ignored env NAME
debug3: Ignored env LS_COLORS
debug3: Ignored env HOSTTYPE
debug3: Ignored env PATH
debug3: Ignored env PWD
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env SHLVL
debug3: Ignored env HOME
debug3: Ignored env LOGNAME
debug3: Ignored env LESSOPEN
debug3: Ignored env LESSCLOSE
debug3: Ignored env OLDPWD
debug3: Ignored env _
debug3: Ignored env GIT_PREFIX
debug1: Sending command: git-receive-pack '<repo>'
debug2: channel 0: request exec confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
Counting objects: 55, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (17/17), done.
Writing objects: 100% (20/20), 711.75 KiB | 0 bytes/s, done.
Total 20 (delta 10), reused 11 (delta 1)
debug2: channel 0: read<=0 rfd 3 len 0
debug2: channel 0: read failed
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug2: channel 0: input drain -> closed
debug2: channel 0: rcvd adjust 111231
debug2: channel 0: rcvd adjust 98556
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug1: channel 0: FORCE input drain
debug2: channel 0: rcvd close
debug2: channel 0: send eof
debug2: channel 0: input drain -> closed
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug1: stdio forwarding: done
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
#0 client-session (t4 r0 i3/0 o0/0 fd -1/6 cc -1)

debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Connection to <gitlab_ip> closed by remote host.
Transferred: sent 734404, received 3544 bytes, in 5.6 seconds
Bytes per second: sent 130904.4, received 631.7
debug1: Exit status -1
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
bj0
  • 101
  • 2

0 Answers0