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

[Bug] - Set-SftpItem Stops Enter-PSSession Due to Progress Stream #588

Open
mattcargile opened this issue Aug 26, 2024 · 5 comments
Open

Comments

@mattcargile
Copy link

mattcargile commented Aug 26, 2024

When I run the below type of flow, the powershell ( 5.1.17763.6189 on Microsoft Windows Server 2019 Datacenter ) session is killed with the below. My client is pwsh 7.4.5 though I connect to the Desktop endpoint. My module version is _ 3.1.2_ which is old and I'm just now seeing that.

Processing data from remote server server1 failed with the following error message:
    The WSMan provider host process did not return a proper response.  A provider in the host process may have
    behaved improperly. For more information, see the about_Remote_Troubleshooting Help topic.

I run get-sftpchilditem , I do see the file was partially uploaded.

etsn server1
new-sftpSession -ComputerName IPAddress -Port 22 -Credential user
set-sftpItem -SessionId 0 -Destination /home/user/ -Path .\file.zip

Workaround

Run the below prior to uploading files. So I assume there is something going on with out the progress stream is being written.

$progresspreference = 'SilentlyContinue'
@darkoperator
Copy link
Owner

yep

@darkoperator
Copy link
Owner

I don't get the wsman error, since this module does not use powershell sessions or CIM. Are you importing the module remotely or using a pssession?

Repository owner deleted a comment Aug 26, 2024
@mattcargile
Copy link
Author

I don't get the wsman error, since this module does not use powershell sessions or CIM. Are you importing the module remotely or using a pssession?

Hmm. I import the module on the remote inside a powershell 5.1 session. Then I connect to another host via New-SftpSession.

Maybe it is a Module version issue on my end. Have you tried a largeish file that would actually show the progress bar? Are you using PowerShell Core as your client too?

@darkoperator
Copy link
Owner

darkoperator commented Aug 26, 2024 via email

@github-staff github-staff deleted a comment from mattcargile Aug 27, 2024
@darkoperator
Copy link
Owner

been checking and it could be a memory issue. I would try raising the memory of the PSSession. Can you try raising your max memory and testing?

set-item wsman:localhost\Shell\MaxMemoryPerShellMB 1024

Default is 150mb and the progress information when there are a lot of files could be consuming the amount of memory

https://learn.microsoft.com/en-us/windows/win32/winrm/installation-and-configuration-for-windows-remote-management?redirectedfrom=MSDN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants