Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scp to non existing directory hangs #1345

Closed
matkaminski opened this issue Feb 21, 2019 · 4 comments · Fixed by PowerShell/openssh-portable#376
Closed

scp to non existing directory hangs #1345

matkaminski opened this issue Feb 21, 2019 · 4 comments · Fixed by PowerShell/openssh-portable#376

Comments

@matkaminski
Copy link

"OpenSSH for Windows" version
7.9.0.0

Server OperatingSystem
Windows Server 2016 Datacenter

Client OperatingSystem
MacOs/Linux/Other

What is failing
I am using openssh server for windows version 7.9.0.0 on Windows Server 2016. I am using it for scp and it works if i am uploading files to existing directories. If i will specify target directory not existing on my Windows Server then scp command get stuck and hangs forever.

Last lines in my client log:
debug1: Sending command: scp -v -t testdir/testfile
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 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
Sending file modes: C0644 0 testfile
...

Last lines in my server log:
8164 2019-02-21 10:18:37.834 debug3: LsaLogonUser Succeeded (Impersonation: 1)
8164 2019-02-21 10:18:37.850 debug3: spawning "C:\Program Files\OpenSSH-Win64\sshd.exe" -z
8164 2019-02-21 10:18:37.865 User child is on pid 2056
8164 2019-02-21 10:18:37.865 debug3: send_rexec_state: entering fd = 5 config len 289
8164 2019-02-21 10:18:37.865 debug3: ssh_msg_send: type 0
8164 2019-02-21 10:18:37.865 debug3: send_rexec_state: done
8164 2019-02-21 10:18:37.865 debug3: ssh_msg_send: type 0
8164 2019-02-21 10:18:37.865 debug3: ssh_msg_send: type 0
8164 2019-02-21 10:18:37.865 debug3: ssh_msg_send: type 0
8164 2019-02-21 10:18:37.865 debug3: ssh_msg_send: type 0
8164 2019-02-21 10:18:37.865 debug3: ssh_msg_send: type 0

Do you know what might cause it?

@NoMoreFood
Copy link

Reproducible. Appears to be a server side issue since the native client works fine against another SSH server. I'll try to take a look at the code tonight.

@jborean93
Copy link

This is slightly related, it doesn't hang but it will error without any info when trying to scp a file that doesn't exist on the remote #1284.

NoMoreFood added a commit to NoMoreFood/openssh-portable that referenced this issue Feb 22, 2019
- Changed fileio_fdopen() to simply return the file descriptor for non-disk file types.
- Addresses issue where an error message in SCP (server side) was not being returned to the pipe which causes the process to hang.  Resolves: PowerShell/Win32-OpenSSH#1345
@NoMoreFood
Copy link

Pull request is in: PowerShell/openssh-portable#376

@NoMoreFood
Copy link

If interested, you can test using these binaries: https://github.com/NoMoreFood/openssh-portable/releases/tag/v7.9-merge-1

manojampalam pushed a commit to PowerShell/openssh-portable that referenced this issue May 21, 2019
…sk file types

Addresses issue where an error message in SCP (server side) was not being returned to the pipe which causes the process to hang.  Resolves: PowerShell/Win32-OpenSSH#1345
@manojampalam manojampalam added this to the v8.0.0.0p1-Beta milestone Jun 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants