PowerShell / PowerShell/Win32-OpenSSH

SFTP Hangs on windows server 2016 and 2019 when running batch script (intermittent)

Open
#2,046 1 comment 0 reactions 1 assignee View on GitHub

@tgauth is already working on this.

Since Mar 27, 2023.

Area-SFTP Investigate Issue-Bug
Dominant language
No language data
Stars
8.3k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Steps to reproduce

When running the following sftp commands using a service account (Jenkins build agent).
The sftp command hangs and does not exit. We do not observe this hang on the server logs, and we also don't observe this hang on the Linux build agents which don't use this sftp client.

This issue occurs with 7.x - 9.2 of OpenSSH.
When we delete sftp.exe (Version 9.2) and replace it with sftp Version (1.0.0) keeping the rest of OpenSSH at version 9.2
Then we no longer observe this issue.

sftp -P 24 -B 65536 -R 128 -i path_to_public_key -b path_to_script username@hostname

contents of script

cd some_dir
put file_path1 fille_name
quit
Expected behavior
SFTP should not hang and should properly exit
Actual behavior
The process hangs and never exits
Error details

No response

Environment data
Name                           Value
----                           -----
PSVersion                      5.1.14393.5582
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.5582
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Version

7.x.x - 9.2.x

Visuals

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.