2

I am running Powershell 7.1.4 in a Debian Buster Docker container and am trying to copy a file from the container to a remote Windows server. I can do this just fine for any file under 275K but cannot do this for any file 280K or larger.

I can copy my 280K test file from another Windows machine to the target server so I don't believe there is something strangely configured on my target server.

Here is the process I'm using to do the copy (commands taken from an application but run manually to verify the problem):

$password = "password" | ConvertTo-SecureString -asPlainText -Force
$username = "username"
$cred = New-Object System.Management.Automation.PSCredential($username,$password)
$copy_session = New-PSSession <server.fqdn> -credential $cred

# working copy-item command
Copy-Item -ToSession $copy_session /tmp/275k.txt  -Destination F:\275k.txt

# copy-item command that hangs forever - no messages.
Copy-Item -ToSession $copy_session /tmp/280k.txt  -Destination F:\280k.txt

# Test file details
-rw-r--r-- 1 root root 281600 Sep  3 18:49 275k.txt
-rw-r--r-- 1 root root 286720 Sep  3 18:50 280k.txt

The Copy-Item command for the 280k file never returns to the prompt, but just hangs there. CTRL+C doesn't work to stop the command, so I end up having to close the terminal session to stop it.

I can SCP other files from my docker container (not under Powershell) just fine with the same user account, so container local ulimits and permissions appear to be correct.

The only thing I can see different is the file size, but I'm not sure what setting or other configuration item is causing this behavior.

Any ideas?

Craig Souder
  • 68
  • 1
  • 4
  • Out of curiosity, what is your envelope size? – Abraham Zinala Sep 04 '21 at 01:05
  • Sorry for the delayed response (long weekend). On the target machine the MaxEnvelopeSizekb = 500. The source machine is linux so not sure what the equivalent parameter there is. – Craig Souder Sep 07 '21 at 15:43
  • Can you increase it to 5k and see if it works? – Abraham Zinala Sep 07 '21 at 15:56
  • 2
    We updated the value but there was no change (command still hung on execution). We are going to change how we get the files to the server to work around this issue. Thanks for the suggestions though! – Craig Souder Sep 07 '21 at 17:28
  • I have a similar problem on Amazon Linux ec2 instance with gssntlmssp package installed. Files <=284715 go through but 284716 bytes hangs, consistently. That is 278kB + 44 bytes. How are you uploading files to the server now? – too Apr 14 '22 at 16:48
  • 1
    @too This is a bit late, but to answer your question, we ended up pulling the file from the target server instead of pushing to it. Something like this: `"Invoke-WebRequest -Uri {uri} -OutFile {target_location} -credential {credential}"` – Craig Souder May 17 '22 at 15:36

0 Answers0