Closed AnthonyMastrean closed 4 years ago
One possibility is that GitLab is using a cipher suite that is not configured by default with OpenSSH. I ran into this issue with TFS Git on our TFS 2015 server. Try this to enable verbose logging:
$env:GIT_SSH_COMMAND = '"C:\Windows\System32\OpenSSH\ssh.exe" -vvv'
Try the push and see what you get in the output.
I ran into the same issue, with multiple SSH keys managed. The problem is, I believe, in git lfs because when I don't install lfs it works perfectly.
I see this with repos with git-lfs as well, but no others. Turning on ssh -vvv and git trace provides additional clues. The initial ssh connection works and connects as expected, but the process gets stuck here with no additional debug output:
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
14:16:36.985296 run-command.c:663 trace: run_command: .git/hooks/pre-push origin git@a.gitserver.com:mygroup/my-repo.git
14:16:37.171576 exec-cmd.c:238 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
14:16:37.196030 git.c:704 trace: exec: git-lfs pre-push origin git@a.gitserver.com:mygroup/my-repo.git
14:16:37.197028 run-command.c:663 trace: run_command: git-lfs pre-push origin git@a.gitserver.com:mygroup/my-repo.git
14:16:38.022938 trace git-lfs: exec: git 'version'
14:16:38.119177 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
14:16:38.474769 trace git-lfs: exec: git 'config' '-l'
14:16:39.907192 trace git-lfs: run_command: sh -c "C:\Windows\System32\OpenSSH\ssh.exe" -vvv -- git@a.gitserver.com 'git-lfs-authenticate mygroup/my-repo.git upload'
I think it's able to connect just fine, but when the run_command is dispatched it hangs.
Same openssh and Win10 versions as original poster. Other versions:
git-lfs/2.7.2 (GitHub; windows amd64; go 1.12.2; git 08a08ae0)
git version 2.22.0.windows.1
GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-core
GIT_LFS_PATH=C:\Program Files\Git LFS
GIT_SSH_COMMAND="C:\Windows\System32\OpenSSH\ssh.exe" -vvv
GIT_TRACE=1
I'm having the exact same issue. The trace looks the same.
==== snip ====
11:27:30.147136 trace git-lfs: pre-push: refs/heads/nvm-test e6df7fd73686a4a16617f5b4ddeca75c37abf625 refs/heads/nvm-test 0000000000000000000000000000000000000000
11:27:31.818155 trace git-lfs: run_command: C:\Users\REDACTED\scoop\apps\win32-openssh\current\ssh.exe -- git@github.com git-lfs-authenticate myorg/myrepo.git upload
=== hangs here, output below after CTRL-C ===
11:30:27.533441 trace git-lfs: filepathfilter: rewrite ".git" as "**/.git/**"
11:30:27.533441 trace git-lfs: filepathfilter: rewrite "**/.git" as "**/.git"
11:30:27.539438 trace git-lfs: filepathfilter: accepting "tmp"
11:30:27.541438 trace git-lfs: filepathfilter: accepting "objects"
I'd like to add that running the command which appears to hang manually is successful:
> C:\Users\REDACTED\scoop\apps\win32-openssh\current\ssh.exe -- git@github.com git-lfs-authenticate myorg/myrepo.git upload
{
"href": "https://lfs.github.com/myorg/myrepo.git",
"header": {
"Authorization": "RemoteAuth REDACTED"
},
"expires_at": "2019-06-20T13:56:42Z",
"expires_in": 21599
}
Versions:
OpenSSH_for_Windows_7.9p1, LibreSSL 2.6.5
git-lfs/2.7.2 (GitHub; windows amd64; go 1.12.2; git 08a08ae0)
git version 2.22.0.windows.1
I have the same issue with the same configuration. I tried with git installed via scoop and also via chocolatey. I'm trying now using the openssh installed from scoop. That works fine... it's a minor annoyance for someone who wants a clean install, since you've got two versions of OpenSSH installed, and the scoop version installs the whole msys2 stack. But having a working git is more important! Looking forward to a cleaner fix.
I think this establishes that it's an issue with the microsoft-packaged OpenSSH?
Latest release (v8.0.0.0p1-Beta) from https://github.com/PowerShell/Win32-OpenSSH/releases works fine.
The one activated through Windows 10 optional feature is as far as i know - is 7.9 and having this hanging issue.
@yogasantosa do you see anything specific that fixes this issue (in the linked milestone, maybe)? Or does this one just happen to work in your testing?
@AnthonyMastrean - found this by accident:
Looking at the milestone there seemed to be two possible issues related to this one
This has been reported to be working, please reopen if this repros on the latest release.
"OpenSSH for Windows" version
Client OperatingSystem
What is failing
When GIT_SSH is set to OpenSSH, per the advice here https://github.com/dahlbyk/posh-git/issues/575#issuecomment-391386119, seemingly any
git push
hangs indefinitely? I had to send an interrupt (CTRL+C) to get the console back.Maybe related to https://github.com/PowerShell/Win32-OpenSSH/issues/389?
Expected output
A successful push 🤗
Actual output