Closed tomsseisums closed 4 years ago
So, that was the initial issue, now I also worked to get a MCVE with raw CMD:
This should be sufficient:
git config --global --add core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
git clone --single-branch --branch git-for-windows-win32-openssh-lfs git@github.com:joltmode/minimal-issue-repros.git minimal-issue-repros-git-for-windows-win32-openssh-lfs
And the log for that one:
Microsoft Windows [Version 10.0.17763.379]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Users\rymec0de>cd C:\TheDesktop\projects
C:\TheDesktop\projects>cd C:\TheDesktop\projects
C:\TheDesktop\projects>set GIT_TRACE=1
C:\TheDesktop\projects>git clone --single-branch --branch git-for-windows-win32-openssh-lfs git@github.com:joltmode/minimal-issue-repros.git minimal-issue-repros-git-for-windows-win32-openssh-lfs
12:58:01.098661 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
12:58:01.101161 git.c:419 trace: built-in: git clone --single-branch --branch git-for-windows-win32-openssh-lfs git@github.com:joltmode/minimal-issue-repros.git minimal-issue-repros-git-for-windows-win32-openssh-lfs
Cloning into 'minimal-issue-repros-git-for-windows-win32-openssh-lfs'...
12:58:01.165393 run-command.c:643 trace: run_command: unset GIT_DIR; C:/Windows/System32/OpenSSH/ssh.exe git@github.com 'git-upload-pack '\''joltmode/minimal-issue-repros.git'\'''
debug2: resolving "github.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to github.com [192.30.253.112] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\rymec0de/.ssh/id_ed25519 type 3
debug3: Failed to open file:C:/Users/rymec0de/.ssh/id_ed25519-cert error:2
debug3: Failed to open file:C:/Users/rymec0de/.ssh/id_ed25519-cert.pub error:2
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\rymec0de/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
debug1: Remote protocol version 2.0, remote software version babeld-51223baf
debug1: no match: babeld-51223baf
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to github.com:22 as 'git'
debug3: hostkeys_foreach: reading file "C:\\Users\\rymec0de/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file C:\\Users\\rymec0de/.ssh/known_hosts:13
debug3: load_hostkeys: loaded 1 keys from github.com
debug3: Failed to open file:C:/Users/rymec0de/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256
debug2: host key algorithms: ssh-dss,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc
debug2: MACs ctos: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib,zlib@openssh.com
debug2: compression stoc: none,zlib,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
debug3: hostkeys_foreach: reading file "C:\\Users\\rymec0de/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file C:\\Users\\rymec0de/.ssh/known_hosts:13
debug3: load_hostkeys: loaded 1 keys from github.com
debug3: Failed to open file:C:/Users/rymec0de/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug3: hostkeys_foreach: reading file "C:\\Users\\rymec0de/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file C:\\Users\\rymec0de/.ssh/known_hosts:13
debug3: load_hostkeys: loaded 1 keys from 192.30.253.112
debug3: Failed to open file:C:/Users/rymec0de/.ssh/known_hosts2 error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:/ProgramData/ssh/ssh_known_hosts2 error:2
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in C:\\Users\\rymec0de/.ssh/known_hosts:13
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: C:\\Users\\rymec0de/.ssh/id_ed25519 (00000235FFDE6260), explicit, agent
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: ED25519 SHA256:NZ1u8R0bLYtZWnaVNz0Xjcws/9LbGzzWXYZDBI6IuOg C:\\Users\\rymec0de/.ssh/id_ed25519
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: pkalg ssh-ed25519 blen 51
debug2: input_userauth_pk_ok: fp SHA256:NZ1u8R0bLYtZWnaVNz0Xjcws/9LbGzzWXYZDBI6IuOg
debug3: sign_and_send_pubkey: ED25519 SHA256:NZ1u8R0bLYtZWnaVNz0Xjcws/9LbGzzWXYZDBI6IuOg
debug3: send packet: type 50
debug3: receive packet: type 52
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([192.30.253.112]:22).
debug2: fd 5 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
debug3: send packet: type 90
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug1: Sending command: git-upload-pack 'joltmode/minimal-issue-repros.git'
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 32000 rmax 35000
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
debug2: channel 0: rcvd adjust 1248170
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 7 (delta 0), reused 4 (delta 0), pack-reused 0
12:58:03.342099 run-command.c:643 trace: run_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 14844 on CYANIDIUM' --check-self-contained-and-connected
12:58:03.379099 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:58:03.383599 git.c:419 trace: built-in: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 14844 on CYANIDIUM' --check-self-contained-and-connected
Receiving objects: 100% (7/7), done.
debug2: channel 0: read<=0 rfd 5 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
debug3: send packet: type 96
debug2: channel 0: input drain -> closed
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug3: receive packet: type 96
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
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug3: send packet: type 97
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
#0 client-session (t4 r43 i3/0 o3/0 fd -1/-1 cc -1)
debug3: send packet: type 1
debug3: fd 0 is not O_NONBLOCK
debug3: fd 1 is not O_NONBLOCK
Transferred: sent 2212, received 4188 bytes, in 0.9 seconds
Bytes per second: sent 2553.1, received 4833.7
debug1: Exit status 0
12:58:03.674931 run-command.c:643 trace: run_command: git rev-list --objects --stdin --not --all --quiet '--progress=Checking connectivity'
12:58:03.709926 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
12:58:03.715426 git.c:419 trace: built-in: git rev-list --objects --stdin --not --all --quiet '--progress=Checking connectivity'
12:58:03.759925 run-command.c:643 trace: run_command: 'git-lfs filter-process'
12:58:03.863931 trace git-lfs: exec: git 'version'
12:58:03.999925 trace git-lfs: exec: git 'config' '-l'
12:58:04.049527 trace git-lfs: Install hook: pre-push, force=false, path=C:\TheDesktop\projects\minimal-issue-repros-git-for-windows-win32-openssh-lfs\.git\hooks\pre-push
12:58:04.052529 trace git-lfs: Install hook: post-checkout, force=false, path=C:\TheDesktop\projects\minimal-issue-repros-git-for-windows-win32-openssh-lfs\.git\hooks\post-checkout
12:58:04.055528 trace git-lfs: Install hook: post-commit, force=false, path=C:\TheDesktop\projects\minimal-issue-repros-git-for-windows-win32-openssh-lfs\.git\hooks\post-commit
12:58:04.058531 trace git-lfs: Install hook: post-merge, force=false, path=C:\TheDesktop\projects\minimal-issue-repros-git-for-windows-win32-openssh-lfs\.git\hooks\post-merge
12:58:04.063527 trace git-lfs: Initialize filter-process
12:58:04.064026 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'
12:58:04.122527 trace git-lfs: tq: running as batched queue, batch size of 100
12:58:04.126029 trace git-lfs: filepathfilter: accepting "arrow-keys.png"
12:58:04.127029 trace git-lfs: tq: sending batch of size 1
12:58:04.132033 trace git-lfs: run_command: sh -c C:/Windows/System32/OpenSSH/ssh.exe -- git@github.com 'git-lfs-authenticate joltmode/minimal-issue-repros.git download'
Another update: no difference if key has been added to agent or not. In scenario of no key added to agent, upon verifying passphrase, the checkout freezes.
Looping in @ttaylorr and @bk2204, the Git LFS experts.
Is there anything specific about the way Git LFS calls SSH? Maybe it does not allocate a console? Or it does, and that's the problem?
Looking at our SSH code, we invoke SSH with /bin/sh
when the user provides us core.sshCommand
(because we have to, for compatibility with Git). We don't, however, provide a standard input to the command, so it's redirected from /dev/null
(or, I suppose, NUL
in this case) by default. I'm not sure why we don't provide it our standard input; it was likely an oversight, since the default if you don't specify in Go is to redirect to or from /dev/null
.
Normally this isn't a problem, since the user will have authenticated with a key by cloning with SSH using Git, and any prompting will have occurred there, but if the user normally receives a prompt on SSH usage, or is for some reason getting one here, that might explain it.
If that's what it looks like it is, I've pushed up a commit to the ssh-stdin
branch on the @bk2204 remote for Git LFS; if the user can test that it works, I'll try to get it submitted and into an upcoming version.
@bk2204 built your version and tried with it, the problem still persists.
I also hit this issue, so I decided to investigate it. Let me share my current progress.
ssh.exe is stuck while it is trying to write to stderr "GetConsoleMode on STD_INPUT_HANDLE failed with 6
".
There seems to be two separate (but strongly related) problems:
GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &dwAttributes)
fails.GIT_SSH
or whatever)I got the stack traces below.
The worker thread was stuck here: https://github.com/PowerShell/openssh-portable/blob/v7.7.2.0/contrib/win32/win32compat/signal_wait.c#L96
ntdll.dll!NtDelayExecution() Unknown
KernelBase.dll!SleepEx() Unknown
> ssh.exe!wait_for_multiple_objects_enhanced(unsigned long nCount, void * const * lpHandles, unsigned long dwMilliseconds, int bAlertable) Line 96 C
ssh.exe!wait_for_any_event(void * * events, int num_events, unsigned long milli_seconds) Line 289 C
ssh.exe!fileio_write(w32_io * pio, const void * buf, unsigned __int64 max_bytes) Line 746 C
ssh.exe!w32_write(int fd, const void * buf, unsigned __int64 max) Line 531 C
ssh.exe!do_log(LogLevel level, const char * fmt, char * args) Line 462 C
ssh.exe!error(const char * fmt, ...) Line 164 C
ssh.exe!ReadThread(void * lpParameter) Line 96 C
[Inline Frame] ssh.exe!invoke_thread_procedure(unsigned int(*)(void *) context, void * const) Line 91 C++
ssh.exe!thread_start<unsigned int (__cdecl*)(void * __ptr64)>(void * const parameter) Line 115 C++
kernel32.dll!00007ff8e15d7bd4() Unknown
ntdll.dll!RtlUserThreadStart() Unknown
The main thread was waiting the worker thread: https://github.com/PowerShell/openssh-portable/blob/v7.7.2.0/contrib/win32/win32compat/termio.c#L264
ntdll.dll!NtWaitForSingleObject() Unknown
KernelBase.dll!WaitForSingleObjectEx() Unknown
> ssh.exe!syncio_close(w32_io * pio) Line 266 C
ssh.exe!fileio_close(w32_io * pio) Line 972 C
ssh.exe!w32_close(int fd) Line 611 C
ssh.exe!channel_close_fd(ssh * ssh, int * fdp) Line 428 C
ssh.exe!chan_shutdown_read(ssh * ssh, Channel * c) Line 409 C
ssh.exe!chan_rcvd_oclose(ssh * ssh, Channel * c) Line 292 C
ssh.exe!channel_input_oclose(int type, unsigned int seq, ssh * ssh) Line 3040 C
ssh.exe!ssh_dispatch_run(ssh * ssh, int mode, volatile int * done) Line 114 C
[Inline Frame] ssh.exe!ssh_dispatch_run_fatal(ssh * ssh, int) Line 133 C
[Inline Frame] ssh.exe!client_process_buffered_input_packets() Line 1157 C
ssh.exe!client_loop(ssh * ssh, int) Line 1299 C
ssh.exe!main(int ac, char * * av) Line 1551 C
ssh.exe!wmain(int argc, wchar_t * * wargv) Line 61 C
[Inline Frame] ssh.exe!invoke_main() Line 79 C++
ssh.exe!__scrt_common_main_seh() Line 253 C++
kernel32.dll!00007ff8e15d7bd4() Unknown
ntdll.dll!RtlUserThreadStart() Unknown
I had seen something similar in the past. A child process was hanging (waiting for the parent to read from the pipe it tries to write to, but the buffer is full) because the parent process was not clearing the child's output buffer to which it connected itself using pipes. Not sure if that's the case here, I just wanted to give a hint where to look further.
On Sat, Jul 27, 2019, 6:38 AM asmichi notifications@github.com wrote:
I also hit this issue, so I decided to investigate it. Let me share my current progress.
ssh.exe is stuck while it is trying to write to stderr "GetConsoleMode on STD_INPUT_HANDLE failed with 6".
There seems to be two separate (but strongly related) problems:
- GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &dwAttributes) https://github.com/PowerShell/openssh-portable/blob/v7.7.2.0/contrib/win32/win32compat/termio.c#L93 fails.
- This write to stderr doesn't complete, even after the ancestors (git.exe - git.exe - sh.exe - git-lfs.exe) exit.
Details
- Download and extract OpenSSH for Windows v7.7.2.0p1-Beta https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v7.7.2.0p1-Beta (the executables and the symbols)
- Configure git to use it (GIT_SSH or whatever)
- Reproduce the issue.
- Attach to the stuck ssh process.
I got the stack traces below.
The worker thread was stuck here:
ntdll.dll!NtDelayExecution�() Unknown
KernelBase.dll!SleepEx() Unknown
ssh.exe!wait_for_multiple_objects_enhanced(unsigned long nCount, void const lpHandles, unsigned long dwMilliseconds, int bAlertable) Line 96 C
ssh.exe!wait_for_any_event(void events, int num_events, unsigned long milli_seconds) Line 289 C
ssh.exe!fileio_write(w32_io pio, const void buf, unsigned __int64 max_bytes) Line 746 C
ssh.exe!w32_write(int fd, const void * buf, unsigned __int64 max) Line 531 C
ssh.exe!do_log(LogLevel level, const char fmt, char args) Line 462 C
ssh.exe!error(const char * fmt, ...) Line 164 C
ssh.exe!ReadThread(void * lpParameter) Line 96 C
[Inline Frame] ssh.exe!invoke_thread_procedure(unsigned int()(void ) context, void * const) Line 91 C++
ssh.exe!thread_start<unsigned int (cdecl)(void ptr64)>(void * const parameter) Line 115 C++
kernel32.dll!00007ff8e15d7bd4() Unknown
ntdll.dll!RtlUserThreadStart�() Unknown
The main thread was waiting the worker thread:
https://github.com/PowerShell/openssh-portable/blob/v7.7.2.0/contrib/win32/win32compat/termio.c#L264
ntdll.dll!NtWaitForSingleObject�() Unknown
KernelBase.dll!WaitForSingleObjectEx�() Unknown
ssh.exe!syncio_close(w32_io * pio) Line 266 C
ssh.exe!fileio_close(w32_io * pio) Line 972 C
ssh.exe!w32_close(int fd) Line 611 C
ssh.exe!channel_close_fd(ssh ssh, int fdp) Line 428 C
ssh.exe!chan_shutdown_read(ssh ssh, Channel c) Line 409 C
ssh.exe!chan_rcvd_oclose(ssh ssh, Channel c) Line 292 C
ssh.exe!channel_input_oclose(int type, unsigned int seq, ssh * ssh) Line 3040 C
ssh.exe!ssh_dispatch_run(ssh ssh, int mode, volatile int done) Line 114 C
[Inline Frame] ssh.exe!ssh_dispatch_run_fatal(ssh * ssh, int) Line 133 C
[Inline Frame] ssh.exe!client_process_buffered_input_packets() Line 1157 C
ssh.exe!client_loop(ssh * ssh, int) Line 1299 C
ssh.exe!main(int ac, char av) Line 1551 C
ssh.exe!wmain(int argc, wchar_t wargv) Line 61 C
[Inline Frame] ssh.exe!invoke_main() Line 79 C++
ssh.exe!__scrt_common_main_seh() Line 253 C++
kernel32.dll!00007ff8e15d7bd4() Unknown
ntdll.dll!RtlUserThreadStart�() Unknown
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/git-for-windows/git/issues/2143?email_source=notifications&email_token=ABZH5SBRBFGBRE73D4AVDN3QBQQTLA5CNFSM4HCIQB72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD26JB4Y#issuecomment-515674355, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZH5SE5FW536BEGA7NYGBLQBQQTLANCNFSM4HCIQB7Q .
Hey, this does not reproduce when I use v8.0.0.0p1-Beta.
Well, so, this is an issue in OpenSSH for Windows and... fixed in PowerShell/Win32-OpenSSH#1330 PowerShell/Win32-OpenSSH#856.
C:\home\tmp\minimal-issue-repros-git-for-windows-win32-openssh-lfs>set GIT_SSH=C:\tmp\OpenSSH-Win64-v8.0.0.0p1-Beta\ssh.exe
C:\home\tmp\minimal-issue-repros-git-for-windows-win32-openssh-lfs>git lfs fetch
fetch: Fetching reference refs/heads/git-for-windows-win32-openssh-lfs
Downloading LFS objects: 100% (1/1), 966 KB | 276 KB/s
C:\home\tmp\minimal-issue-repros-git-for-windows-win32-openssh-lfs>
C:\>C:\tmp\OpenSSH-Win64-v7.9.0.0p1-Beta\ssh.exe -- git@github.com "git-lfs-authenticate joltmode/minimal-issue-repros.git download" < NUL
(CENSORED)
GetConsoleMode on STD_INPUT_HANDLE failed with 6
{
"href": "https://lfs.github.com/joltmode/minimal-issue-repros",
"header": {
(CENSORED)
},
"expires_at": "2019-07-27T11:18:54Z",
"expires_in": 599
}(stuck here)
C:\>C:\tmp\OpenSSH-Win64-v8.0.0.0p1-Beta\ssh.exe -- git@github.com "git-lfs-authenticate joltmode/minimal-issue-repros.git download" < NUL
(CENSORED)
{
"href": "https://lfs.github.com/joltmode/minimal-issue-repros",
"header": {
(CENSORED)
},
"expires_at": "2019-07-27T11:16:12Z",
"expires_in": 599
}
C:\>
this does not reproduce when I use v8.0.0.0p1-Beta.
I had hoped for some confirmation by @joltmode , but hey, at least I have one vote for closing this ticket and none for leaving it open.
@dscho ah, haven't got around to testing it with different versions of OpenSSH.
Though, it makes perfect sense to me that the problem relied there and has been fixed. Hence, I'm also cool with this getting closed.
Setup
Installed with chocolatey's default options.
Besides the fact that I'm trying to use Windows integrated Win32-OpenSSH - none that I can think of.
Details
Cmd through Cmder (ConEmu)
Successful clone, checkout and LFS retrieval.
Checkout happens, but when LFS object retrieval should start, it freezes.
The last ran process:
stays open with no activity:
And it will stay open for hours and nothing changes.
It's happening with any repository and any provider (tested with GitLab and GitHub for both clones and pushes) if using SSH remote and the repo has LFS.
I thought that maybe the problem is due to wrapped
sh -c
call.I tested by running raw
git-lfs-authenticate
commands from CMD:C:/Windows/System32/OpenSSH/ssh.exe -- git@gitlab.com 'git-lfs-authenticate mindboiler/rollhill/rollhill.git download'
- this returnedGitLab: Disallowed command
C:/Windows/System32/OpenSSH/ssh.exe -- git@gitlab.com "git-lfs-authenticate mindboiler/rollhill/rollhill.git download"
- returned the expected token response."C:\Program Files\Git\usr\bin\sh.exe" -c "C:/Windows/System32/OpenSSH/ssh.exe -- git@gitlab.com 'git-lfs-authenticate mindboiler/rollhill/rollhill.git download'"
- also returned the expected token response.So the
sh -c
call works as expected, at least when run raw with nogit
context.There is no difference whether I run this through Cmder (ConEemu) or native CMD, both pose the same issue.
As of finishing this issue post, I have three open and inactive and stalled console windows on
"C:\Program Files\Git\usr\bin\sh.exe" -c "C:/Windows/System32/OpenSSH/ssh.exe -- git@<provider> 'git-lfs-authenticate <repo> download'"
: